This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / rcfs / tc_magic.c
1 /* 
2  * fs/rcfs/tc_magic.c 
3  *
4  * Copyright (C) Shailabh Nagar,      IBM Corp. 2004
5  *           (C) Vivek Kashyap,       IBM Corp. 2004
6  *           (C) Chandra Seetharaman, IBM Corp. 2004
7  *           (C) Hubertus Franke,     IBM Corp. 2004
8  *           
9  * 
10  * define magic fileops for taskclass classtype
11  *
12  * Latest version, more details at http://ckrm.sf.net
13  * 
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 2 of the License, or
17  * (at your option) any later version.
18  *
19  */
20
21 /* Changes
22  *
23  * 23 Apr 2004
24  *        Created.
25  *
26  */
27
28 #include <linux/rcfs.h>
29 #include <linux/ckrm_tc.h>
30
31 /*****************************************************************************
32  * Taskclass general
33  *
34  * Define structures for taskclass root directory and its magic files 
35  * In taskclasses, there is one set of magic files, created automatically under
36  * the taskclass root (upon classtype registration) and each directory (class) 
37  * created subsequently. However, classtypes can also choose to have different 
38  * sets of magic files created under their root and other directories under 
39  * root using their mkdir function. RCFS only provides helper functions for 
40  * creating the root directory and its magic files
41  * 
42  *****************************************************************************/
43
44 #define TC_FILE_MODE (S_IFREG | S_IRUGO | S_IWUSR)
45
46 #define NR_TCROOTMF  6
47 struct rcfs_magf tc_rootdesc[NR_TCROOTMF] = {
48         /* First entry must be root */
49         {
50 //              .name    = should not be set, copy from classtype name
51          .mode = RCFS_DEFAULT_DIR_MODE,
52          .i_op = &rcfs_dir_inode_operations,
53          .i_fop = &simple_dir_operations,
54          },
55         /* Rest are root's magic files */
56         {
57          .name = "target",
58          .mode = TC_FILE_MODE,
59          .i_fop = &target_fileops,
60          .i_op = &rcfs_file_inode_operations,
61          },
62         {
63          .name = "members",
64          .mode = TC_FILE_MODE,
65          .i_fop = &members_fileops,
66          .i_op = &rcfs_file_inode_operations,
67          },
68         {
69          .name = "stats",
70          .mode = TC_FILE_MODE,
71          .i_fop = &stats_fileops,
72          .i_op = &rcfs_file_inode_operations,
73          },
74         {
75          .name = "shares",
76          .mode = TC_FILE_MODE,
77          .i_fop = &shares_fileops,
78          .i_op = &rcfs_file_inode_operations,
79          },
80         // Config should be made available only at the root level
81         // Make sure this is the last entry, as rcfs_mkdir depends on it
82         {
83          .name = "config",
84          .mode = TC_FILE_MODE,
85          .i_fop = &config_fileops,
86          .i_op = &rcfs_file_inode_operations,
87          },
88 };
89
90 struct rcfs_mfdesc tc_mfdesc = {
91         .rootmf = tc_rootdesc,
92         .rootmflen = NR_TCROOTMF,
93 };