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()
58 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
59 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
89 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
90 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
115 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
119 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
125 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
126 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
493 struct ceph_fs_client *fsc) in compare_mount_options() argument
496 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
520 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
530 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
531 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
539 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
616 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
621 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
624 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
639 struct ceph_fs_client *fsc; in create_fs_client() local
642 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
643 if (!fsc) { in create_fs_client()
648 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
649 if (IS_ERR(fsc->client)) { in create_fs_client()
650 err = PTR_ERR(fsc->client); in create_fs_client()
655 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
656 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
659 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
662 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
666 fsc->mount_options = fsopt; in create_fs_client()
668 fsc->sb = NULL; in create_fs_client()
669 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
670 fsc->filp_gen = 1; in create_fs_client()
671 fsc->have_copy_from2 = true; in create_fs_client()
673 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
680 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
681 if (!fsc->inode_wq) in create_fs_client()
683 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
684 if (!fsc->cap_wq) in create_fs_client()
688 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
691 return fsc; in create_fs_client()
694 destroy_workqueue(fsc->inode_wq); in create_fs_client()
696 ceph_destroy_client(fsc->client); in create_fs_client()
698 kfree(fsc); in create_fs_client()
705 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
707 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
708 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
711 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
713 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
716 list_del(&fsc->metric_wakeup); in destroy_fs_client()
719 ceph_mdsc_destroy(fsc); in destroy_fs_client()
720 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
721 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
723 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
725 ceph_destroy_client(fsc->client); in destroy_fs_client()
727 kfree(fsc); in destroy_fs_client()
728 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
841 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
844 if (!fsc) in ceph_umount_begin()
846 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
847 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in ceph_umount_begin()
848 ceph_mdsc_force_umount(fsc->mdsc); in ceph_umount_begin()
849 fsc->filp_gen++; // invalidate open files in ceph_umount_begin()
869 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
873 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
892 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
917 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
924 dout("mount start %p\n", fsc); in ceph_real_mount()
925 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
927 if (!fsc->sb->s_root) { in ceph_real_mount()
928 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
929 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
931 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
936 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
937 err = ceph_fscache_register_fs(fsc, fc); in ceph_real_mount()
944 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
946 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
951 fsc->sb->s_root = dget(root); in ceph_real_mount()
953 root = dget(fsc->sb->s_root); in ceph_real_mount()
956 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
958 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
962 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
968 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super() local
976 fsc->sb = s; in ceph_set_super()
977 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
989 fsc->sb = NULL; in ceph_set_super()
1001 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_compare_super() local
1005 if (compare_mount_options(fsopt, opt, fsc)) { in ceph_compare_super()
1010 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1019 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1024 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1037 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1047 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1050 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1059 struct ceph_fs_client *fsc; in ceph_get_tree() local
1071 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1074 if (IS_ERR(fsc)) { in ceph_get_tree()
1075 err = PTR_ERR(fsc); in ceph_get_tree()
1079 err = ceph_mdsc_init(fsc); in ceph_get_tree()
1083 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1086 fc->s_fs_info = fsc; in ceph_get_tree()
1094 if (ceph_sb_to_client(sb) != fsc) { in ceph_get_tree()
1095 destroy_fs_client(fsc); in ceph_get_tree()
1096 fsc = ceph_sb_to_client(sb); in ceph_get_tree()
1097 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1099 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1100 err = ceph_setup_bdi(sb, fsc); in ceph_get_tree()
1105 res = ceph_real_mount(fsc, fc); in ceph_get_tree()
1112 fc->root = fsc->sb->s_root; in ceph_get_tree()
1116 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1121 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1126 destroy_fs_client(fsc); in ceph_get_tree()
1147 struct ceph_fs_client *fsc = ceph_sb_to_client(fc->root->d_sb); in ceph_reconfigure_fc() local
1150 ceph_set_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1152 ceph_clear_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1218 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1222 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1223 flush_fs_workqueues(fsc); in ceph_kill_sb()
1227 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1228 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1230 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1232 destroy_fs_client(fsc); in ceph_kill_sb()
1246 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_force_reconnect() local
1253 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1257 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1259 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1261 fsc->blocklisted = false; in ceph_force_reconnect()
1262 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1301 struct ceph_fs_client *fsc; in param_set_metrics() local
1312 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) { in param_set_metrics()
1313 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()