Lines Matching refs:fc
25 struct fuse_conn *fc; in fuse_ctl_file_conn_get() local
27 fc = file_inode(file)->i_private; in fuse_ctl_file_conn_get()
28 if (fc) in fuse_ctl_file_conn_get()
29 fc = fuse_conn_get(fc); in fuse_ctl_file_conn_get()
31 return fc; in fuse_ctl_file_conn_get()
37 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); in fuse_conn_abort_write() local
38 if (fc) { in fuse_conn_abort_write()
39 if (fc->abort_err) in fuse_conn_abort_write()
40 fc->aborted = true; in fuse_conn_abort_write()
41 fuse_abort_conn(fc); in fuse_conn_abort_write()
42 fuse_conn_put(fc); in fuse_conn_abort_write()
55 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); in fuse_conn_waiting_read() local
56 if (!fc) in fuse_conn_waiting_read()
59 value = atomic_read(&fc->num_waiting); in fuse_conn_waiting_read()
61 fuse_conn_put(fc); in fuse_conn_waiting_read()
106 struct fuse_conn *fc; in fuse_conn_max_background_read() local
109 fc = fuse_ctl_file_conn_get(file); in fuse_conn_max_background_read()
110 if (!fc) in fuse_conn_max_background_read()
113 val = READ_ONCE(fc->max_background); in fuse_conn_max_background_read()
114 fuse_conn_put(fc); in fuse_conn_max_background_read()
129 struct fuse_conn *fc = fuse_ctl_file_conn_get(file); in fuse_conn_max_background_write() local
130 if (fc) { in fuse_conn_max_background_write()
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()
137 fuse_conn_put(fc); in fuse_conn_max_background_write()
148 struct fuse_conn *fc; in fuse_conn_congestion_threshold_read() local
151 fc = fuse_ctl_file_conn_get(file); in fuse_conn_congestion_threshold_read()
152 if (!fc) in fuse_conn_congestion_threshold_read()
155 val = READ_ONCE(fc->congestion_threshold); in fuse_conn_congestion_threshold_read()
156 fuse_conn_put(fc); in fuse_conn_congestion_threshold_read()
166 struct fuse_conn *fc; in fuse_conn_congestion_threshold_write() local
173 fc = fuse_ctl_file_conn_get(file); in fuse_conn_congestion_threshold_write()
174 if (!fc) in fuse_conn_congestion_threshold_write()
177 spin_lock(&fc->bg_lock); in fuse_conn_congestion_threshold_write()
178 fc->congestion_threshold = val; in fuse_conn_congestion_threshold_write()
179 if (fc->sb) { in fuse_conn_congestion_threshold_write()
180 if (fc->num_background < fc->congestion_threshold) { in fuse_conn_congestion_threshold_write()
181 clear_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC); in fuse_conn_congestion_threshold_write()
182 clear_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC); in fuse_conn_congestion_threshold_write()
184 set_bdi_congested(fc->sb->s_bdi, BLK_RW_SYNC); in fuse_conn_congestion_threshold_write()
185 set_bdi_congested(fc->sb->s_bdi, BLK_RW_ASYNC); in fuse_conn_congestion_threshold_write()
188 spin_unlock(&fc->bg_lock); in fuse_conn_congestion_threshold_write()
189 fuse_conn_put(fc); in fuse_conn_congestion_threshold_write()
221 struct fuse_conn *fc, in fuse_ctl_add_dentry() argument
230 BUG_ON(fc->ctl_ndents >= FUSE_CTL_NUM_DENTRIES); in fuse_ctl_add_dentry()
243 inode->i_uid = fc->user_id; in fuse_ctl_add_dentry()
244 inode->i_gid = fc->group_id; in fuse_ctl_add_dentry()
251 inode->i_private = fc; in fuse_ctl_add_dentry()
254 fc->ctl_dentry[fc->ctl_ndents++] = dentry; in fuse_ctl_add_dentry()
263 int fuse_ctl_add_conn(struct fuse_conn *fc) in fuse_ctl_add_conn() argument
273 sprintf(name, "%u", fc->dev); in fuse_ctl_add_conn()
274 parent = fuse_ctl_add_dentry(parent, fc, name, S_IFDIR | 0500, 2, in fuse_ctl_add_conn()
280 if (!fuse_ctl_add_dentry(parent, fc, "waiting", S_IFREG | 0400, 1, in fuse_ctl_add_conn()
282 !fuse_ctl_add_dentry(parent, fc, "abort", S_IFREG | 0200, 1, in fuse_ctl_add_conn()
284 !fuse_ctl_add_dentry(parent, fc, "max_background", S_IFREG | 0600, in fuse_ctl_add_conn()
286 !fuse_ctl_add_dentry(parent, fc, "congestion_threshold", in fuse_ctl_add_conn()
294 fuse_ctl_remove_conn(fc); in fuse_ctl_add_conn()
302 void fuse_ctl_remove_conn(struct fuse_conn *fc) in fuse_ctl_remove_conn() argument
309 for (i = fc->ctl_ndents - 1; i >= 0; i--) { in fuse_ctl_remove_conn()
310 struct dentry *dentry = fc->ctl_dentry[i]; in fuse_ctl_remove_conn()
324 struct fuse_conn *fc; in fuse_ctl_fill_super() local
334 list_for_each_entry(fc, &fuse_conn_list, entry) { in fuse_ctl_fill_super()
335 err = fuse_ctl_add_conn(fc); in fuse_ctl_fill_super()
347 static int fuse_ctl_get_tree(struct fs_context *fc) in fuse_ctl_get_tree() argument
349 return get_tree_single(fc, fuse_ctl_fill_super); in fuse_ctl_get_tree()
356 static int fuse_ctl_init_fs_context(struct fs_context *fc) in fuse_ctl_init_fs_context() argument
358 fc->ops = &fuse_ctl_context_ops; in fuse_ctl_init_fs_context()
364 struct fuse_conn *fc; in fuse_ctl_kill_sb() local
368 list_for_each_entry(fc, &fuse_conn_list, entry) in fuse_ctl_kill_sb()
369 fc->ctl_ndents = 0; in fuse_ctl_kill_sb()