Lines Matching refs:fc
60 static int proc_parse_hidepid_param(struct fs_context *fc, struct fs_parameter *param) in proc_parse_hidepid_param() argument
62 struct proc_fs_context *ctx = fc->fs_private; in proc_parse_hidepid_param()
68 return invalf(fc, "proc: unexpected type of hidepid value\n"); in proc_parse_hidepid_param()
72 return invalf(fc, "proc: unknown value of hidepid - %s\n", param->string); in proc_parse_hidepid_param()
86 return invalf(fc, "proc: unknown value of hidepid - %s\n", param->string); in proc_parse_hidepid_param()
91 static int proc_parse_subset_param(struct fs_context *fc, char *value) in proc_parse_subset_param() argument
93 struct proc_fs_context *ctx = fc->fs_private; in proc_parse_subset_param()
105 return invalf(fc, "proc: unsupported subset option - %s\n", value); in proc_parse_subset_param()
115 static int proc_parse_pidns_param(struct fs_context *fc, in proc_parse_pidns_param() argument
119 struct proc_fs_context *ctx = fc->fs_private; in proc_parse_pidns_param()
139 errorfc(fc, "could not get file from pidns argument"); in proc_parse_pidns_param()
144 return invalfc(fc, "pidns argument is not an nsfs file"); in proc_parse_pidns_param()
147 return invalfc(fc, "pidns argument is not a pidns file"); in proc_parse_pidns_param()
155 errorfc(fc, "insufficient permissions to set pidns"); in proc_parse_pidns_param()
159 return invalfc(fc, "cannot set pidns to non-descendant pidns"); in proc_parse_pidns_param()
163 put_user_ns(fc->user_ns); in proc_parse_pidns_param()
164 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_parse_pidns_param()
169 static int proc_parse_param(struct fs_context *fc, struct fs_parameter *param) in proc_parse_param() argument
171 struct proc_fs_context *ctx = fc->fs_private; in proc_parse_param()
175 opt = fs_parse(fc, proc_fs_parameters, param, &result); in proc_parse_param()
185 err = proc_parse_hidepid_param(fc, param); in proc_parse_param()
191 err = proc_parse_subset_param(fc, param->string); in proc_parse_param()
205 if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) { in proc_parse_param()
206 errorfc(fc, "cannot reconfigure pidns for existing procfs"); in proc_parse_param()
209 err = proc_parse_pidns_param(fc, param, &result); in proc_parse_param()
214 errorfc(fc, "pidns mount flag not supported on this system"); in proc_parse_param()
227 struct fs_context *fc, in proc_apply_options() argument
230 struct proc_fs_context *ctx = fc->fs_private; in proc_apply_options()
239 !WARN_ON_ONCE(fc->purpose == FS_CONTEXT_FOR_RECONFIGURE)) { in proc_apply_options()
245 static int proc_fill_super(struct super_block *s, struct fs_context *fc) in proc_fill_super() argument
247 struct proc_fs_context *ctx = fc->fs_private; in proc_fill_super()
257 proc_apply_options(fs_info, fc, current_user_ns()); in proc_fill_super()
299 static int proc_reconfigure(struct fs_context *fc) in proc_reconfigure() argument
301 struct super_block *sb = fc->root->d_sb; in proc_reconfigure()
306 proc_apply_options(fs_info, fc, current_user_ns()); in proc_reconfigure()
310 static int proc_get_tree(struct fs_context *fc) in proc_get_tree() argument
312 return get_tree_nodev(fc, proc_fill_super); in proc_get_tree()
315 static void proc_fs_context_free(struct fs_context *fc) in proc_fs_context_free() argument
317 struct proc_fs_context *ctx = fc->fs_private; in proc_fs_context_free()
330 static int proc_init_fs_context(struct fs_context *fc) in proc_init_fs_context() argument
339 put_user_ns(fc->user_ns); in proc_init_fs_context()
340 fc->user_ns = get_user_ns(ctx->pid_ns->user_ns); in proc_init_fs_context()
341 fc->fs_private = ctx; in proc_init_fs_context()
342 fc->ops = &proc_fs_context_ops; in proc_init_fs_context()