summaryrefslogtreecommitdiff
path: root/fs/orangefs/super.c
diff options
context:
space:
mode:
authorMike Marshall <hubcap@omnibond.com>2015-09-29 15:26:37 -0400
committerMike Marshall <hubcap@omnibond.com>2015-10-03 11:44:37 -0400
commit1be21f865aa5a94b178bf22e749567001cf5ef9b (patch)
tree669b415f8eb67ba7b350f695ce6822a000e3e11c /fs/orangefs/super.c
parent8c3905adea92c79e32b02120c724dfd4cf84dd85 (diff)
Orangefs: don't use mount_nodev, use sget directly.
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/super.c')
-rw-r--r--fs/orangefs/super.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index 90c7a1c9f201..9dee95293599 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -422,7 +422,7 @@ struct dentry *pvfs2_mount(struct file_system_type *fst,
struct super_block *sb = ERR_PTR(-EINVAL);
struct pvfs2_kernel_op_s *new_op;
struct pvfs2_mount_sb_info_s mount_sb_info;
- struct dentry *mnt_sb_d = ERR_PTR(-EINVAL);
+ struct dentry *d = ERR_PTR(-EINVAL);
gossip_debug(GOSSIP_SUPER_DEBUG,
"pvfs2_mount: called with devname %s\n",
@@ -464,23 +464,21 @@ struct dentry *pvfs2_mount(struct file_system_type *fst,
mount_sb_info.fs_id = new_op->downcall.resp.fs_mount.fs_id;
mount_sb_info.id = new_op->downcall.resp.fs_mount.id;
- /*
- * the mount_sb_info structure looks odd, but it's used because
- * the private sb info isn't allocated until we call
- * pvfs2_fill_sb, yet we have the info we need to fill it with
- * here. so we store it temporarily and pass all of the info
- * to fill_sb where it's properly copied out
- */
- mnt_sb_d = mount_nodev(fst,
- flags,
- (void *)&mount_sb_info,
- pvfs2_fill_sb);
- if (IS_ERR(mnt_sb_d)) {
- sb = ERR_CAST(mnt_sb_d);
+ sb = sget(fst, NULL, set_anon_super, flags, NULL);
+
+ if (IS_ERR(sb)) {
+ d = ERR_CAST(sb);
goto free_op;
}
- sb = mnt_sb_d->d_sb;
+ ret = pvfs2_fill_sb(sb,
+ (void *)&mount_sb_info,
+ flags & MS_SILENT ? 1 : 0);
+
+ if (ret) {
+ d = ERR_PTR(ret);
+ goto free_op;
+ }
/*
* on successful mount, store the devname and data
@@ -499,7 +497,7 @@ struct dentry *pvfs2_mount(struct file_system_type *fst,
*/
add_pvfs2_sb(sb);
op_release(new_op);
- return mnt_sb_d;
+ return dget(sb->s_root);
free_op:
gossip_err("pvfs2_mount: mount request failed with %d\n", ret);
@@ -510,10 +508,7 @@ free_op:
op_release(new_op);
- gossip_debug(GOSSIP_SUPER_DEBUG,
- "pvfs2_mount: returning dentry %p\n",
- mnt_sb_d);
- return mnt_sb_d;
+ return d;
}
void pvfs2_kill_sb(struct super_block *sb)