diff options
author | Joel Becker <joel.becker@oracle.com> | 2006-01-25 16:31:07 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-02-03 17:01:05 -0500 |
commit | 3d0f89bb169482d26d5aa4e82e763077e7e9bc4d (patch) | |
tree | 2d2317ce1417202322e3f715534fab80394bd5d2 /fs/configfs/configfs_internal.h | |
parent | 62ca3d2603571dc2b1b4c1368e19d44b599062e2 (diff) |
configfs: Add permission and ownership to configfs objects.
configfs always made item and attribute ownership root.root and
permissions based on a umask of 022. Add ->setattr() to allow
chown(2)/chmod(2), and persist the changes for the lifetime of the
items and attributes.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/configfs/configfs_internal.h')
-rw-r--r-- | fs/configfs/configfs_internal.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h index 8899d9c5f6b..f70e46951b3 100644 --- a/fs/configfs/configfs_internal.h +++ b/fs/configfs/configfs_internal.h | |||
@@ -36,6 +36,7 @@ struct configfs_dirent { | |||
36 | int s_type; | 36 | int s_type; |
37 | umode_t s_mode; | 37 | umode_t s_mode; |
38 | struct dentry * s_dentry; | 38 | struct dentry * s_dentry; |
39 | struct iattr * s_iattr; | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | #define CONFIGFS_ROOT 0x0001 | 42 | #define CONFIGFS_ROOT 0x0001 |
@@ -48,10 +49,11 @@ struct configfs_dirent { | |||
48 | #define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR) | 49 | #define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR) |
49 | 50 | ||
50 | extern struct vfsmount * configfs_mount; | 51 | extern struct vfsmount * configfs_mount; |
52 | extern kmem_cache_t *configfs_dir_cachep; | ||
51 | 53 | ||
52 | extern int configfs_is_root(struct config_item *item); | 54 | extern int configfs_is_root(struct config_item *item); |
53 | 55 | ||
54 | extern struct inode * configfs_new_inode(mode_t mode); | 56 | extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); |
55 | extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); | 57 | extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); |
56 | 58 | ||
57 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); | 59 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); |
@@ -63,6 +65,7 @@ extern void configfs_hash_and_remove(struct dentry * dir, const char * name); | |||
63 | 65 | ||
64 | extern const unsigned char * configfs_get_name(struct configfs_dirent *sd); | 66 | extern const unsigned char * configfs_get_name(struct configfs_dirent *sd); |
65 | extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent); | 67 | extern void configfs_drop_dentry(struct configfs_dirent *sd, struct dentry *parent); |
68 | extern int configfs_setattr(struct dentry *dentry, struct iattr *iattr); | ||
66 | 69 | ||
67 | extern int configfs_pin_fs(void); | 70 | extern int configfs_pin_fs(void); |
68 | extern void configfs_release_fs(void); | 71 | extern void configfs_release_fs(void); |
@@ -120,8 +123,10 @@ static inline struct config_item *configfs_get_config_item(struct dentry *dentry | |||
120 | 123 | ||
121 | static inline void release_configfs_dirent(struct configfs_dirent * sd) | 124 | static inline void release_configfs_dirent(struct configfs_dirent * sd) |
122 | { | 125 | { |
123 | if (!(sd->s_type & CONFIGFS_ROOT)) | 126 | if (!(sd->s_type & CONFIGFS_ROOT)) { |
124 | kfree(sd); | 127 | kfree(sd->s_iattr); |
128 | kmem_cache_free(configfs_dir_cachep, sd); | ||
129 | } | ||
125 | } | 130 | } |
126 | 131 | ||
127 | static inline struct configfs_dirent * configfs_get(struct configfs_dirent * sd) | 132 | static inline struct configfs_dirent * configfs_get(struct configfs_dirent * sd) |