Lines Matching refs:fc

141 static void fuse_cleanup_submount_lookup(struct fuse_conn *fc,  in fuse_cleanup_submount_lookup()  argument
147 fuse_queue_forget(fc, sl->forget, sl->nodeid, 1); in fuse_cleanup_submount_lookup()
162 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_evict_inode() local
167 fuse_queue_forget(fc, fi->forget, fi->nodeid, in fuse_evict_inode()
173 fuse_cleanup_submount_lookup(fc, fi->submount_lookup); in fuse_evict_inode()
211 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_change_attributes_common() local
216 fi->attr_version = atomic64_inc_return(&fc->attr_version); in fuse_change_attributes_common()
224 inode->i_uid = make_kuid(fc->user_ns, attr->uid); in fuse_change_attributes_common()
225 inode->i_gid = make_kgid(fc->user_ns, attr->gid); in fuse_change_attributes_common()
272 if (!fc->default_permissions) in fuse_change_attributes_common()
290 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_get_cache_mask() local
292 if (!fc->writeback_cache || !S_ISREG(inode->i_mode)) in fuse_get_cache_mask()
302 struct fuse_conn *fc = get_fuse_conn(inode); in fuse_change_attributes() local
351 if (!fc->explicit_inval_data) in fuse_change_attributes()
353 } else if (fc->auto_inval_data) { in fuse_change_attributes()
383 struct fuse_conn *fc) in fuse_init_inode() argument
407 if (!fc->posix_acl) in fuse_init_inode()
433 struct fuse_conn *fc = get_fuse_conn_super(sb); in fuse_iget() local
442 if (fc->auto_submounts && (attr->flags & FUSE_ATTR_SUBMOUNT) && in fuse_iget()
450 fuse_init_inode(inode, attr, fc); in fuse_iget()
471 if (!fc->writeback_cache || !S_ISREG(attr->mode)) in fuse_iget()
474 fuse_init_inode(inode, attr, fc); in fuse_iget()
495 struct inode *fuse_ilookup(struct fuse_conn *fc, u64 nodeid, in fuse_ilookup() argument
501 WARN_ON(!rwsem_is_locked(&fc->killsb)); in fuse_ilookup()
502 list_for_each_entry(fm_iter, &fc->mounts, fc_entry) { in fuse_ilookup()
517 int fuse_reverse_inval_inode(struct fuse_conn *fc, u64 nodeid, in fuse_reverse_inval_inode() argument
525 inode = fuse_ilookup(fc, nodeid, NULL); in fuse_reverse_inval_inode()
531 fi->attr_version = atomic64_inc_return(&fc->attr_version); in fuse_reverse_inval_inode()
569 struct fuse_conn *fc = get_fuse_conn_super(sb); in fuse_umount_begin() local
571 if (fc->no_force_umount) in fuse_umount_begin()
574 fuse_abort_conn(fc); in fuse_umount_begin()
583 if (fm->fc->conn_init) { in fuse_send_destroy()
615 if (!fuse_allow_current_process(fm->fc)) { in fuse_statfs()
646 static void fuse_sync_fs_writes(struct fuse_conn *fc) in fuse_sync_fs_writes() argument
652 spin_lock(&fc->lock); in fuse_sync_fs_writes()
653 bucket = rcu_dereference_protected(fc->curr_bucket, 1); in fuse_sync_fs_writes()
658 spin_unlock(&fc->lock); in fuse_sync_fs_writes()
668 rcu_assign_pointer(fc->curr_bucket, new_bucket); in fuse_sync_fs_writes()
669 spin_unlock(&fc->lock); in fuse_sync_fs_writes()
687 struct fuse_conn *fc = fm->fc; in fuse_sync_fs() local
703 if (!fc->sync_fs) in fuse_sync_fs()
706 fuse_sync_fs_writes(fc); in fuse_sync_fs()
718 fc->sync_fs = 0; in fuse_sync_fs()
865 struct fuse_conn *fc = get_fuse_conn_super(sb); in fuse_show_options() local
867 if (fc->legacy_opts_show) { in fuse_show_options()
869 from_kuid_munged(fc->user_ns, fc->user_id)); in fuse_show_options()
871 from_kgid_munged(fc->user_ns, fc->group_id)); in fuse_show_options()
872 if (fc->default_permissions) in fuse_show_options()
874 if (fc->allow_other) in fuse_show_options()
876 if (fc->max_read != ~0) in fuse_show_options()
877 seq_printf(m, ",max_read=%u", fc->max_read); in fuse_show_options()
882 if (fc->dax_mode == FUSE_DAX_ALWAYS) in fuse_show_options()
884 else if (fc->dax_mode == FUSE_DAX_NEVER) in fuse_show_options()
886 else if (fc->dax_mode == FUSE_DAX_INODE_USER) in fuse_show_options()
919 void fuse_conn_init(struct fuse_conn *fc, struct fuse_mount *fm, in fuse_conn_init() argument
923 memset(fc, 0, sizeof(*fc)); in fuse_conn_init()
924 spin_lock_init(&fc->lock); in fuse_conn_init()
925 spin_lock_init(&fc->bg_lock); in fuse_conn_init()
926 init_rwsem(&fc->killsb); in fuse_conn_init()
927 refcount_set(&fc->count, 1); in fuse_conn_init()
928 atomic_set(&fc->dev_count, 1); in fuse_conn_init()
929 init_waitqueue_head(&fc->blocked_waitq); in fuse_conn_init()
930 fuse_iqueue_init(&fc->iq, fiq_ops, fiq_priv); in fuse_conn_init()
931 INIT_LIST_HEAD(&fc->bg_queue); in fuse_conn_init()
932 INIT_LIST_HEAD(&fc->entry); in fuse_conn_init()
933 INIT_LIST_HEAD(&fc->devices); in fuse_conn_init()
934 atomic_set(&fc->num_waiting, 0); in fuse_conn_init()
935 fc->max_background = FUSE_DEFAULT_MAX_BACKGROUND; in fuse_conn_init()
936 fc->congestion_threshold = FUSE_DEFAULT_CONGESTION_THRESHOLD; in fuse_conn_init()
937 atomic64_set(&fc->khctr, 0); in fuse_conn_init()
938 fc->polled_files = RB_ROOT; in fuse_conn_init()
939 fc->blocked = 0; in fuse_conn_init()
940 fc->initialized = 0; in fuse_conn_init()
941 fc->connected = 1; in fuse_conn_init()
942 atomic64_set(&fc->attr_version, 1); in fuse_conn_init()
943 get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key)); in fuse_conn_init()
944 fc->pid_ns = get_pid_ns(task_active_pid_ns(current)); in fuse_conn_init()
945 fc->user_ns = get_user_ns(user_ns); in fuse_conn_init()
946 fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ; in fuse_conn_init()
947 fc->max_pages_limit = FUSE_MAX_MAX_PAGES; in fuse_conn_init()
950 fuse_backing_files_init(fc); in fuse_conn_init()
952 INIT_LIST_HEAD(&fc->mounts); in fuse_conn_init()
953 list_add(&fm->fc_entry, &fc->mounts); in fuse_conn_init()
954 fm->fc = fc; in fuse_conn_init()
960 struct fuse_conn *fc = container_of(p, struct fuse_conn, rcu); in delayed_release() local
962 put_user_ns(fc->user_ns); in delayed_release()
963 fc->release(fc); in delayed_release()
966 void fuse_conn_put(struct fuse_conn *fc) in fuse_conn_put() argument
968 if (refcount_dec_and_test(&fc->count)) { in fuse_conn_put()
969 struct fuse_iqueue *fiq = &fc->iq; in fuse_conn_put()
973 fuse_dax_conn_free(fc); in fuse_conn_put()
976 put_pid_ns(fc->pid_ns); in fuse_conn_put()
977 bucket = rcu_dereference_protected(fc->curr_bucket, 1); in fuse_conn_put()
983 fuse_backing_files_free(fc); in fuse_conn_put()
984 call_rcu(&fc->rcu, delayed_release); in fuse_conn_put()
989 struct fuse_conn *fuse_conn_get(struct fuse_conn *fc) in fuse_conn_get() argument
991 refcount_inc(&fc->count); in fuse_conn_get()
992 return fc; in fuse_conn_get()
1015 struct fuse_conn *fc = get_fuse_conn_super(sb); in fuse_get_dentry() local
1028 if (!fc->export_support) in fuse_get_dentry()
1123 struct fuse_conn *fc = get_fuse_conn(child_inode); in fuse_get_parent() local
1129 if (!fc->export_support) in fuse_get_parent()
1197 static void process_init_limits(struct fuse_conn *fc, struct fuse_init_out *arg) in process_init_limits() argument
1207 spin_lock(&fc->bg_lock); in process_init_limits()
1209 fc->max_background = arg->max_background; in process_init_limits()
1211 if (!cap_sys_admin && fc->max_background > max_user_bgreq) in process_init_limits()
1212 fc->max_background = max_user_bgreq; in process_init_limits()
1215 fc->congestion_threshold = arg->congestion_threshold; in process_init_limits()
1218 fc->congestion_threshold > max_user_congthresh) in process_init_limits()
1219 fc->congestion_threshold = max_user_congthresh; in process_init_limits()
1221 spin_unlock(&fc->bg_lock); in process_init_limits()
1233 struct fuse_conn *fc = fm->fc; in process_init_reply() local
1243 process_init_limits(fc, arg); in process_init_reply()
1253 fc->async_read = 1; in process_init_reply()
1255 fc->no_lock = 1; in process_init_reply()
1258 fc->no_flock = 1; in process_init_reply()
1261 fc->no_flock = 1; in process_init_reply()
1264 fc->atomic_o_trunc = 1; in process_init_reply()
1268 fc->export_support = 1; in process_init_reply()
1271 fc->big_writes = 1; in process_init_reply()
1273 fc->dont_mask = 1; in process_init_reply()
1275 fc->auto_inval_data = 1; in process_init_reply()
1277 fc->explicit_inval_data = 1; in process_init_reply()
1279 fc->do_readdirplus = 1; in process_init_reply()
1281 fc->readdirplus_auto = 1; in process_init_reply()
1284 fc->async_dio = 1; in process_init_reply()
1286 fc->writeback_cache = 1; in process_init_reply()
1288 fc->parallel_dirops = 1; in process_init_reply()
1290 fc->handle_killpriv = 1; in process_init_reply()
1294 fc->default_permissions = 1; in process_init_reply()
1295 fc->posix_acl = 1; in process_init_reply()
1298 fc->cache_symlinks = 1; in process_init_reply()
1300 fc->abort_err = 1; in process_init_reply()
1302 fc->max_pages = in process_init_reply()
1303 min_t(unsigned int, fc->max_pages_limit, in process_init_reply()
1308 !fuse_dax_check_alignment(fc, arg->map_alignment)) { in process_init_reply()
1312 fc->inode_dax = 1; in process_init_reply()
1315 fc->handle_killpriv_v2 = 1; in process_init_reply()
1319 fc->setxattr_ext = 1; in process_init_reply()
1321 fc->init_security = 1; in process_init_reply()
1323 fc->create_supp_group = 1; in process_init_reply()
1325 fc->direct_io_allow_mmap = 1; in process_init_reply()
1345 fc->passthrough = 1; in process_init_reply()
1346 fc->max_stack_depth = arg->max_stack_depth; in process_init_reply()
1352 if (fc->default_permissions) in process_init_reply()
1358 ra_pages = fc->max_read / PAGE_SIZE; in process_init_reply()
1359 fc->no_lock = 1; in process_init_reply()
1360 fc->no_flock = 1; in process_init_reply()
1365 fc->minor = arg->minor; in process_init_reply()
1366 fc->max_write = arg->minor < 5 ? 4096 : arg->max_write; in process_init_reply()
1367 fc->max_write = max_t(unsigned, 4096, fc->max_write); in process_init_reply()
1368 fc->conn_init = 1; in process_init_reply()
1373 fc->conn_init = 0; in process_init_reply()
1374 fc->conn_error = 1; in process_init_reply()
1377 fuse_set_initialized(fc); in process_init_reply()
1378 wake_up_all(&fc->blocked_waitq); in process_init_reply()
1406 if (fm->fc->dax) in fuse_send_init()
1408 if (fuse_is_inode_dax_mode(fm->fc->dax_mode)) in fuse_send_init()
1411 if (fm->fc->auto_submounts) in fuse_send_init()
1439 void fuse_free_conn(struct fuse_conn *fc) in fuse_free_conn() argument
1441 WARN_ON(!list_empty(&fc->devices)); in fuse_free_conn()
1442 kfree(fc); in fuse_free_conn()
1446 static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb) in fuse_bdi_init() argument
1460 err = super_setup_bdi_name(sb, "%u:%u%s", MAJOR(fc->dev), in fuse_bdi_init()
1461 MINOR(fc->dev), suffix); in fuse_bdi_init()
1508 void fuse_dev_install(struct fuse_dev *fud, struct fuse_conn *fc) in fuse_dev_install() argument
1510 fud->fc = fuse_conn_get(fc); in fuse_dev_install()
1511 spin_lock(&fc->lock); in fuse_dev_install()
1512 list_add_tail(&fud->entry, &fc->devices); in fuse_dev_install()
1513 spin_unlock(&fc->lock); in fuse_dev_install()
1517 struct fuse_dev *fuse_dev_alloc_install(struct fuse_conn *fc) in fuse_dev_alloc_install() argument
1525 fuse_dev_install(fud, fc); in fuse_dev_alloc_install()
1532 struct fuse_conn *fc = fud->fc; in fuse_dev_free() local
1534 if (fc) { in fuse_dev_free()
1535 spin_lock(&fc->lock); in fuse_dev_free()
1537 spin_unlock(&fc->lock); in fuse_dev_free()
1539 fuse_conn_put(fc); in fuse_dev_free()
1648 struct fuse_conn *fc = get_fuse_conn(&mp_fi->inode); in fuse_get_tree_submount() local
1656 fm->fc = fuse_conn_get(fc); in fuse_get_tree_submount()
1671 down_write(&fc->killsb); in fuse_get_tree_submount()
1672 list_add_tail(&fm->fc_entry, &fc->mounts); in fuse_get_tree_submount()
1673 up_write(&fc->killsb); in fuse_get_tree_submount()
1696 struct fuse_conn *fc = fm->fc; in fuse_fill_super_common() local
1705 rcu_assign_pointer(fc->curr_bucket, fuse_sync_bucket_alloc()); in fuse_fill_super_common()
1722 err = fuse_dax_conn_alloc(fc, ctx->dax_mode, ctx->dax_dev); in fuse_fill_super_common()
1729 fud = fuse_dev_alloc_install(fc); in fuse_fill_super_common()
1734 fc->dev = sb->s_dev; in fuse_fill_super_common()
1736 err = fuse_bdi_init(fc, sb); in fuse_fill_super_common()
1742 fc->dont_mask = 1; in fuse_fill_super_common()
1745 fc->default_permissions = ctx->default_permissions; in fuse_fill_super_common()
1746 fc->allow_other = ctx->allow_other; in fuse_fill_super_common()
1747 fc->user_id = ctx->user_id; in fuse_fill_super_common()
1748 fc->group_id = ctx->group_id; in fuse_fill_super_common()
1749 fc->legacy_opts_show = ctx->legacy_opts_show; in fuse_fill_super_common()
1750 fc->max_read = max_t(unsigned int, 4096, ctx->max_read); in fuse_fill_super_common()
1751 fc->destroy = ctx->destroy; in fuse_fill_super_common()
1752 fc->no_control = ctx->no_control; in fuse_fill_super_common()
1753 fc->no_force_umount = ctx->no_force_umount; in fuse_fill_super_common()
1769 err = fuse_ctl_add_conn(fc); in fuse_fill_super_common()
1773 list_add_tail(&fc->entry, &fuse_conn_list); in fuse_fill_super_common()
1788 fuse_dax_conn_free(fc); in fuse_fill_super_common()
1840 struct fuse_conn *fc; in fuse_get_tree() local
1845 fc = kmalloc(sizeof(*fc), GFP_KERNEL); in fuse_get_tree()
1846 if (!fc) in fuse_get_tree()
1851 kfree(fc); in fuse_get_tree()
1855 fuse_conn_init(fc, fm, fsc->user_ns, &fuse_dev_fiq_ops, NULL); in fuse_get_tree()
1856 fc->release = fuse_free_conn; in fuse_get_tree()
1881 fsc->sget_key = fud->fc; in fuse_get_tree()
1933 struct fuse_conn *fc = fm->fc; in fuse_mount_remove() local
1936 down_write(&fc->killsb); in fuse_mount_remove()
1938 if (list_empty(&fc->mounts)) in fuse_mount_remove()
1940 up_write(&fc->killsb); in fuse_mount_remove()
1948 struct fuse_conn *fc = fm->fc; in fuse_conn_destroy() local
1950 if (fc->destroy) in fuse_conn_destroy()
1953 fuse_abort_conn(fc); in fuse_conn_destroy()
1954 fuse_wait_aborted(fc); in fuse_conn_destroy()
1956 if (!list_empty(&fc->entry)) { in fuse_conn_destroy()
1958 list_del(&fc->entry); in fuse_conn_destroy()
1959 fuse_ctl_remove_conn(fc); in fuse_conn_destroy()
1979 fuse_conn_put(fm->fc); in fuse_mount_destroy()