Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

new helper: get_tree_keyed()

For vfs_get_keyed_super users.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 533770cc 1dd9bc08

+20 -9
+1 -2
fs/nfsd/nfsctl.c
··· 1386 1386 1387 1387 static int nfsd_fs_get_tree(struct fs_context *fc) 1388 1388 { 1389 - fc->s_fs_info = get_net(fc->net_ns); 1390 - return vfs_get_super(fc, vfs_get_keyed_super, nfsd_fill_super); 1389 + return get_tree_keyed(fc, nfsd_fill_super, get_net(fc->net_ns)); 1391 1390 } 1392 1391 1393 1392 static void nfsd_fs_free_fc(struct fs_context *fc)
+1 -2
fs/proc/root.c
··· 157 157 { 158 158 struct proc_fs_context *ctx = fc->fs_private; 159 159 160 - fc->s_fs_info = ctx->pid_ns; 161 - return vfs_get_super(fc, vfs_get_keyed_super, proc_fill_super); 160 + return get_tree_keyed(fc, proc_fill_super, ctx->pid_ns); 162 161 } 163 162 164 163 static void proc_fs_context_free(struct fs_context *fc)
+10
fs/super.c
··· 1211 1211 } 1212 1212 EXPORT_SYMBOL(get_tree_single); 1213 1213 1214 + int get_tree_keyed(struct fs_context *fc, 1215 + int (*fill_super)(struct super_block *sb, 1216 + struct fs_context *fc), 1217 + void *key) 1218 + { 1219 + fc->s_fs_info = key; 1220 + return vfs_get_super(fc, vfs_get_keyed_super, fill_super); 1221 + } 1222 + EXPORT_SYMBOL(get_tree_keyed); 1223 + 1214 1224 #ifdef CONFIG_BLOCK 1215 1225 static int set_bdev_super(struct super_block *s, void *data) 1216 1226 {
+6 -1
include/linux/fs_context.h
··· 136 136 extern void put_fs_context(struct fs_context *fc); 137 137 138 138 /* 139 - * sget() wrapper to be called from the ->get_tree() op. 139 + * sget() wrappers to be called from the ->get_tree() op. 140 140 */ 141 141 enum vfs_get_super_keying { 142 142 vfs_get_single_super, /* Only one such superblock may exist */ ··· 147 147 enum vfs_get_super_keying keying, 148 148 int (*fill_super)(struct super_block *sb, 149 149 struct fs_context *fc)); 150 + 150 151 extern int get_tree_nodev(struct fs_context *fc, 151 152 int (*fill_super)(struct super_block *sb, 152 153 struct fs_context *fc)); 153 154 extern int get_tree_single(struct fs_context *fc, 154 155 int (*fill_super)(struct super_block *sb, 155 156 struct fs_context *fc)); 157 + extern int get_tree_keyed(struct fs_context *fc, 158 + int (*fill_super)(struct super_block *sb, 159 + struct fs_context *fc), 160 + void *key); 156 161 157 162 extern const struct file_operations fscontext_fops; 158 163
+1 -2
ipc/mqueue.c
··· 364 364 { 365 365 struct mqueue_fs_context *ctx = fc->fs_private; 366 366 367 - fc->s_fs_info = ctx->ipc_ns; 368 - return vfs_get_super(fc, vfs_get_keyed_super, mqueue_fill_super); 367 + return get_tree_keyed(fc, mqueue_fill_super, ctx->ipc_ns); 369 368 } 370 369 371 370 static void mqueue_fs_context_free(struct fs_context *fc)
+1 -2
net/sunrpc/rpc_pipe.c
··· 1416 1416 1417 1417 static int rpc_fs_get_tree(struct fs_context *fc) 1418 1418 { 1419 - fc->s_fs_info = get_net(fc->net_ns); 1420 - return vfs_get_super(fc, vfs_get_keyed_super, rpc_fill_super); 1419 + return get_tree_keyed(fc, rpc_fill_super, get_net(fc->net_ns)); 1421 1420 } 1422 1421 1423 1422 static void rpc_fs_free_fc(struct fs_context *fc)