From 48fde701aff662559b38d9a609574068f22d00fe Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 8 Jan 2012 22:15:13 -0500 Subject: switch open-coded instances of d_make_root() to new helper Signed-off-by: Al Viro --- fs/configfs/mount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/configfs/mount.c') diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index 276e15cafd58..07f60455f1c1 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c @@ -91,10 +91,9 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) return -ENOMEM; } - root = d_alloc_root(inode); + root = d_make_root(inode); if (!root) { pr_debug("%s: could not get root dentry!\n",__func__); - iput(inode); return -ENOMEM; } config_group_init(&configfs_root_group); -- cgit v1.2.3 From 81d44ed159e3e81f7e62cee2d0fe68aae0c95e78 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 17 Mar 2012 16:13:25 -0400 Subject: configfs: don't bother with checks for mkdir/rmdir/unlink/symlink in root just give root directory separate inode_operations without all those methods... Signed-off-by: Al Viro --- fs/configfs/mount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/configfs/mount.c') diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index 07f60455f1c1..eb41adc28cfe 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c @@ -82,7 +82,7 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) inode = configfs_new_inode(S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, &configfs_root); if (inode) { - inode->i_op = &configfs_dir_inode_operations; + inode->i_op = &configfs_root_inode_operations; inode->i_fop = &configfs_dir_operations; /* directory inodes start off with i_nlink == 2 (for "." entry) */ inc_nlink(inode); -- cgit v1.2.3 From b7c177fcd2022ca8572284deb8f9b6ab5730eafb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 17 Mar 2012 16:24:54 -0400 Subject: configfs: kill configfs_sb Signed-off-by: Al Viro --- fs/configfs/mount.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'fs/configfs/mount.c') diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index eb41adc28cfe..cc829fc85d77 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c @@ -38,7 +38,6 @@ #define CONFIGFS_MAGIC 0x62656570 struct vfsmount * configfs_mount = NULL; -struct super_block * configfs_sb = NULL; struct kmem_cache *configfs_dir_cachep; static int configfs_mnt_count = 0; @@ -77,10 +76,9 @@ static int configfs_fill_super(struct super_block *sb, void *data, int silent) sb->s_magic = CONFIGFS_MAGIC; sb->s_op = &configfs_ops; sb->s_time_gran = 1; - configfs_sb = sb; inode = configfs_new_inode(S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, - &configfs_root); + &configfs_root, sb); if (inode) { inode->i_op = &configfs_root_inode_operations; inode->i_fop = &configfs_dir_operations; -- cgit v1.2.3 From 2a152ad3a58508b06b9e0482e68117a79bbb27ce Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 17 Mar 2012 16:53:29 -0400 Subject: make configfs_pin_fs() return root dentry on success ... and make configfs_mnt static Signed-off-by: Al Viro --- fs/configfs/mount.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fs/configfs/mount.c') diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index cc829fc85d77..aee0a7ebbd8e 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c @@ -37,7 +37,7 @@ /* Random magic number */ #define CONFIGFS_MAGIC 0x62656570 -struct vfsmount * configfs_mount = NULL; +static struct vfsmount *configfs_mount = NULL; struct kmem_cache *configfs_dir_cachep; static int configfs_mnt_count = 0; @@ -115,10 +115,11 @@ static struct file_system_type configfs_fs_type = { .kill_sb = kill_litter_super, }; -int configfs_pin_fs(void) +struct dentry *configfs_pin_fs(void) { - return simple_pin_fs(&configfs_fs_type, &configfs_mount, + int err = simple_pin_fs(&configfs_fs_type, &configfs_mount, &configfs_mnt_count); + return err ? ERR_PTR(err) : configfs_mount->mnt_root; } void configfs_release_fs(void) -- cgit v1.2.3