Lines Matching full:fc

27 	struct fs_context *fc = file->private_data;  in fscontext_read()  local
28 struct fc_log *log = fc->log.log; in fscontext_read()
35 ret = mutex_lock_interruptible(&fc->uapi_mutex); in fscontext_read()
40 mutex_unlock(&fc->uapi_mutex); in fscontext_read()
50 mutex_unlock(&fc->uapi_mutex); in fscontext_read()
69 struct fs_context *fc = file->private_data; in fscontext_release() local
71 if (fc) { in fscontext_release()
73 put_fs_context(fc); in fscontext_release()
86 static int fscontext_create_fd(struct fs_context *fc, unsigned int o_flags) in fscontext_create_fd() argument
90 fd = anon_inode_getfd("[fscontext]", &fscontext_fops, fc, in fscontext_create_fd()
93 put_fs_context(fc); in fscontext_create_fd()
97 static int fscontext_alloc_log(struct fs_context *fc) in fscontext_alloc_log() argument
99 fc->log.log = kzalloc(sizeof(*fc->log.log), GFP_KERNEL); in fscontext_alloc_log()
100 if (!fc->log.log) in fscontext_alloc_log()
102 refcount_set(&fc->log.log->usage, 1); in fscontext_alloc_log()
103 fc->log.log->owner = fc->fs_type->owner; in fscontext_alloc_log()
117 struct fs_context *fc; in SYSCALL_DEFINE2() local
136 fc = fs_context_for_mount(fs_type, 0); in SYSCALL_DEFINE2()
138 if (IS_ERR(fc)) in SYSCALL_DEFINE2()
139 return PTR_ERR(fc); in SYSCALL_DEFINE2()
141 fc->phase = FS_CONTEXT_CREATE_PARAMS; in SYSCALL_DEFINE2()
143 ret = fscontext_alloc_log(fc); in SYSCALL_DEFINE2()
147 return fscontext_create_fd(fc, flags & FSOPEN_CLOEXEC ? O_CLOEXEC : 0); in SYSCALL_DEFINE2()
150 put_fs_context(fc); in SYSCALL_DEFINE2()
159 struct fs_context *fc; in SYSCALL_DEFINE3() local
188 fc = fs_context_for_reconfigure(target.dentry, 0, 0); in SYSCALL_DEFINE3()
189 if (IS_ERR(fc)) { in SYSCALL_DEFINE3()
190 ret = PTR_ERR(fc); in SYSCALL_DEFINE3()
194 fc->phase = FS_CONTEXT_RECONF_PARAMS; in SYSCALL_DEFINE3()
196 ret = fscontext_alloc_log(fc); in SYSCALL_DEFINE3()
201 return fscontext_create_fd(fc, flags & FSPICK_CLOEXEC ? O_CLOEXEC : 0); in SYSCALL_DEFINE3()
204 put_fs_context(fc); in SYSCALL_DEFINE3()
211 static int vfs_cmd_create(struct fs_context *fc, bool exclusive) in vfs_cmd_create() argument
216 if (fc->phase != FS_CONTEXT_CREATE_PARAMS) in vfs_cmd_create()
219 if (!mount_capable(fc)) in vfs_cmd_create()
222 fc->phase = FS_CONTEXT_CREATING; in vfs_cmd_create()
223 fc->exclusive = exclusive; in vfs_cmd_create()
225 ret = vfs_get_tree(fc); in vfs_cmd_create()
227 fc->phase = FS_CONTEXT_FAILED; in vfs_cmd_create()
231 sb = fc->root->d_sb; in vfs_cmd_create()
234 fc_drop_locked(fc); in vfs_cmd_create()
235 fc->phase = FS_CONTEXT_FAILED; in vfs_cmd_create()
241 fc->phase = FS_CONTEXT_AWAITING_MOUNT; in vfs_cmd_create()
245 static int vfs_cmd_reconfigure(struct fs_context *fc) in vfs_cmd_reconfigure() argument
250 if (fc->phase != FS_CONTEXT_RECONF_PARAMS) in vfs_cmd_reconfigure()
253 fc->phase = FS_CONTEXT_RECONFIGURING; in vfs_cmd_reconfigure()
255 sb = fc->root->d_sb; in vfs_cmd_reconfigure()
257 fc->phase = FS_CONTEXT_FAILED; in vfs_cmd_reconfigure()
262 ret = reconfigure_super(fc); in vfs_cmd_reconfigure()
265 fc->phase = FS_CONTEXT_FAILED; in vfs_cmd_reconfigure()
269 vfs_clean_context(fc); in vfs_cmd_reconfigure()
277 static int vfs_fsconfig_locked(struct fs_context *fc, int cmd, in vfs_fsconfig_locked() argument
282 ret = finish_clean_context(fc); in vfs_fsconfig_locked()
287 return vfs_cmd_create(fc, false); in vfs_fsconfig_locked()
289 return vfs_cmd_create(fc, true); in vfs_fsconfig_locked()
291 return vfs_cmd_reconfigure(fc); in vfs_fsconfig_locked()
293 if (fc->phase != FS_CONTEXT_CREATE_PARAMS && in vfs_fsconfig_locked()
294 fc->phase != FS_CONTEXT_RECONF_PARAMS) in vfs_fsconfig_locked()
297 return vfs_parse_fs_param(fc, param); in vfs_fsconfig_locked()
351 struct fs_context *fc; in SYSCALL_DEFINE5() local
402 fc = fd_file(f)->private_data; in SYSCALL_DEFINE5()
403 if (fc->ops == &legacy_fs_context_ops) { in SYSCALL_DEFINE5()
470 ret = mutex_lock_interruptible(&fc->uapi_mutex); in SYSCALL_DEFINE5()
472 ret = vfs_fsconfig_locked(fc, cmd, &param); in SYSCALL_DEFINE5()
473 mutex_unlock(&fc->uapi_mutex); in SYSCALL_DEFINE5()