Lines Matching refs:fc

27 	struct fs_context *fc = file->private_data;
28 struct fc_log *log = fc->log.log;
35 ret = mutex_lock_interruptible(&fc->uapi_mutex);
40 mutex_unlock(&fc->uapi_mutex);
50 mutex_unlock(&fc->uapi_mutex);
69 struct fs_context *fc = file->private_data;
71 if (fc) {
73 put_fs_context(fc);
87 static int fscontext_create_fd(struct fs_context *fc, unsigned int o_flags)
91 fd = anon_inode_getfd("[fscontext]", &fscontext_fops, fc,
94 put_fs_context(fc);
98 static int fscontext_alloc_log(struct fs_context *fc)
100 fc->log.log = kzalloc(sizeof(*fc->log.log), GFP_KERNEL);
101 if (!fc->log.log)
103 refcount_set(&fc->log.log->usage, 1);
104 fc->log.log->owner = fc->fs_type->owner;
118 struct fs_context *fc;
137 fc = fs_context_for_mount(fs_type, 0);
139 if (IS_ERR(fc))
140 return PTR_ERR(fc);
142 fc->phase = FS_CONTEXT_CREATE_PARAMS;
144 ret = fscontext_alloc_log(fc);
148 return fscontext_create_fd(fc, flags & FSOPEN_CLOEXEC ? O_CLOEXEC : 0);
151 put_fs_context(fc);
160 struct fs_context *fc;
189 fc = fs_context_for_reconfigure(target.dentry, 0, 0);
190 if (IS_ERR(fc)) {
191 ret = PTR_ERR(fc);
195 fc->phase = FS_CONTEXT_RECONF_PARAMS;
197 ret = fscontext_alloc_log(fc);
202 return fscontext_create_fd(fc, flags & FSPICK_CLOEXEC ? O_CLOEXEC : 0);
205 put_fs_context(fc);
212 static int vfs_cmd_create(struct fs_context *fc, bool exclusive)
217 if (fc->phase != FS_CONTEXT_CREATE_PARAMS)
220 if (!mount_capable(fc))
224 if (exclusive && fc->ops == &legacy_fs_context_ops)
227 fc->phase = FS_CONTEXT_CREATING;
228 fc->exclusive = exclusive;
230 ret = vfs_get_tree(fc);
232 fc->phase = FS_CONTEXT_FAILED;
236 sb = fc->root->d_sb;
239 fc_drop_locked(fc);
240 fc->phase = FS_CONTEXT_FAILED;
246 fc->phase = FS_CONTEXT_AWAITING_MOUNT;
250 static int vfs_cmd_reconfigure(struct fs_context *fc)
255 if (fc->phase != FS_CONTEXT_RECONF_PARAMS)
258 fc->phase = FS_CONTEXT_RECONFIGURING;
260 sb = fc->root->d_sb;
262 fc->phase = FS_CONTEXT_FAILED;
267 ret = reconfigure_super(fc);
270 fc->phase = FS_CONTEXT_FAILED;
274 vfs_clean_context(fc);
282 static int vfs_fsconfig_locked(struct fs_context *fc, int cmd,
287 ret = finish_clean_context(fc);
292 return vfs_cmd_create(fc, false);
294 return vfs_cmd_create(fc, true);
296 return vfs_cmd_reconfigure(fc);
298 if (fc->phase != FS_CONTEXT_CREATE_PARAMS &&
299 fc->phase != FS_CONTEXT_RECONF_PARAMS)
302 return vfs_parse_fs_param(fc, param);
356 struct fs_context *fc;
407 fc = f.file->private_data;
408 if (fc->ops == &legacy_fs_context_ops) {
474 ret = mutex_lock_interruptible(&fc->uapi_mutex);
476 ret = vfs_fsconfig_locked(fc, cmd, &param);
477 mutex_unlock(&fc->uapi_mutex);