Lines Matching refs:fsc

46 	struct ceph_fs_client *fsc = ceph_sb_to_client(s);  in ceph_put_super()  local
49 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
54 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
55 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
60 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
61 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
85 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
86 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
119 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
123 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
129 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
130 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
615 struct ceph_fs_client *fsc) in compare_mount_options() argument
618 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
646 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
656 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
657 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
665 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
749 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
754 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
757 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
772 struct ceph_fs_client *fsc; in create_fs_client() local
775 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
776 if (!fsc) { in create_fs_client()
781 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
782 if (IS_ERR(fsc->client)) { in create_fs_client()
783 err = PTR_ERR(fsc->client); in create_fs_client()
788 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
789 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
792 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
795 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
799 fsc->mount_options = fsopt; in create_fs_client()
801 fsc->sb = NULL; in create_fs_client()
802 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
803 fsc->filp_gen = 1; in create_fs_client()
804 fsc->have_copy_from2 = true; in create_fs_client()
806 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
807 fsc->write_congested = false; in create_fs_client()
814 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
815 if (!fsc->inode_wq) in create_fs_client()
817 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
818 if (!fsc->cap_wq) in create_fs_client()
821 hash_init(fsc->async_unlink_conflict); in create_fs_client()
822 spin_lock_init(&fsc->async_unlink_conflict_lock); in create_fs_client()
825 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
828 return fsc; in create_fs_client()
831 destroy_workqueue(fsc->inode_wq); in create_fs_client()
833 ceph_destroy_client(fsc->client); in create_fs_client()
835 kfree(fsc); in create_fs_client()
842 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
844 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
845 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
848 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
850 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
853 list_del(&fsc->metric_wakeup); in destroy_fs_client()
856 ceph_mdsc_destroy(fsc); in destroy_fs_client()
857 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
858 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
860 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
862 ceph_destroy_client(fsc->client); in destroy_fs_client()
864 kfree(fsc); in destroy_fs_client()
865 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
971 static void __ceph_umount_begin(struct ceph_fs_client *fsc) in __ceph_umount_begin() argument
973 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in __ceph_umount_begin()
974 ceph_mdsc_force_umount(fsc->mdsc); in __ceph_umount_begin()
975 fsc->filp_gen++; // invalidate open files in __ceph_umount_begin()
984 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
987 if (!fsc) in ceph_umount_begin()
989 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
990 __ceph_umount_begin(fsc); in ceph_umount_begin()
1010 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
1014 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
1033 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
1058 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
1065 dout("mount start %p\n", fsc); in ceph_real_mount()
1066 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
1068 if (!fsc->sb->s_root) { in ceph_real_mount()
1069 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
1070 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
1072 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
1077 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
1078 err = ceph_fscache_register_fs(fsc, fc); in ceph_real_mount()
1085 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
1087 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
1092 fsc->sb->s_root = dget(root); in ceph_real_mount()
1094 root = dget(fsc->sb->s_root); in ceph_real_mount()
1097 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
1099 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1103 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1109 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super() local
1117 fsc->sb = s; in ceph_set_super()
1118 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
1131 fsc->sb = NULL; in ceph_set_super()
1143 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_compare_super() local
1147 if (compare_mount_options(fsopt, opt, fsc)) { in ceph_compare_super()
1152 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1161 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1166 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1179 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1189 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1192 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1202 struct ceph_fs_client *fsc; in ceph_get_tree() local
1216 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1219 if (IS_ERR(fsc)) { in ceph_get_tree()
1220 err = PTR_ERR(fsc); in ceph_get_tree()
1224 err = ceph_mdsc_init(fsc); in ceph_get_tree()
1228 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1231 fc->s_fs_info = fsc; in ceph_get_tree()
1239 if (ceph_sb_to_client(sb) != fsc) { in ceph_get_tree()
1240 destroy_fs_client(fsc); in ceph_get_tree()
1241 fsc = ceph_sb_to_client(sb); in ceph_get_tree()
1242 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1244 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1245 err = ceph_setup_bdi(sb, fsc); in ceph_get_tree()
1250 res = ceph_real_mount(fsc, fc); in ceph_get_tree()
1257 fc->root = fsc->sb->s_root; in ceph_get_tree()
1261 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1266 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1271 destroy_fs_client(fsc); in ceph_get_tree()
1292 struct ceph_fs_client *fsc = ceph_sb_to_client(fc->root->d_sb); in ceph_reconfigure_fc() local
1295 ceph_set_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1297 ceph_clear_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1299 if (strcmp_null(fsc->mount_options->mon_addr, fsopt->mon_addr)) { in ceph_reconfigure_fc()
1300 kfree(fsc->mount_options->mon_addr); in ceph_reconfigure_fc()
1301 fsc->mount_options->mon_addr = fsopt->mon_addr; in ceph_reconfigure_fc()
1370 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1374 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1375 flush_fs_workqueues(fsc); in ceph_kill_sb()
1379 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1380 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1382 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1384 destroy_fs_client(fsc); in ceph_kill_sb()
1398 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_force_reconnect() local
1401 fsc->mount_state = CEPH_MOUNT_RECOVER; in ceph_force_reconnect()
1402 __ceph_umount_begin(fsc); in ceph_force_reconnect()
1406 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1410 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1412 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1414 fsc->blocklisted = false; in ceph_force_reconnect()
1415 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1454 struct ceph_fs_client *fsc; in param_set_metrics() local
1465 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) { in param_set_metrics()
1466 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()