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 down_read(&fc->killsb); in fuse_conn_congestion_threshold_write()
178 spin_lock(&fc->bg_lock); in fuse_conn_congestion_threshold_write()
179 fc->congestion_threshold = val; in fuse_conn_congestion_threshold_write()
180 spin_unlock(&fc->bg_lock); in fuse_conn_congestion_threshold_write()
181 up_read(&fc->killsb); in fuse_conn_congestion_threshold_write()
182 fuse_conn_put(fc); in fuse_conn_congestion_threshold_write()
214 struct fuse_conn *fc, in fuse_ctl_add_dentry() argument
223 BUG_ON(fc->ctl_ndents >= FUSE_CTL_NUM_DENTRIES); in fuse_ctl_add_dentry()
236 inode->i_uid = fc->user_id; in fuse_ctl_add_dentry()
237 inode->i_gid = fc->group_id; in fuse_ctl_add_dentry()
244 inode->i_private = fc; in fuse_ctl_add_dentry()
247 fc->ctl_dentry[fc->ctl_ndents++] = dentry; in fuse_ctl_add_dentry()
256 int fuse_ctl_add_conn(struct fuse_conn *fc) in fuse_ctl_add_conn() argument
261 if (!fuse_control_sb || fc->no_control) in fuse_ctl_add_conn()
266 sprintf(name, "%u", fc->dev); in fuse_ctl_add_conn()
267 parent = fuse_ctl_add_dentry(parent, fc, name, S_IFDIR | 0500, 2, in fuse_ctl_add_conn()
273 if (!fuse_ctl_add_dentry(parent, fc, "waiting", S_IFREG | 0400, 1, in fuse_ctl_add_conn()
275 !fuse_ctl_add_dentry(parent, fc, "abort", S_IFREG | 0200, 1, in fuse_ctl_add_conn()
277 !fuse_ctl_add_dentry(parent, fc, "max_background", S_IFREG | 0600, in fuse_ctl_add_conn()
279 !fuse_ctl_add_dentry(parent, fc, "congestion_threshold", in fuse_ctl_add_conn()
287 fuse_ctl_remove_conn(fc); in fuse_ctl_add_conn()
295 void fuse_ctl_remove_conn(struct fuse_conn *fc) in fuse_ctl_remove_conn() argument
299 if (!fuse_control_sb || fc->no_control) in fuse_ctl_remove_conn()
302 for (i = fc->ctl_ndents - 1; i >= 0; i--) { in fuse_ctl_remove_conn()
303 struct dentry *dentry = fc->ctl_dentry[i]; in fuse_ctl_remove_conn()
317 struct fuse_conn *fc; in fuse_ctl_fill_super() local
327 list_for_each_entry(fc, &fuse_conn_list, entry) { in fuse_ctl_fill_super()
328 err = fuse_ctl_add_conn(fc); in fuse_ctl_fill_super()
357 struct fuse_conn *fc; in fuse_ctl_kill_sb() local
361 list_for_each_entry(fc, &fuse_conn_list, entry) in fuse_ctl_kill_sb()
362 fc->ctl_ndents = 0; in fuse_ctl_kill_sb()