Lines Matching refs:fsc
47 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_put_super() local
50 ceph_fscrypt_free_dummy_policy(fsc); in ceph_put_super()
51 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
56 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
57 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
62 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
63 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
87 if (ceph_test_mount_opt(fsc, NOQUOTADF) || in ceph_statfs()
88 !ceph_quota_update_statfs(fsc, buf)) { in ceph_statfs()
121 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
125 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
131 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
132 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
646 struct ceph_fs_client *fsc) in compare_mount_options() argument
649 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
677 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
687 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
688 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
696 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
783 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
788 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
791 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
806 struct ceph_fs_client *fsc; in create_fs_client() local
809 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
810 if (!fsc) { in create_fs_client()
815 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
816 if (IS_ERR(fsc->client)) { in create_fs_client()
817 err = PTR_ERR(fsc->client); in create_fs_client()
822 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
823 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
826 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
829 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
833 fsc->mount_options = fsopt; in create_fs_client()
835 fsc->sb = NULL; in create_fs_client()
836 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
837 fsc->filp_gen = 1; in create_fs_client()
838 fsc->have_copy_from2 = true; in create_fs_client()
840 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
841 fsc->write_congested = false; in create_fs_client()
848 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
849 if (!fsc->inode_wq) in create_fs_client()
851 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
852 if (!fsc->cap_wq) in create_fs_client()
855 hash_init(fsc->async_unlink_conflict); in create_fs_client()
856 spin_lock_init(&fsc->async_unlink_conflict_lock); in create_fs_client()
859 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
862 return fsc; in create_fs_client()
865 destroy_workqueue(fsc->inode_wq); in create_fs_client()
867 ceph_destroy_client(fsc->client); in create_fs_client()
869 kfree(fsc); in create_fs_client()
876 static void flush_fs_workqueues(struct ceph_fs_client *fsc) in flush_fs_workqueues() argument
878 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
879 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
882 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
884 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
887 list_del(&fsc->metric_wakeup); in destroy_fs_client()
890 ceph_mdsc_destroy(fsc); in destroy_fs_client()
891 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
892 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
894 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
896 ceph_destroy_client(fsc->client); in destroy_fs_client()
898 kfree(fsc); in destroy_fs_client()
899 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
1005 static void __ceph_umount_begin(struct ceph_fs_client *fsc) in __ceph_umount_begin() argument
1007 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in __ceph_umount_begin()
1008 ceph_mdsc_force_umount(fsc->mdsc); in __ceph_umount_begin()
1009 fsc->filp_gen++; // invalidate open files in __ceph_umount_begin()
1018 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
1021 if (!fsc) in ceph_umount_begin()
1023 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
1024 __ceph_umount_begin(fsc); in ceph_umount_begin()
1044 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
1048 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
1067 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
1094 struct ceph_fs_client *fsc = sb->s_fs_info; in ceph_apply_test_dummy_encryption() local
1101 !fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) { in ceph_apply_test_dummy_encryption()
1103 &fsc->fsc_dummy_enc_policy)) in ceph_apply_test_dummy_encryption()
1110 if (fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) { in ceph_apply_test_dummy_encryption()
1112 &fsc->fsc_dummy_enc_policy)) in ceph_apply_test_dummy_encryption()
1118 fsc->fsc_dummy_enc_policy = fsopt->dummy_enc_policy; in ceph_apply_test_dummy_encryption()
1136 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
1143 dout("mount start %p\n", fsc); in ceph_real_mount()
1144 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
1146 if (!fsc->sb->s_root) { in ceph_real_mount()
1147 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
1148 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
1150 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
1155 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
1156 err = ceph_fscache_register_fs(fsc, fc); in ceph_real_mount()
1161 err = ceph_apply_test_dummy_encryption(fsc->sb, fc, in ceph_real_mount()
1162 fsc->mount_options); in ceph_real_mount()
1168 ceph_fs_debugfs_init(fsc); in ceph_real_mount()
1170 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
1175 fsc->sb->s_root = dget(root); in ceph_real_mount()
1177 root = dget(fsc->sb->s_root); in ceph_real_mount()
1180 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
1182 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1186 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
1187 ceph_fscrypt_free_dummy_policy(fsc); in ceph_real_mount()
1193 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super() local
1201 fsc->sb = s; in ceph_set_super()
1202 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
1217 fsc->sb = NULL; in ceph_set_super()
1229 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_compare_super() local
1233 if (compare_mount_options(fsopt, opt, fsc)) { in ceph_compare_super()
1238 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1247 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1252 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1265 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc) in ceph_setup_bdi() argument
1275 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1278 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1288 struct ceph_fs_client *fsc; in ceph_get_tree() local
1302 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1305 if (IS_ERR(fsc)) { in ceph_get_tree()
1306 err = PTR_ERR(fsc); in ceph_get_tree()
1310 err = ceph_mdsc_init(fsc); in ceph_get_tree()
1314 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1317 fc->s_fs_info = fsc; in ceph_get_tree()
1325 if (ceph_sb_to_client(sb) != fsc) { in ceph_get_tree()
1326 destroy_fs_client(fsc); in ceph_get_tree()
1327 fsc = ceph_sb_to_client(sb); in ceph_get_tree()
1328 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1330 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1331 err = ceph_setup_bdi(sb, fsc); in ceph_get_tree()
1336 res = ceph_real_mount(fsc, fc); in ceph_get_tree()
1343 fc->root = fsc->sb->s_root; in ceph_get_tree()
1347 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1352 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1357 destroy_fs_client(fsc); in ceph_get_tree()
1380 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_reconfigure_fc() local
1387 ceph_set_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1389 ceph_clear_mount_opt(fsc, ASYNC_DIROPS); in ceph_reconfigure_fc()
1392 ceph_set_mount_opt(fsc, SPARSEREAD); in ceph_reconfigure_fc()
1394 ceph_clear_mount_opt(fsc, SPARSEREAD); in ceph_reconfigure_fc()
1396 if (strcmp_null(fsc->mount_options->mon_addr, fsopt->mon_addr)) { in ceph_reconfigure_fc()
1397 kfree(fsc->mount_options->mon_addr); in ceph_reconfigure_fc()
1398 fsc->mount_options->mon_addr = fsopt->mon_addr; in ceph_reconfigure_fc()
1519 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1520 struct ceph_mds_client *mdsc = fsc->mdsc; in ceph_kill_sb()
1526 flush_fs_workqueues(fsc); in ceph_kill_sb()
1552 fsc->client->options->mount_timeout); in ceph_kill_sb()
1562 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1563 ceph_fs_debugfs_cleanup(fsc); in ceph_kill_sb()
1565 ceph_fscache_unregister_fs(fsc); in ceph_kill_sb()
1567 destroy_fs_client(fsc); in ceph_kill_sb()
1581 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_force_reconnect() local
1584 fsc->mount_state = CEPH_MOUNT_RECOVER; in ceph_force_reconnect()
1585 __ceph_umount_begin(fsc); in ceph_force_reconnect()
1589 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1593 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1595 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1597 fsc->blocklisted = false; in ceph_force_reconnect()
1598 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1637 struct ceph_fs_client *fsc; in param_set_metrics() local
1648 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) { in param_set_metrics()
1649 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()