diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-08 22:15:13 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:35 -0400 |
commit | 48fde701aff662559b38d9a609574068f22d00fe (patch) | |
tree | aa6b203dc671b51d58575b65eb08310ff8309b60 /drivers | |
parent | 6b4231e2f92adbcf96fb2a3fa751d7ca0a61b21f (diff) |
switch open-coded instances of d_make_root() to new helper
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/ibmasm/ibmasmfs.c | 6 | ||||
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 6 | ||||
-rw-r--r-- | drivers/usb/core/inode.c | 9 | ||||
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 4 |
5 files changed, 8 insertions, 25 deletions
diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c index 35361753b487..15f24f362208 100644 --- a/drivers/misc/ibmasm/ibmasmfs.c +++ b/drivers/misc/ibmasm/ibmasmfs.c @@ -129,11 +129,9 @@ static int ibmasmfs_fill_super (struct super_block *sb, void *data, int silent) root->i_op = &simple_dir_inode_operations; root->i_fop = ibmasmfs_dir_ops; - root_dentry = d_alloc_root(root); - if (!root_dentry) { - iput(root); + root_dentry = d_make_root(root); + if (!root_dentry) return -ENOMEM; - } sb->s_root = root_dentry; ibmasmfs_create_files(sb, root_dentry); diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index 2f0aa0f700e6..277bb70b8d75 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c @@ -251,11 +251,9 @@ static int oprofilefs_fill_super(struct super_block *sb, void *data, int silent) return -ENOMEM; root_inode->i_op = &simple_dir_inode_operations; root_inode->i_fop = &simple_dir_operations; - root_dentry = d_alloc_root(root_inode); - if (!root_dentry) { - iput(root_inode); + root_dentry = d_make_root(root_inode); + if (!root_dentry) return -ENOMEM; - } sb->s_root = root_dentry; diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c index 9e186f3da839..bdaef8e36020 100644 --- a/drivers/usb/core/inode.c +++ b/drivers/usb/core/inode.c @@ -462,16 +462,9 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent) sb->s_op = &usbfs_ops; sb->s_time_gran = 1; inode = usbfs_get_inode(sb, S_IFDIR | 0755, 0); - - if (!inode) { - dbg("%s: could not get inode!",__func__); - return -ENOMEM; - } - - root = d_alloc_root(inode); + root = d_make_root(inode); if (!root) { dbg("%s: could not get root dentry!",__func__); - iput(inode); return -ENOMEM; } sb->s_root = root; diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index f63dc6c150d2..d825b248728a 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c @@ -1063,13 +1063,9 @@ static int ffs_sb_fill(struct super_block *sb, void *_data, int silent) &simple_dir_operations, &simple_dir_inode_operations, &data->perms); - if (unlikely(!inode)) + sb->s_root = d_make_root(inode); + if (unlikely(!sb->s_root)) goto Enomem; - sb->s_root = d_alloc_root(inode); - if (unlikely(!sb->s_root)) { - iput(inode); - goto Enomem; - } /* EP0 file */ if (unlikely(!ffs_sb_create_file(sb, "ep0", ffs, diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index ae04266dba1b..c95eea43b637 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c @@ -2059,10 +2059,8 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent) if (!inode) goto Enomem; inode->i_op = &simple_dir_inode_operations; - if (!(sb->s_root = d_alloc_root (inode))) { - iput(inode); + if (!(sb->s_root = d_make_root (inode))) goto Enomem; - } /* the ep0 file is named after the controller we expect; * user mode code can use it for sanity checks, like we do. |