Lines Matching refs: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()
87 static int fscontext_create_fd(struct fs_context *fc, unsigned int o_flags) in fscontext_create_fd() argument
91 fd = anon_inode_getfd("[fscontext]", &fscontext_fops, fc, in fscontext_create_fd()
94 put_fs_context(fc); in fscontext_create_fd()
98 static int fscontext_alloc_log(struct fs_context *fc) in fscontext_alloc_log() argument
100 fc->log.log = kzalloc(sizeof(*fc->log.log), GFP_KERNEL); in fscontext_alloc_log()
101 if (!fc->log.log) in fscontext_alloc_log()
103 refcount_set(&fc->log.log->usage, 1); in fscontext_alloc_log()
104 fc->log.log->owner = fc->fs_type->owner; in fscontext_alloc_log()
118 struct fs_context *fc; in SYSCALL_DEFINE2() local
137 fc = fs_context_for_mount(fs_type, 0); in SYSCALL_DEFINE2()
139 if (IS_ERR(fc)) in SYSCALL_DEFINE2()
140 return PTR_ERR(fc); in SYSCALL_DEFINE2()
142 fc->phase = FS_CONTEXT_CREATE_PARAMS; in SYSCALL_DEFINE2()
144 ret = fscontext_alloc_log(fc); in SYSCALL_DEFINE2()
148 return fscontext_create_fd(fc, flags & FSOPEN_CLOEXEC ? O_CLOEXEC : 0); in SYSCALL_DEFINE2()
151 put_fs_context(fc); in SYSCALL_DEFINE2()
160 struct fs_context *fc; in SYSCALL_DEFINE3() local
189 fc = fs_context_for_reconfigure(target.dentry, 0, 0); in SYSCALL_DEFINE3()
190 if (IS_ERR(fc)) { in SYSCALL_DEFINE3()
191 ret = PTR_ERR(fc); in SYSCALL_DEFINE3()
195 fc->phase = FS_CONTEXT_RECONF_PARAMS; in SYSCALL_DEFINE3()
197 ret = fscontext_alloc_log(fc); in SYSCALL_DEFINE3()
202 return fscontext_create_fd(fc, flags & FSPICK_CLOEXEC ? O_CLOEXEC : 0); in SYSCALL_DEFINE3()
205 put_fs_context(fc); in SYSCALL_DEFINE3()
216 static int vfs_fsconfig_locked(struct fs_context *fc, int cmd, in vfs_fsconfig_locked() argument
222 ret = finish_clean_context(fc); in vfs_fsconfig_locked()
227 if (fc->phase != FS_CONTEXT_CREATE_PARAMS) in vfs_fsconfig_locked()
229 if (!mount_capable(fc)) in vfs_fsconfig_locked()
231 fc->phase = FS_CONTEXT_CREATING; in vfs_fsconfig_locked()
232 ret = vfs_get_tree(fc); in vfs_fsconfig_locked()
235 sb = fc->root->d_sb; in vfs_fsconfig_locked()
238 fc_drop_locked(fc); in vfs_fsconfig_locked()
242 fc->phase = FS_CONTEXT_AWAITING_MOUNT; in vfs_fsconfig_locked()
245 if (fc->phase != FS_CONTEXT_RECONF_PARAMS) in vfs_fsconfig_locked()
247 fc->phase = FS_CONTEXT_RECONFIGURING; in vfs_fsconfig_locked()
248 sb = fc->root->d_sb; in vfs_fsconfig_locked()
254 ret = reconfigure_super(fc); in vfs_fsconfig_locked()
258 vfs_clean_context(fc); in vfs_fsconfig_locked()
261 if (fc->phase != FS_CONTEXT_CREATE_PARAMS && in vfs_fsconfig_locked()
262 fc->phase != FS_CONTEXT_RECONF_PARAMS) in vfs_fsconfig_locked()
265 return vfs_parse_fs_param(fc, param); in vfs_fsconfig_locked()
267 fc->phase = FS_CONTEXT_FAILED; in vfs_fsconfig_locked()
321 struct fs_context *fc; in SYSCALL_DEFINE5() local
371 fc = f.file->private_data; in SYSCALL_DEFINE5()
372 if (fc->ops == &legacy_fs_context_ops) { in SYSCALL_DEFINE5()
437 ret = mutex_lock_interruptible(&fc->uapi_mutex); in SYSCALL_DEFINE5()
439 ret = vfs_fsconfig_locked(fc, cmd, &param); in SYSCALL_DEFINE5()
440 mutex_unlock(&fc->uapi_mutex); in SYSCALL_DEFINE5()