This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / include / linux / rcfs.h
1 #ifndef _LINUX_RCFS_H
2 #define _LINUX_RCFS_H
3
4 #include <linux/kernel.h>
5 #include <linux/fs.h>
6 #include <linux/ckrm.h>
7 #include <linux/ckrm_rc.h>
8 #include <linux/ckrm_ce.h>
9
10 /* The following declarations cannot be included in any of ckrm*.h files 
11    without jumping hoops. Remove later when rearrangements done */
12
13 // Hubertus .. taken out 
14 //extern ckrm_res_callback_t ckrm_res_ctlrs[CKRM_MAX_RES_CTLRS];
15
16 #define RCFS_MAGIC      0x4feedbac
17 #define RCFS_MAGF_NAMELEN 20
18 extern int RCFS_IS_MAGIC;
19
20 #define rcfs_is_magic(dentry)  ((dentry)->d_fsdata == &RCFS_IS_MAGIC)
21
22 typedef struct rcfs_inode_info {
23         ckrm_core_class_t *core;
24         char *name;
25         struct inode vfs_inode;
26 } rcfs_inode_info_t;
27
28 #define RCFS_DEFAULT_DIR_MODE   (S_IFDIR | S_IRUGO | S_IXUGO)
29 #define RCFS_DEFAULT_FILE_MODE  (S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP |S_IROTH)
30
31 struct rcfs_magf {
32         char name[RCFS_MAGF_NAMELEN];
33         int mode;
34         struct inode_operations *i_op;
35         struct file_operations *i_fop;
36 };
37
38 struct rcfs_mfdesc {
39         struct rcfs_magf *rootmf;       // Root directory and its magic files
40         int rootmflen;                  // length of above array
41         // Can have a different magf describing magic files 
42         // for non-root entries too
43 };
44
45 extern struct rcfs_mfdesc *genmfdesc[];
46
47 inline struct rcfs_inode_info *RCFS_I(struct inode *inode);
48
49 int rcfs_empty(struct dentry *);
50 struct inode *rcfs_get_inode(struct super_block *, int, dev_t);
51 int rcfs_mknod(struct inode *, struct dentry *, int, dev_t);
52 int _rcfs_mknod(struct inode *, struct dentry *, int, dev_t);
53 int rcfs_mkdir(struct inode *, struct dentry *, int);
54 ckrm_core_class_t *rcfs_make_core(struct dentry *, struct ckrm_core_class *);
55 struct dentry *rcfs_set_magf_byname(char *, void *);
56
57 struct dentry *rcfs_create_internal(struct dentry *, struct rcfs_magf *, int);
58 int rcfs_delete_internal(struct dentry *);
59 int rcfs_create_magic(struct dentry *, struct rcfs_magf *, int);
60 int rcfs_clear_magic(struct dentry *);
61
62 extern struct super_operations rcfs_super_ops;
63 extern struct address_space_operations rcfs_aops;
64
65 extern struct inode_operations rcfs_dir_inode_operations;
66 extern struct inode_operations rcfs_rootdir_inode_operations;
67 extern struct inode_operations rcfs_file_inode_operations;
68
69 extern struct file_operations target_fileops;
70 extern struct file_operations shares_fileops;
71 extern struct file_operations stats_fileops;
72 extern struct file_operations config_fileops;
73 extern struct file_operations members_fileops;
74 extern struct file_operations rcfs_file_operations;
75
76 // Callbacks into rcfs from ckrm 
77
78 typedef struct rcfs_functions {
79         int (*mkroot) (struct rcfs_magf *, int, struct dentry **);
80         int (*rmroot) (struct dentry *);
81         int (*register_classtype) (ckrm_classtype_t *);
82         int (*deregister_classtype) (ckrm_classtype_t *);
83 } rcfs_fn_t;
84
85 int rcfs_register_classtype(ckrm_classtype_t *);
86 int rcfs_deregister_classtype(ckrm_classtype_t *);
87 int rcfs_mkroot(struct rcfs_magf *, int, struct dentry **);
88 int rcfs_rmroot(struct dentry *);
89
90 #define RCFS_ROOT "/rcfs"       // Hubertus .. we should use the mount point 
91                                 // instead of hardcoded
92 extern struct dentry *rcfs_rootde;
93 extern rbce_eng_callback_t rcfs_eng_callbacks;
94
95 #endif                          /* _LINUX_RCFS_H */