Lines Matching refs:fsc

44 	struct ceph_fs_client *fsc = ceph_sb_to_client(s);  in ceph_put_super()  local
47 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
52 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
53 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
59 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
60 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
90 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
91 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
114 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
118 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
124 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
125 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
492 struct ceph_fs_client *fsc) in compare_mount_options() argument
495 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
519 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
529 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
530 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
538 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
615 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
620 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
623 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
638 struct ceph_fs_client *fsc; in create_fs_client() local
641 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
642 if (!fsc) { in create_fs_client()
647 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
648 if (IS_ERR(fsc->client)) { in create_fs_client()
649 err = PTR_ERR(fsc->client); in create_fs_client()
654 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
655 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
658 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
661 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
665 fsc->mount_options = fsopt; in create_fs_client()
667 fsc->sb = NULL; in create_fs_client()
668 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
669 fsc->filp_gen = 1; in create_fs_client()
670 fsc->have_copy_from2 = true; in create_fs_client()
672 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
679 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
680 if (!fsc->inode_wq) in create_fs_client()
682 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
683 if (!fsc->cap_wq) in create_fs_client()
687 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
690 return fsc; in create_fs_client()
693 destroy_workqueue(fsc->inode_wq); in create_fs_client()
695 ceph_destroy_client(fsc->client); in create_fs_client()
697 kfree(fsc); in create_fs_client()
704 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
706 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
707 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
710 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
712 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
715 list_del(&fsc->metric_wakeup); in destroy_fs_client()
718 ceph_mdsc_destroy(fsc); in destroy_fs_client()
719 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
720 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
722 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
724 ceph_destroy_client(fsc->client); in destroy_fs_client()
726 kfree(fsc); in destroy_fs_client()
727 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
834 static void __ceph_umount_begin(struct ceph_fs_client *fsc) in __ceph_umount_begin() argument
836 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in __ceph_umount_begin()
837 ceph_mdsc_force_umount(fsc->mdsc); in __ceph_umount_begin()
838 fsc->filp_gen++; // invalidate open files in __ceph_umount_begin()
847 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
850 if (!fsc) in ceph_umount_begin()
852 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
853 __ceph_umount_begin(fsc); in ceph_umount_begin()
873 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
877 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
896 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
921 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
928 dout("mount start %p\n", fsc); in ceph_real_mount()
929 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
931 if (!fsc->sb->s_root) { in ceph_real_mount()
932 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
933 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
935 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
940 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
941 err = ceph_fscache_register_fs(fsc, fc); in ceph_real_mount()
948 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
950 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
955 fsc->sb->s_root = dget(root); in ceph_real_mount()
957 root = dget(fsc->sb->s_root); in ceph_real_mount()
960 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
962 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
966 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
972 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super() local
980 fsc->sb = s; in ceph_set_super()
981 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
993 fsc->sb = NULL; in ceph_set_super()
1005 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_compare_super() local
1009 if (compare_mount_options(fsopt, opt, fsc)) { in ceph_compare_super()
1014 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1023 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1028 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1041 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1051 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1054 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1063 struct ceph_fs_client *fsc; in ceph_get_tree() local
1075 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1078 if (IS_ERR(fsc)) { in ceph_get_tree()
1079 err = PTR_ERR(fsc); in ceph_get_tree()
1083 err = ceph_mdsc_init(fsc); in ceph_get_tree()
1087 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1090 fc->s_fs_info = fsc; in ceph_get_tree()
1098 if (ceph_sb_to_client(sb) != fsc) { in ceph_get_tree()
1099 destroy_fs_client(fsc); in ceph_get_tree()
1100 fsc = ceph_sb_to_client(sb); in ceph_get_tree()
1101 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1103 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1104 err = ceph_setup_bdi(sb, fsc); in ceph_get_tree()
1109 res = ceph_real_mount(fsc, fc); in ceph_get_tree()
1116 fc->root = fsc->sb->s_root; in ceph_get_tree()
1120 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1125 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1130 destroy_fs_client(fsc); in ceph_get_tree()
1151 struct ceph_fs_client *fsc = ceph_sb_to_client(fc->root->d_sb); in ceph_reconfigure_fc() local
1154 ceph_set_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1156 ceph_clear_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1222 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1226 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1227 flush_fs_workqueues(fsc); in ceph_kill_sb()
1231 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1232 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1234 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1236 destroy_fs_client(fsc); in ceph_kill_sb()
1250 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_force_reconnect() local
1253 fsc->mount_state = CEPH_MOUNT_RECOVER; in ceph_force_reconnect()
1254 __ceph_umount_begin(fsc); in ceph_force_reconnect()
1258 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1262 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1264 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1266 fsc->blocklisted = false; in ceph_force_reconnect()
1267 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1306 struct ceph_fs_client *fsc; in param_set_metrics() local
1317 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) { in param_set_metrics()
1318 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()