diff options
Diffstat (limited to 'fs/configfs')
-rw-r--r-- | fs/configfs/configfs_internal.h | 2 | ||||
-rw-r--r-- | fs/configfs/dir.c | 19 | ||||
-rw-r--r-- | fs/configfs/file.c | 12 | ||||
-rw-r--r-- | fs/configfs/mount.c | 2 |
4 files changed, 18 insertions, 17 deletions
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h index 3f4ff7a242b9..f92cd303d2c9 100644 --- a/fs/configfs/configfs_internal.h +++ b/fs/configfs/configfs_internal.h | |||
@@ -49,7 +49,7 @@ struct configfs_dirent { | |||
49 | #define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR) | 49 | #define CONFIGFS_NOT_PINNED (CONFIGFS_ITEM_ATTR) |
50 | 50 | ||
51 | extern struct vfsmount * configfs_mount; | 51 | extern struct vfsmount * configfs_mount; |
52 | extern kmem_cache_t *configfs_dir_cachep; | 52 | extern struct kmem_cache *configfs_dir_cachep; |
53 | 53 | ||
54 | extern int configfs_is_root(struct config_item *item); | 54 | extern int configfs_is_root(struct config_item *item); |
55 | 55 | ||
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 8a3b6a1a6ad1..1814ba446809 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -93,8 +93,8 @@ static struct configfs_dirent *configfs_new_dirent(struct configfs_dirent * pare | |||
93 | * | 93 | * |
94 | * called with parent inode's i_mutex held | 94 | * called with parent inode's i_mutex held |
95 | */ | 95 | */ |
96 | int configfs_dirent_exists(struct configfs_dirent *parent_sd, | 96 | static int configfs_dirent_exists(struct configfs_dirent *parent_sd, |
97 | const unsigned char *new) | 97 | const unsigned char *new) |
98 | { | 98 | { |
99 | struct configfs_dirent * sd; | 99 | struct configfs_dirent * sd; |
100 | 100 | ||
@@ -980,7 +980,7 @@ int configfs_rename_dir(struct config_item * item, const char *new_name) | |||
980 | 980 | ||
981 | static int configfs_dir_open(struct inode *inode, struct file *file) | 981 | static int configfs_dir_open(struct inode *inode, struct file *file) |
982 | { | 982 | { |
983 | struct dentry * dentry = file->f_dentry; | 983 | struct dentry * dentry = file->f_path.dentry; |
984 | struct configfs_dirent * parent_sd = dentry->d_fsdata; | 984 | struct configfs_dirent * parent_sd = dentry->d_fsdata; |
985 | 985 | ||
986 | mutex_lock(&dentry->d_inode->i_mutex); | 986 | mutex_lock(&dentry->d_inode->i_mutex); |
@@ -993,7 +993,7 @@ static int configfs_dir_open(struct inode *inode, struct file *file) | |||
993 | 993 | ||
994 | static int configfs_dir_close(struct inode *inode, struct file *file) | 994 | static int configfs_dir_close(struct inode *inode, struct file *file) |
995 | { | 995 | { |
996 | struct dentry * dentry = file->f_dentry; | 996 | struct dentry * dentry = file->f_path.dentry; |
997 | struct configfs_dirent * cursor = file->private_data; | 997 | struct configfs_dirent * cursor = file->private_data; |
998 | 998 | ||
999 | mutex_lock(&dentry->d_inode->i_mutex); | 999 | mutex_lock(&dentry->d_inode->i_mutex); |
@@ -1013,7 +1013,7 @@ static inline unsigned char dt_type(struct configfs_dirent *sd) | |||
1013 | 1013 | ||
1014 | static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | 1014 | static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir) |
1015 | { | 1015 | { |
1016 | struct dentry *dentry = filp->f_dentry; | 1016 | struct dentry *dentry = filp->f_path.dentry; |
1017 | struct configfs_dirent * parent_sd = dentry->d_fsdata; | 1017 | struct configfs_dirent * parent_sd = dentry->d_fsdata; |
1018 | struct configfs_dirent *cursor = filp->private_data; | 1018 | struct configfs_dirent *cursor = filp->private_data; |
1019 | struct list_head *p, *q = &cursor->s_sibling; | 1019 | struct list_head *p, *q = &cursor->s_sibling; |
@@ -1070,7 +1070,7 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir | |||
1070 | 1070 | ||
1071 | static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin) | 1071 | static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin) |
1072 | { | 1072 | { |
1073 | struct dentry * dentry = file->f_dentry; | 1073 | struct dentry * dentry = file->f_path.dentry; |
1074 | 1074 | ||
1075 | mutex_lock(&dentry->d_inode->i_mutex); | 1075 | mutex_lock(&dentry->d_inode->i_mutex); |
1076 | switch (origin) { | 1076 | switch (origin) { |
@@ -1080,7 +1080,7 @@ static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin) | |||
1080 | if (offset >= 0) | 1080 | if (offset >= 0) |
1081 | break; | 1081 | break; |
1082 | default: | 1082 | default: |
1083 | mutex_unlock(&file->f_dentry->d_inode->i_mutex); | 1083 | mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); |
1084 | return -EINVAL; | 1084 | return -EINVAL; |
1085 | } | 1085 | } |
1086 | if (offset != file->f_pos) { | 1086 | if (offset != file->f_pos) { |
@@ -1176,8 +1176,9 @@ void configfs_unregister_subsystem(struct configfs_subsystem *subsys) | |||
1176 | return; | 1176 | return; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | mutex_lock(&configfs_sb->s_root->d_inode->i_mutex); | 1179 | mutex_lock_nested(&configfs_sb->s_root->d_inode->i_mutex, |
1180 | mutex_lock(&dentry->d_inode->i_mutex); | 1180 | I_MUTEX_PARENT); |
1181 | mutex_lock_nested(&dentry->d_inode->i_mutex, I_MUTEX_CHILD); | ||
1181 | if (configfs_detach_prep(dentry)) { | 1182 | if (configfs_detach_prep(dentry)) { |
1182 | printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n"); | 1183 | printk(KERN_ERR "configfs: Tried to unregister non-empty subsystem!\n"); |
1183 | } | 1184 | } |
diff --git a/fs/configfs/file.c b/fs/configfs/file.c index cf33fac68c84..2a7cb086e80c 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c | |||
@@ -134,7 +134,7 @@ configfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *pp | |||
134 | 134 | ||
135 | down(&buffer->sem); | 135 | down(&buffer->sem); |
136 | if (buffer->needs_read_fill) { | 136 | if (buffer->needs_read_fill) { |
137 | if ((retval = fill_read_buffer(file->f_dentry,buffer))) | 137 | if ((retval = fill_read_buffer(file->f_path.dentry,buffer))) |
138 | goto out; | 138 | goto out; |
139 | } | 139 | } |
140 | pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", | 140 | pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", |
@@ -222,7 +222,7 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof | |||
222 | down(&buffer->sem); | 222 | down(&buffer->sem); |
223 | len = fill_write_buffer(buffer, buf, count); | 223 | len = fill_write_buffer(buffer, buf, count); |
224 | if (len > 0) | 224 | if (len > 0) |
225 | len = flush_write_buffer(file->f_dentry, buffer, count); | 225 | len = flush_write_buffer(file->f_path.dentry, buffer, count); |
226 | if (len > 0) | 226 | if (len > 0) |
227 | *ppos += len; | 227 | *ppos += len; |
228 | up(&buffer->sem); | 228 | up(&buffer->sem); |
@@ -231,8 +231,8 @@ configfs_write_file(struct file *file, const char __user *buf, size_t count, lof | |||
231 | 231 | ||
232 | static int check_perm(struct inode * inode, struct file * file) | 232 | static int check_perm(struct inode * inode, struct file * file) |
233 | { | 233 | { |
234 | struct config_item *item = configfs_get_config_item(file->f_dentry->d_parent); | 234 | struct config_item *item = configfs_get_config_item(file->f_path.dentry->d_parent); |
235 | struct configfs_attribute * attr = to_attr(file->f_dentry); | 235 | struct configfs_attribute * attr = to_attr(file->f_path.dentry); |
236 | struct configfs_buffer * buffer; | 236 | struct configfs_buffer * buffer; |
237 | struct configfs_item_operations * ops = NULL; | 237 | struct configfs_item_operations * ops = NULL; |
238 | int error = 0; | 238 | int error = 0; |
@@ -305,8 +305,8 @@ static int configfs_open_file(struct inode * inode, struct file * filp) | |||
305 | 305 | ||
306 | static int configfs_release(struct inode * inode, struct file * filp) | 306 | static int configfs_release(struct inode * inode, struct file * filp) |
307 | { | 307 | { |
308 | struct config_item * item = to_item(filp->f_dentry->d_parent); | 308 | struct config_item * item = to_item(filp->f_path.dentry->d_parent); |
309 | struct configfs_attribute * attr = to_attr(filp->f_dentry); | 309 | struct configfs_attribute * attr = to_attr(filp->f_path.dentry); |
310 | struct module * owner = attr->ca_owner; | 310 | struct module * owner = attr->ca_owner; |
311 | struct configfs_buffer * buffer = filp->private_data; | 311 | struct configfs_buffer * buffer = filp->private_data; |
312 | 312 | ||
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index 68bd5c93ca52..ed678529ebb2 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | struct vfsmount * configfs_mount = NULL; | 39 | struct vfsmount * configfs_mount = NULL; |
40 | struct super_block * configfs_sb = NULL; | 40 | struct super_block * configfs_sb = NULL; |
41 | kmem_cache_t *configfs_dir_cachep; | 41 | struct kmem_cache *configfs_dir_cachep; |
42 | static int configfs_mnt_count = 0; | 42 | static int configfs_mnt_count = 0; |
43 | 43 | ||
44 | static struct super_operations configfs_ops = { | 44 | static struct super_operations configfs_ops = { |