Lines Matching refs:fsc

39 	struct ceph_fs_client *fsc = ceph_sb_to_client(s);  in ceph_put_super()  local
42 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
47 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
48 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
54 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
55 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()
111 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
115 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
121 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
122 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
395 struct ceph_fs_client *fsc) in compare_mount_options() argument
398 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
419 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
514 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
515 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
523 ret = ceph_print_client_options(m, fsc->client); in ceph_show_options()
588 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
593 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
596 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
611 struct ceph_fs_client *fsc; in create_fs_client() local
616 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
617 if (!fsc) { in create_fs_client()
622 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
623 if (IS_ERR(fsc->client)) { in create_fs_client()
624 err = PTR_ERR(fsc->client); in create_fs_client()
629 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
630 fsc->client->osdc.abort_on_full = true; in create_fs_client()
633 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
636 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
640 fsc->mount_options = fsopt; in create_fs_client()
642 fsc->sb = NULL; in create_fs_client()
643 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
645 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
652 fsc->wb_wq = alloc_workqueue("ceph-writeback", 0, 1); in create_fs_client()
653 if (!fsc->wb_wq) in create_fs_client()
655 fsc->pg_inv_wq = alloc_workqueue("ceph-pg-invalid", 0, 1); in create_fs_client()
656 if (!fsc->pg_inv_wq) in create_fs_client()
658 fsc->trunc_wq = alloc_workqueue("ceph-trunc", 0, 1); in create_fs_client()
659 if (!fsc->trunc_wq) in create_fs_client()
664 page_count = fsc->mount_options->wsize >> PAGE_SHIFT; in create_fs_client()
666 fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, size); in create_fs_client()
667 if (!fsc->wb_pagevec_pool) in create_fs_client()
671 fsc->min_caps = fsopt->max_readdir; in create_fs_client()
673 return fsc; in create_fs_client()
676 destroy_workqueue(fsc->trunc_wq); in create_fs_client()
678 destroy_workqueue(fsc->pg_inv_wq); in create_fs_client()
680 destroy_workqueue(fsc->wb_wq); in create_fs_client()
682 ceph_destroy_client(fsc->client); in create_fs_client()
684 kfree(fsc); in create_fs_client()
691 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
693 flush_workqueue(fsc->wb_wq); in flush_fs_workqueues()
694 flush_workqueue(fsc->pg_inv_wq); in flush_fs_workqueues()
695 flush_workqueue(fsc->trunc_wq); in flush_fs_workqueues()
698 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
700 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
702 destroy_workqueue(fsc->wb_wq); in destroy_fs_client()
703 destroy_workqueue(fsc->pg_inv_wq); in destroy_fs_client()
704 destroy_workqueue(fsc->trunc_wq); in destroy_fs_client()
706 mempool_destroy(fsc->wb_pagevec_pool); in destroy_fs_client()
708 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
710 ceph_destroy_client(fsc->client); in destroy_fs_client()
712 kfree(fsc); in destroy_fs_client()
713 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
811 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
814 if (!fsc) in ceph_umount_begin()
816 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
817 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in ceph_umount_begin()
818 ceph_mdsc_force_umount(fsc->mdsc); in ceph_umount_begin()
838 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
842 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
861 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
889 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc) in ceph_real_mount() argument
895 dout("mount start %p\n", fsc); in ceph_real_mount()
896 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
898 if (!fsc->sb->s_root) { in ceph_real_mount()
900 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
905 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
906 err = ceph_fscache_register_fs(fsc); in ceph_real_mount()
911 if (!fsc->mount_options->server_path) { in ceph_real_mount()
915 path = fsc->mount_options->server_path + 1; in ceph_real_mount()
919 err = ceph_fs_debugfs_init(fsc); in ceph_real_mount()
923 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
928 fsc->sb->s_root = dget(root); in ceph_real_mount()
930 root = dget(fsc->sb->s_root); in ceph_real_mount()
933 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
935 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
939 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
945 struct ceph_fs_client *fsc = data; in ceph_set_super() local
950 s->s_flags = fsc->mount_options->sb_flags; in ceph_set_super()
954 s->s_fs_info = fsc; in ceph_set_super()
955 fsc->sb = s; in ceph_set_super()
956 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
972 fsc->sb = NULL; in ceph_set_super()
1009 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1019 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1022 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1031 struct ceph_fs_client *fsc; in ceph_mount() local
1050 fsc = create_fs_client(fsopt, opt); in ceph_mount()
1051 if (IS_ERR(fsc)) { in ceph_mount()
1052 res = ERR_CAST(fsc); in ceph_mount()
1056 err = ceph_mdsc_init(fsc); in ceph_mount()
1062 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_mount()
1064 sb = sget(fs_type, compare_super, ceph_set_super, flags, fsc); in ceph_mount()
1070 if (ceph_sb_to_client(sb) != fsc) { in ceph_mount()
1071 ceph_mdsc_destroy(fsc); in ceph_mount()
1072 destroy_fs_client(fsc); in ceph_mount()
1073 fsc = ceph_sb_to_client(sb); in ceph_mount()
1074 dout("get_sb got existing client %p\n", fsc); in ceph_mount()
1076 dout("get_sb using new client %p\n", fsc); in ceph_mount()
1077 err = ceph_setup_bdi(sb, fsc); in ceph_mount()
1084 res = ceph_real_mount(fsc); in ceph_mount()
1092 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_mount()
1097 ceph_mdsc_destroy(fsc); in ceph_mount()
1098 destroy_fs_client(fsc); in ceph_mount()
1106 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1111 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1112 flush_fs_workqueues(fsc); in ceph_kill_sb()
1116 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1117 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1119 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1121 ceph_mdsc_destroy(fsc); in ceph_kill_sb()
1123 destroy_fs_client(fsc); in ceph_kill_sb()