From: NeilBrown Date: Wed, 2 Oct 2019 15:26:10 +0000 (-0400) Subject: LU-12514 obdclass: remove pointless struct lustre_mount_data2 X-Git-Tag: 2.13.51~58 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=99d616ca3d7df510c2375c15596a68b98f61cd37 LU-12514 obdclass: remove pointless struct lustre_mount_data2 This is used to pass a void* and NULL to lustre_fill_super(). It is easier just to pass the void*. The "NULL" passed is sometimes a "struct vfsmount". This pointer is passed to ll_fill_super() which then passes it to client_common_fill_super() that just ignores it. Linux-commit: 998831a00192a38a9f1425b2fb2d6faf3e34e665 Change-Id: If5e229d80c08b7c16e89d11a03fc766584c24f7c Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman Reviewed-on: https://review.whamcloud.com/35426 Reviewed-by: Neil Brown Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6701ca7..8d3f77e 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1581,21 +1581,16 @@ invalid: RETURN(-EINVAL); } -struct lustre_mount_data2 { - void *lmd2_data; - struct vfsmount *lmd2_mnt; -}; - /** * This is the entry point for the mount call into Lustre. * This is called when a server or client is mounted, * and this is where we start setting things up. * @param data Mount options (e.g. -o flock,abort_recov) */ -static int lustre_fill_super(struct super_block *sb, void *data, int silent) +static int lustre_fill_super(struct super_block *sb, void *lmd2_data, + int silent) { struct lustre_mount_data *lmd; - struct lustre_mount_data2 *lmd2 = data; struct lustre_sb_info *lsi; int rc; @@ -1620,7 +1615,7 @@ static int lustre_fill_super(struct super_block *sb, void *data, int silent) obd_zombie_barrier(); /* Figure out the lmd from the mount options */ - if (lmd_parse((char *)(lmd2->lmd2_data), lmd)) { + if (lmd_parse(lmd2_data, lmd)) { lustre_put_lsi(sb); GOTO(out, rc = -EINVAL); } @@ -1642,7 +1637,7 @@ static int lustre_fill_super(struct super_block *sb, void *data, int silent) } /* Connect and start */ /* (should always be ll_fill_super) */ - rc = (*client_fill_super)(sb, lmd2->lmd2_mnt); + rc = (*client_fill_super)(sb, NULL); /* c_f_s will call lustre_common_put_super on failure */ } } else { @@ -1701,22 +1696,13 @@ EXPORT_SYMBOL(lustre_register_kill_super_cb); static struct dentry *lustre_mount(struct file_system_type *fs_type, int flags, const char *devname, void *data) { - struct lustre_mount_data2 lmd2 = { - .lmd2_data = data, - }; - - return mount_nodev(fs_type, flags, &lmd2, lustre_fill_super); + return mount_nodev(fs_type, flags, data, lustre_fill_super); } #else static int lustre_get_sb(struct file_system_type *fs_type, int flags, const char *devname, void *data, struct vfsmount *mnt) { - struct lustre_mount_data2 lmd2 = { - .lmd2_data = data, - .lmd2_mnt = mnt, - }; - - return get_sb_nodev(fs_type, flags, &lmd2, lustre_fill_super, mnt); + return get_sb_nodev(fs_type, flags, data, lustre_fill_super, mnt); } #endif