Lines Matching refs:fsc
47 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s); in ceph_put_super() local
49 doutc(fsc->client, "begin\n"); in ceph_put_super()
50 ceph_fscrypt_free_dummy_policy(fsc); in ceph_put_super()
51 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
52 doutc(fsc->client, "done\n"); in ceph_put_super()
57 struct ceph_fs_client *fsc = ceph_inode_to_fs_client(d_inode(dentry)); in ceph_statfs() local
58 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
63 doutc(fsc->client, "begin\n"); in ceph_statfs()
64 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
65 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
88 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
89 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
117 doutc(fsc->client, "done\n"); in ceph_statfs()
123 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); in ceph_sync_fs() local
124 struct ceph_client *cl = fsc->client; in ceph_sync_fs()
128 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
129 ceph_flush_cap_releases(fsc->mdsc); in ceph_sync_fs()
135 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
136 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
660 struct ceph_fs_client *fsc) in compare_mount_options() argument
663 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
691 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
701 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(root->d_sb); in ceph_show_options() local
702 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
710 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
797 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
802 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
805 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
820 struct ceph_fs_client *fsc; in create_fs_client() local
823 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
824 if (!fsc) { in create_fs_client()
829 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
830 if (IS_ERR(fsc->client)) { in create_fs_client()
831 err = PTR_ERR(fsc->client); in create_fs_client()
836 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
837 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
840 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
843 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
847 fsc->mount_options = fsopt; in create_fs_client()
849 fsc->sb = NULL; in create_fs_client()
850 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
851 fsc->filp_gen = 1; in create_fs_client()
852 fsc->have_copy_from2 = true; in create_fs_client()
854 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
855 fsc->write_congested = false; in create_fs_client()
862 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
863 if (!fsc->inode_wq) in create_fs_client()
865 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
866 if (!fsc->cap_wq) in create_fs_client()
869 hash_init(fsc->async_unlink_conflict); in create_fs_client()
870 spin_lock_init(&fsc->async_unlink_conflict_lock); in create_fs_client()
873 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
876 return fsc; in create_fs_client()
879 destroy_workqueue(fsc->inode_wq); in create_fs_client()
881 ceph_destroy_client(fsc->client); in create_fs_client()
883 kfree(fsc); in create_fs_client()
890 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
892 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
893 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
896 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
898 doutc(fsc->client, "%p\n", fsc); in destroy_fs_client()
901 list_del(&fsc->metric_wakeup); in destroy_fs_client()
904 ceph_mdsc_destroy(fsc); in destroy_fs_client()
905 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
906 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
908 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
910 ceph_destroy_client(fsc->client); in destroy_fs_client()
912 kfree(fsc); in destroy_fs_client()
913 dout("%s: %p done\n", __func__, fsc); in destroy_fs_client()
1020 static void __ceph_umount_begin(struct ceph_fs_client *fsc) in __ceph_umount_begin() argument
1022 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in __ceph_umount_begin()
1023 ceph_mdsc_force_umount(fsc->mdsc); in __ceph_umount_begin()
1024 fsc->filp_gen++; // invalidate open files in __ceph_umount_begin()
1033 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); in ceph_umount_begin() local
1035 doutc(fsc->client, "starting forced umount\n"); in ceph_umount_begin()
1037 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
1038 __ceph_umount_begin(fsc); in ceph_umount_begin()
1058 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
1062 struct ceph_client *cl = fsc->client; in open_root_dentry()
1063 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
1082 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
1109 struct ceph_fs_client *fsc = sb->s_fs_info; in ceph_apply_test_dummy_encryption() local
1116 !fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) { in ceph_apply_test_dummy_encryption()
1118 &fsc->fsc_dummy_enc_policy)) in ceph_apply_test_dummy_encryption()
1125 if (fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) { in ceph_apply_test_dummy_encryption()
1127 &fsc->fsc_dummy_enc_policy)) in ceph_apply_test_dummy_encryption()
1133 fsc->fsc_dummy_enc_policy = fsopt->dummy_enc_policy; in ceph_apply_test_dummy_encryption()
1151 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
1154 struct ceph_client *cl = fsc->client; in ceph_real_mount()
1159 doutc(cl, "mount start %p\n", fsc); in ceph_real_mount()
1160 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
1162 if (!fsc->sb->s_root) { in ceph_real_mount()
1163 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
1164 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
1166 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
1171 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
1172 err = ceph_fscache_register_fs(fsc, fc); in ceph_real_mount()
1177 err = ceph_apply_test_dummy_encryption(fsc->sb, fc, in ceph_real_mount()
1178 fsc->mount_options); in ceph_real_mount()
1184 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
1186 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
1191 fsc->sb->s_root = dget(root); in ceph_real_mount()
1193 root = dget(fsc->sb->s_root); in ceph_real_mount()
1196 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
1198 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1202 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1203 ceph_fscrypt_free_dummy_policy(fsc); in ceph_real_mount()
1209 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super() local
1210 struct ceph_client *cl = fsc->client; in ceph_set_super()
1218 fsc->sb = s; in ceph_set_super()
1219 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
1235 fsc->sb = NULL; in ceph_set_super()
1247 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); in ceph_compare_super() local
1248 struct ceph_client *cl = fsc->client; in ceph_compare_super()
1252 if (compare_mount_options(fsopt, opt, fsc)) { in ceph_compare_super()
1257 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1266 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1271 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1284 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1294 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1297 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1307 struct ceph_fs_client *fsc; in ceph_get_tree() local
1321 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1324 if (IS_ERR(fsc)) { in ceph_get_tree()
1325 err = PTR_ERR(fsc); in ceph_get_tree()
1329 err = ceph_mdsc_init(fsc); in ceph_get_tree()
1333 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1336 fc->s_fs_info = fsc; in ceph_get_tree()
1344 if (ceph_sb_to_fs_client(sb) != fsc) { in ceph_get_tree()
1345 destroy_fs_client(fsc); in ceph_get_tree()
1346 fsc = ceph_sb_to_fs_client(sb); in ceph_get_tree()
1347 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1349 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1350 err = ceph_setup_bdi(sb, fsc); in ceph_get_tree()
1355 res = ceph_real_mount(fsc, fc); in ceph_get_tree()
1361 doutc(fsc->client, "root %p inode %p ino %llx.%llx\n", res, in ceph_get_tree()
1363 fc->root = fsc->sb->s_root; in ceph_get_tree()
1367 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1372 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1377 destroy_fs_client(fsc); in ceph_get_tree()
1400 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); in ceph_reconfigure_fc() local
1407 ceph_set_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1409 ceph_clear_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1412 ceph_set_mount_opt(fsc, SPARSEREAD); in ceph_reconfigure_fc()
1414 ceph_clear_mount_opt(fsc, SPARSEREAD); in ceph_reconfigure_fc()
1416 if (strcmp_null(fsc->mount_options->mon_addr, fsopt->mon_addr)) { in ceph_reconfigure_fc()
1417 kfree(fsc->mount_options->mon_addr); in ceph_reconfigure_fc()
1418 fsc->mount_options->mon_addr = fsopt->mon_addr; in ceph_reconfigure_fc()
1420 pr_notice_client(fsc->client, in ceph_reconfigure_fc()
1540 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s); in ceph_kill_sb() local
1541 struct ceph_client *cl = fsc->client; in ceph_kill_sb()
1542 struct ceph_mds_client *mdsc = fsc->mdsc; in ceph_kill_sb()
1548 flush_fs_workqueues(fsc); in ceph_kill_sb()
1570 fsc->client->options->mount_timeout); in ceph_kill_sb()
1585 fsc->client->options->mount_timeout); in ceph_kill_sb()
1595 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1596 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1598 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1600 destroy_fs_client(fsc); in ceph_kill_sb()
1614 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb); in ceph_force_reconnect() local
1617 fsc->mount_state = CEPH_MOUNT_RECOVER; in ceph_force_reconnect()
1618 __ceph_umount_begin(fsc); in ceph_force_reconnect()
1622 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1626 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1628 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1630 fsc->blocklisted = false; in ceph_force_reconnect()
1631 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1670 struct ceph_fs_client *fsc; in param_set_metrics() local
1681 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) { in param_set_metrics()
1682 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()