Lines Matching refs:fsc

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