Lines Matching +full:control +full:- +full:parent
3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
18 * This is non-NULL when the single instance of the control filesystem
27 fc = file_inode(file)->i_private; in fuse_ctl_file_conn_get()
39 if (fc->abort_err) in fuse_conn_abort_write()
40 fc->aborted = true; in fuse_conn_abort_write()
59 value = atomic_read(&fc->num_waiting); in fuse_conn_waiting_read()
60 file->private_data = (void *)value; in fuse_conn_waiting_read()
63 size = sprintf(tmp, "%ld\n", (long)file->private_data); in fuse_conn_waiting_read()
81 unsigned limit = (1 << 16) - 1; in fuse_conn_limit_write()
85 return -EINVAL; in fuse_conn_limit_write()
95 return -EINVAL; in fuse_conn_limit_write()
113 val = READ_ONCE(fc->max_background); in fuse_conn_max_background_read()
131 spin_lock(&fc->bg_lock); in fuse_conn_max_background_write()
132 fc->max_background = val; in fuse_conn_max_background_write()
133 fc->blocked = fc->num_background >= fc->max_background; in fuse_conn_max_background_write()
134 if (!fc->blocked) in fuse_conn_max_background_write()
135 wake_up(&fc->blocked_waitq); in fuse_conn_max_background_write()
136 spin_unlock(&fc->bg_lock); in fuse_conn_max_background_write()
155 val = READ_ONCE(fc->congestion_threshold); in fuse_conn_congestion_threshold_read()
177 WRITE_ONCE(fc->congestion_threshold, val); in fuse_conn_congestion_threshold_write()
205 static struct dentry *fuse_ctl_add_dentry(struct dentry *parent, in fuse_ctl_add_dentry() argument
215 BUG_ON(fc->ctl_ndents >= FUSE_CTL_NUM_DENTRIES); in fuse_ctl_add_dentry()
216 dentry = d_alloc_name(parent, name); in fuse_ctl_add_dentry()
226 inode->i_ino = get_next_ino(); in fuse_ctl_add_dentry()
227 inode->i_mode = mode; in fuse_ctl_add_dentry()
228 inode->i_uid = fc->user_id; in fuse_ctl_add_dentry()
229 inode->i_gid = fc->group_id; in fuse_ctl_add_dentry()
231 /* setting ->i_op to NULL is not allowed */ in fuse_ctl_add_dentry()
233 inode->i_op = iop; in fuse_ctl_add_dentry()
234 inode->i_fop = fop; in fuse_ctl_add_dentry()
236 inode->i_private = fc; in fuse_ctl_add_dentry()
239 fc->ctl_dentry[fc->ctl_ndents++] = dentry; in fuse_ctl_add_dentry()
245 * Add a connection to the control filesystem (if it exists). Caller
250 struct dentry *parent; in fuse_ctl_add_conn() local
253 if (!fuse_control_sb || fc->no_control) in fuse_ctl_add_conn()
256 parent = fuse_control_sb->s_root; in fuse_ctl_add_conn()
257 inc_nlink(d_inode(parent)); in fuse_ctl_add_conn()
258 sprintf(name, "%u", fc->dev); in fuse_ctl_add_conn()
259 parent = fuse_ctl_add_dentry(parent, fc, name, S_IFDIR | 0500, 2, in fuse_ctl_add_conn()
262 if (!parent) in fuse_ctl_add_conn()
265 if (!fuse_ctl_add_dentry(parent, fc, "waiting", S_IFREG | 0400, 1, in fuse_ctl_add_conn()
267 !fuse_ctl_add_dentry(parent, fc, "abort", S_IFREG | 0200, 1, in fuse_ctl_add_conn()
269 !fuse_ctl_add_dentry(parent, fc, "max_background", S_IFREG | 0600, in fuse_ctl_add_conn()
271 !fuse_ctl_add_dentry(parent, fc, "congestion_threshold", in fuse_ctl_add_conn()
280 return -ENOMEM; in fuse_ctl_add_conn()
284 * Remove a connection from the control filesystem (if it exists).
291 if (!fuse_control_sb || fc->no_control) in fuse_ctl_remove_conn()
294 for (i = fc->ctl_ndents - 1; i >= 0; i--) { in fuse_ctl_remove_conn()
295 struct dentry *dentry = fc->ctl_dentry[i]; in fuse_ctl_remove_conn()
296 d_inode(dentry)->i_private = NULL; in fuse_ctl_remove_conn()
303 drop_nlink(d_inode(fuse_control_sb->s_root)); in fuse_ctl_remove_conn()
343 fsc->ops = &fuse_ctl_context_ops; in fuse_ctl_init_fs_context()
354 fc->ctl_ndents = 0; in fuse_ctl_kill_sb()