4 #include <linux/kernel.h>
6 #include <linux/ckrm.h>
7 #include <linux/ckrm_rc.h>
8 #include <linux/ckrm_ce.h>
10 /* The following declarations cannot be included in any of ckrm*.h files
11 without jumping hoops. Remove later when rearrangements done */
13 // Hubertus .. taken out
14 //extern ckrm_res_callback_t ckrm_res_ctlrs[CKRM_MAX_RES_CTLRS];
16 #define RCFS_MAGIC 0x4feedbac
17 #define RCFS_MAGF_NAMELEN 20
18 extern int RCFS_IS_MAGIC;
20 #define rcfs_is_magic(dentry) ((dentry)->d_fsdata == &RCFS_IS_MAGIC)
22 typedef struct rcfs_inode_info {
23 ckrm_core_class_t *core;
25 struct inode vfs_inode;
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)
32 char name[RCFS_MAGF_NAMELEN];
34 struct inode_operations *i_op;
35 struct file_operations *i_fop;
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
45 extern struct rcfs_mfdesc *genmfdesc[];
47 extern struct rcfs_inode_info *RCFS_I(struct inode *inode);
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 *);
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 *);
62 extern struct super_operations rcfs_super_ops;
63 extern struct address_space_operations rcfs_aops;
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;
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 reclassify_fileops;
75 extern struct file_operations rcfs_file_operations;
77 // Callbacks into rcfs from ckrm
79 typedef struct rcfs_functions {
80 int (*mkroot) (struct rcfs_magf *, int, struct dentry **);
81 int (*rmroot) (struct dentry *);
82 int (*register_classtype) (ckrm_classtype_t *);
83 int (*deregister_classtype) (ckrm_classtype_t *);
86 int rcfs_register_classtype(ckrm_classtype_t *);
87 int rcfs_deregister_classtype(ckrm_classtype_t *);
88 int rcfs_mkroot(struct rcfs_magf *, int, struct dentry **);
89 int rcfs_rmroot(struct dentry *);
91 #define RCFS_ROOT "/rcfs" // Hubertus .. we should use the mount point
92 // instead of hardcoded
93 extern struct dentry *rcfs_rootde;
94 extern rbce_eng_callback_t rcfs_eng_callbacks;
96 #endif /* _LINUX_RCFS_H */