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
1386 1386
1387static int nfsd_fs_get_tree(struct fs_context *fc)1387static int nfsd_fs_get_tree(struct fs_context *fc)
1388{1388{
1389 fc->s_fs_info = get_net(fc->net_ns);1389 return get_tree_keyed(fc, nfsd_fill_super, get_net(fc->net_ns));
1390 return vfs_get_super(fc, vfs_get_keyed_super, nfsd_fill_super);
1391}1390}
1392 1391
1393static void nfsd_fs_free_fc(struct fs_context *fc)1392static 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
157{157{
158 struct proc_fs_context *ctx = fc->fs_private;158 struct proc_fs_context *ctx = fc->fs_private;
159 159
160 fc->s_fs_info = ctx->pid_ns;160 return get_tree_keyed(fc, proc_fill_super, ctx->pid_ns);
161 return vfs_get_super(fc, vfs_get_keyed_super, proc_fill_super);
162}161}
163 162
164static void proc_fs_context_free(struct fs_context *fc)163static 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
1211}1211}
1212EXPORT_SYMBOL(get_tree_single);1212EXPORT_SYMBOL(get_tree_single);
1213 1213
1214int 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}
1222EXPORT_SYMBOL(get_tree_keyed);
1223
1214#ifdef CONFIG_BLOCK1224#ifdef CONFIG_BLOCK
1215static int set_bdev_super(struct super_block *s, void *data)1225static int set_bdev_super(struct super_block *s, void *data)
1216{1226{
include/linux/fs_context.h+6−1
@@ -136,7 +136,7 @@ extern int vfs_get_tree(struct fs_context *fc); · 135 unmodified lines
136extern void put_fs_context(struct fs_context *fc);136extern 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 */
141enum vfs_get_super_keying {141enum vfs_get_super_keying {
142 vfs_get_single_super, /* Only one such superblock may exist */142 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
147 enum vfs_get_super_keying keying,147 enum vfs_get_super_keying keying,
148 int (*fill_super)(struct super_block *sb,148 int (*fill_super)(struct super_block *sb,
149 struct fs_context *fc));149 struct fs_context *fc));
150
150extern int get_tree_nodev(struct fs_context *fc,151extern int get_tree_nodev(struct fs_context *fc,
151 int (*fill_super)(struct super_block *sb,152 int (*fill_super)(struct super_block *sb,
152 struct fs_context *fc));153 struct fs_context *fc));
153extern int get_tree_single(struct fs_context *fc,154extern int get_tree_single(struct fs_context *fc,
154 int (*fill_super)(struct super_block *sb,155 int (*fill_super)(struct super_block *sb,
155 struct fs_context *fc));156 struct fs_context *fc));
157extern 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
157extern const struct file_operations fscontext_fops;162extern const struct file_operations fscontext_fops;
158 163
ipc/mqueue.c+1−2
@@ -364,8 +364,7 @@ static int mqueue_get_tree(struct fs_context *fc) · 363 unmodified lines
364{364{
365 struct mqueue_fs_context *ctx = fc->fs_private;365 struct mqueue_fs_context *ctx = fc->fs_private;
366 366
367 fc->s_fs_info = ctx->ipc_ns;367 return get_tree_keyed(fc, mqueue_fill_super, ctx->ipc_ns);
368 return vfs_get_super(fc, vfs_get_keyed_super, mqueue_fill_super);
369}368}
370 369
371static void mqueue_fs_context_free(struct fs_context *fc)370static 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
1416 1416
1417static int rpc_fs_get_tree(struct fs_context *fc)1417static int rpc_fs_get_tree(struct fs_context *fc)
1418{1418{
1419 fc->s_fs_info = get_net(fc->net_ns);1419 return get_tree_keyed(fc, rpc_fill_super, get_net(fc->net_ns));
1420 return vfs_get_super(fc, vfs_get_keyed_super, rpc_fill_super);
1421}1420}
1422 1421
1423static void rpc_fs_free_fc(struct fs_context *fc)1422static 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