Lines Matching refs:fsc
40 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_put_super() local
43 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
48 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
49 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
55 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
56 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
86 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
87 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
112 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
116 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
122 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
123 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
435 struct ceph_fs_client *fsc) in compare_mount_options() argument
438 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
459 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
554 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
555 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
563 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
637 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
642 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
645 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
660 struct ceph_fs_client *fsc; in create_fs_client() local
665 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
666 if (!fsc) { in create_fs_client()
671 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
672 if (IS_ERR(fsc->client)) { in create_fs_client()
673 err = PTR_ERR(fsc->client); in create_fs_client()
678 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
679 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
682 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
685 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
689 fsc->mount_options = fsopt; in create_fs_client()
691 fsc->sb = NULL; in create_fs_client()
692 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
693 fsc->filp_gen = 1; in create_fs_client()
695 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
702 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
703 if (!fsc->inode_wq) in create_fs_client()
705 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
706 if (!fsc->cap_wq) in create_fs_client()
711 page_count = fsc->mount_options->wsize >> PAGE_SHIFT; in create_fs_client()
713 fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, size); in create_fs_client()
714 if (!fsc->wb_pagevec_pool) in create_fs_client()
717 return fsc; in create_fs_client()
720 destroy_workqueue(fsc->cap_wq); in create_fs_client()
722 destroy_workqueue(fsc->inode_wq); in create_fs_client()
724 ceph_destroy_client(fsc->client); in create_fs_client()
726 kfree(fsc); in create_fs_client()
733 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
735 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
736 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
739 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
741 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
743 ceph_mdsc_destroy(fsc); in destroy_fs_client()
744 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
745 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
747 mempool_destroy(fsc->wb_pagevec_pool); in destroy_fs_client()
749 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
751 ceph_destroy_client(fsc->client); in destroy_fs_client()
753 kfree(fsc); in destroy_fs_client()
754 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
852 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
855 if (!fsc) in ceph_umount_begin()
857 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
858 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in ceph_umount_begin()
859 ceph_mdsc_force_umount(fsc->mdsc); in ceph_umount_begin()
860 fsc->filp_gen++; // invalidate open files in ceph_umount_begin()
887 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
891 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
910 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
938 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc) in ceph_real_mount() argument
944 dout("mount start %p\n", fsc); in ceph_real_mount()
945 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
947 if (!fsc->sb->s_root) { in ceph_real_mount()
949 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
954 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
955 err = ceph_fscache_register_fs(fsc); in ceph_real_mount()
960 if (!fsc->mount_options->server_path) { in ceph_real_mount()
964 path = fsc->mount_options->server_path + 1; in ceph_real_mount()
968 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
970 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
975 fsc->sb->s_root = dget(root); in ceph_real_mount()
977 root = dget(fsc->sb->s_root); in ceph_real_mount()
980 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
982 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
986 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
992 struct ceph_fs_client *fsc = data; in ceph_set_super() local
997 s->s_flags = fsc->mount_options->sb_flags; in ceph_set_super()
1001 s->s_fs_info = fsc; in ceph_set_super()
1002 fsc->sb = s; in ceph_set_super()
1003 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
1021 fsc->sb = NULL; in ceph_set_super()
1058 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1068 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1071 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1080 struct ceph_fs_client *fsc; in ceph_mount() local
1099 fsc = create_fs_client(fsopt, opt); in ceph_mount()
1100 if (IS_ERR(fsc)) { in ceph_mount()
1101 res = ERR_CAST(fsc); in ceph_mount()
1105 err = ceph_mdsc_init(fsc); in ceph_mount()
1111 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_mount()
1113 sb = sget(fs_type, compare_super, ceph_set_super, flags, fsc); in ceph_mount()
1119 if (ceph_sb_to_client(sb) != fsc) { in ceph_mount()
1120 destroy_fs_client(fsc); in ceph_mount()
1121 fsc = ceph_sb_to_client(sb); in ceph_mount()
1122 dout("get_sb got existing client %p\n", fsc); in ceph_mount()
1124 dout("get_sb using new client %p\n", fsc); in ceph_mount()
1125 err = ceph_setup_bdi(sb, fsc); in ceph_mount()
1132 res = ceph_real_mount(fsc); in ceph_mount()
1140 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_mount()
1145 destroy_fs_client(fsc); in ceph_mount()
1153 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1158 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1159 flush_fs_workqueues(fsc); in ceph_kill_sb()
1163 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1164 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1166 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1168 destroy_fs_client(fsc); in ceph_kill_sb()
1183 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_force_reconnect() local
1190 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1194 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1196 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1198 fsc->blacklisted = false; in ceph_force_reconnect()
1199 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()