History

new helper: get_tree_keyed()

For vfs_get_keyed_super users.

Al Viro committed 7 years ago

Commit 533770c1 parent 1dd9bc06 files · +20 −9Browse files

Unified · Split

6 files
  1. fs/nfsd/nfsctl.c +1 −2
  2. fs/proc/root.c +1 −2
  3. fs/super.c +10 −0
  4. include/linux/fs_context.h +6 −1
  5. ipc/mqueue.c +1 −2
  6. net/sunrpc/rpc_pipe.c +1 −2
fs/nfsd/nfsctl.c+1−2
@@ -1386,8 +1386,7 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc) · 1385 unmodified lines
13861386
13871387 static int nfsd_fs_get_tree(struct fs_context *fc)
13881388 {
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));
13911390 }
13921391
13931392 static void nfsd_fs_free_fc(struct fs_context *fc)
fs/proc/root.c+1−2
@@ -157,8 +157,7 @@ static int proc_get_tree(struct fs_context *fc) · 156 unmodified lines
157157 {
158158 struct proc_fs_context *ctx = fc->fs_private;
159159
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);
162161 }
163162
164163 static void proc_fs_context_free(struct fs_context *fc)
fs/super.c+10−0
@@ -1211,6 +1211,16 @@ int get_tree_single(struct fs_context *fc, · 1210 unmodified lines
12111211 }
12121212 EXPORT_SYMBOL(get_tree_single);
12131213
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+
12141224 #ifdef CONFIG_BLOCK
12151225 static int set_bdev_super(struct super_block *s, void *data)
12161226 {
include/linux/fs_context.h+6−1
@@ -136,7 +136,7 @@ extern int vfs_get_tree(struct fs_context *fc); · 135 unmodified lines
136136 extern void put_fs_context(struct fs_context *fc);
137137
138138 /*
139− * sget() wrapper to be called from the ->get_tree() op.
139+ * sget() wrappers to be called from the ->get_tree() op.
140140 */
141141 enum vfs_get_super_keying {
142142 vfs_get_single_super, /* Only one such superblock may exist */
@@ -147,12 +147,17 @@ extern int vfs_get_super(struct fs_context *fc, · 4 unmodified lines
147147 enum vfs_get_super_keying keying,
148148 int (*fill_super)(struct super_block *sb,
149149 struct fs_context *fc));
150+
150151 extern int get_tree_nodev(struct fs_context *fc,
151152 int (*fill_super)(struct super_block *sb,
152153 struct fs_context *fc));
153154 extern int get_tree_single(struct fs_context *fc,
154155 int (*fill_super)(struct super_block *sb,
155156 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);
156161
157162 extern const struct file_operations fscontext_fops;
158163
ipc/mqueue.c+1−2
@@ -364,8 +364,7 @@ static int mqueue_get_tree(struct fs_context *fc) · 363 unmodified lines
364364 {
365365 struct mqueue_fs_context *ctx = fc->fs_private;
366366
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);
369368 }
370369
371370 static void mqueue_fs_context_free(struct fs_context *fc)
net/sunrpc/rpc_pipe.c+1−2
@@ -1416,8 +1416,7 @@ EXPORT_SYMBOL_GPL(gssd_running); · 1415 unmodified lines
14161416
14171417 static int rpc_fs_get_tree(struct fs_context *fc)
14181418 {
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));
14211420 }
14221421
14231422 static void rpc_fs_free_fc(struct fs_context *fc)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t