This stack check implementation leverages the compiler's profiling (gcc -p)
[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 /*******************************************************************************
33  * Taskclass general
34  *
35  * Define structures for taskclass root directory and its magic files 
36  * In taskclasses, there is one set of magic files, created automatically under
37  * the taskclass root (upon classtype registration) and each directory (class) 
38  * created subsequently. However, classtypes can also choose to have different 
39  * sets of magic files created under their root and other directories under root
40  * using their mkdir function. RCFS only provides helper functions for creating 
41  * the root directory and its magic files
42  * 
43  *******************************************************************************/
44
45 #define TC_FILE_MODE (S_IFREG | S_IRUGO | S_IWUSR) 
46         
47 #define NR_TCROOTMF  6
48 struct rcfs_magf tc_rootdesc[NR_TCROOTMF] = {
49         /* First entry must be root */
50         { 
51 //              .name    = should not be set, copy from classtype name
52                 .mode    = RCFS_DEFAULT_DIR_MODE,
53                 .i_op    = &rcfs_dir_inode_operations,
54                 .i_fop   = &simple_dir_operations,
55         },
56         /* Rest are root's magic files */
57         { 
58                 .name    =  "target", 
59                 .mode    = TC_FILE_MODE, 
60                 .i_fop   = &target_fileops,
61                 .i_op    = &rcfs_file_inode_operations,
62         },
63         { 
64                 .name    =  "config", 
65                 .mode    = TC_FILE_MODE, 
66                 .i_fop   = &config_fileops, 
67                 .i_op    = &rcfs_file_inode_operations,
68         },
69         { 
70                 .name    =  "members", 
71                 .mode    = TC_FILE_MODE, 
72                 .i_fop   = &members_fileops,
73                 .i_op    = &rcfs_file_inode_operations,
74         },
75         { 
76                 .name    =  "stats", 
77                 .mode    = TC_FILE_MODE, 
78                 .i_fop   = &stats_fileops, 
79                 .i_op    = &rcfs_file_inode_operations,
80         },
81         { 
82                 .name    =  "shares", 
83                 .mode    = TC_FILE_MODE,
84                 .i_fop   = &shares_fileops, 
85                 .i_op    = &rcfs_file_inode_operations,
86         },
87 };
88
89 struct rcfs_mfdesc tc_mfdesc = {
90         .rootmf          = tc_rootdesc,
91         .rootmflen       = NR_TCROOTMF,
92 };
93
94