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