Lines Matching defs:fsc

47 	struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s);
49 doutc(fsc->client, "begin\n");
50 ceph_fscrypt_free_dummy_policy(fsc);
51 ceph_mdsc_close_sessions(fsc->mdsc);
52 doutc(fsc->client, "done\n");
57 struct ceph_fs_client *fsc = ceph_inode_to_fs_client(d_inode(dentry));
58 struct ceph_mon_client *monc = &fsc->client->monc;
63 doutc(fsc->client, "begin\n");
64 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) {
65 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0];
88 if (ceph_test_mount_opt(fsc, NOQUOTADF) ||
89 !ceph_quota_update_statfs(fsc, buf)) {
117 doutc(fsc->client, "done\n");
123 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
124 struct ceph_client *cl = fsc->client;
128 ceph_flush_dirty_caps(fsc->mdsc);
134 ceph_osdc_sync(&fsc->client->osdc);
135 ceph_mdsc_sync(fsc->mdsc);
198 fsparam_flag_no ("fsc", Opt_fscache), // fsc|nofsc
199 fsparam_string ("fsc", Opt_fscache), // fsc=...
649 struct ceph_fs_client *fsc)
652 struct ceph_mount_options *fsopt2 = fsc->mount_options;
680 return ceph_compare_options(new_opt, fsc->client);
690 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(root->d_sb);
691 struct ceph_mount_options *fsopt = fsc->mount_options;
699 ret = ceph_print_client_options(m, fsc->client, false);
718 seq_show_option(m, "fsc", fsopt->fscache_uniq);
786 struct ceph_fs_client *fsc = client->private;
791 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg);
794 ceph_mdsc_handle_fsmap(fsc->mdsc, msg);
809 struct ceph_fs_client *fsc;
812 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL);
813 if (!fsc) {
818 fsc->client = ceph_create_client(opt, fsc);
819 if (IS_ERR(fsc->client)) {
820 err = PTR_ERR(fsc->client);
823 opt = NULL; /* fsc->client now owns this */
825 fsc->client->extra_mon_dispatch = extra_mon_dispatch;
826 ceph_set_opt(fsc->client, ABORT_ON_FULL);
829 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP,
832 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP,
836 fsc->mount_options = fsopt;
838 fsc->sb = NULL;
839 fsc->mount_state = CEPH_MOUNT_MOUNTING;
840 fsc->filp_gen = 1;
841 fsc->have_copy_from2 = true;
843 atomic_long_set(&fsc->writeback_count, 0);
844 fsc->write_congested = false;
851 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0);
852 if (!fsc->inode_wq)
854 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1);
855 if (!fsc->cap_wq)
858 hash_init(fsc->async_unlink_conflict);
859 spin_lock_init(&fsc->async_unlink_conflict_lock);
862 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list);
865 return fsc;
868 destroy_workqueue(fsc->inode_wq);
870 ceph_destroy_client(fsc->client);
872 kfree(fsc);
879 static void flush_fs_workqueues(struct ceph_fs_client *fsc)
881 flush_workqueue(fsc->inode_wq);
882 flush_workqueue(fsc->cap_wq);
885 static void destroy_fs_client(struct ceph_fs_client *fsc)
887 doutc(fsc->client, "%p\n", fsc);
890 list_del(&fsc->metric_wakeup);
893 ceph_mdsc_destroy(fsc);
894 destroy_workqueue(fsc->inode_wq);
895 destroy_workqueue(fsc->cap_wq);
897 destroy_mount_options(fsc->mount_options);
899 ceph_destroy_client(fsc->client);
901 kfree(fsc);
902 dout("%s: %p done\n", __func__, fsc);
1008 static void __ceph_umount_begin(struct ceph_fs_client *fsc)
1010 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO);
1011 ceph_mdsc_force_umount(fsc->mdsc);
1012 fsc->filp_gen++; // invalidate open files
1021 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
1023 doutc(fsc->client, "starting forced umount\n");
1024 if (!fsc)
1026 fsc->mount_state = CEPH_MOUNT_SHUTDOWN;
1027 __ceph_umount_begin(fsc);
1047 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
1051 struct ceph_client *cl = fsc->client;
1052 struct ceph_mds_client *mdsc = fsc->mdsc;
1071 req->r_timeout = fsc->client->options->mount_timeout;
1098 struct ceph_fs_client *fsc = sb->s_fs_info;
1105 !fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) {
1107 &fsc->fsc_dummy_enc_policy))
1114 if (fscrypt_is_dummy_policy_set(&fsc->fsc_dummy_enc_policy)) {
1116 &fsc->fsc_dummy_enc_policy))
1122 fsc->fsc_dummy_enc_policy = fsopt->dummy_enc_policy;
1140 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
1143 struct ceph_client *cl = fsc->client;
1148 doutc(cl, "mount start %p\n", fsc);
1149 mutex_lock(&fsc->client->mount_mutex);
1151 if (!fsc->sb->s_root) {
1152 const char *path = fsc->mount_options->server_path ?
1153 fsc->mount_options->server_path + 1 : "";
1155 err = __ceph_open_session(fsc->client, started);
1160 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) {
1161 err = ceph_fscache_register_fs(fsc, fc);
1166 err = ceph_apply_test_dummy_encryption(fsc->sb, fc,
1167 fsc->mount_options);
1173 ceph_fs_debugfs_init(fsc);
1175 root = open_root_dentry(fsc, path, started);
1180 fsc->sb->s_root = dget(root);
1182 root = dget(fsc->sb->s_root);
1185 fsc->mount_state = CEPH_MOUNT_MOUNTED;
1187 mutex_unlock(&fsc->client->mount_mutex);
1191 mutex_unlock(&fsc->client->mount_mutex);
1192 ceph_fscrypt_free_dummy_policy(fsc);
1198 struct ceph_fs_client *fsc = s->s_fs_info;
1199 struct ceph_client *cl = fsc->client;
1207 fsc->sb = s;
1208 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */
1223 fsc->sb = NULL;
1235 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
1236 struct ceph_client *cl = fsc->client;
1240 if (compare_mount_options(fsopt, opt, fsc)) {
1245 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) {
1254 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) {
1259 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) {
1272 static int ceph_setup_bdi(struct super_block *sb, struct ceph_fs_client *fsc)
1282 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT;
1285 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT;
1295 struct ceph_fs_client *fsc;
1309 fsc = create_fs_client(pctx->opts, pctx->copts);
1312 if (IS_ERR(fsc)) {
1313 err = PTR_ERR(fsc);
1317 err = ceph_mdsc_init(fsc);
1321 if (ceph_test_opt(fsc->client, NOSHARE))
1324 fc->s_fs_info = fsc;
1332 if (ceph_sb_to_fs_client(sb) != fsc) {
1333 destroy_fs_client(fsc);
1334 fsc = ceph_sb_to_fs_client(sb);
1335 dout("get_sb got existing client %p\n", fsc);
1337 dout("get_sb using new client %p\n", fsc);
1338 err = ceph_setup_bdi(sb, fsc);
1343 res = ceph_real_mount(fsc, fc);
1349 doutc(fsc->client, "root %p inode %p ino %llx.%llx\n", res,
1351 fc->root = fsc->sb->s_root;
1355 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) {
1360 ceph_mdsc_close_sessions(fsc->mdsc);
1365 destroy_fs_client(fsc);
1388 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
1395 ceph_set_mount_opt(fsc, ASYNC_DIROPS);
1397 ceph_clear_mount_opt(fsc, ASYNC_DIROPS);
1400 ceph_set_mount_opt(fsc, SPARSEREAD);
1402 ceph_clear_mount_opt(fsc, SPARSEREAD);
1404 if (strcmp_null(fsc->mount_options->mon_addr, fsopt->mon_addr)) {
1405 kfree(fsc->mount_options->mon_addr);
1406 fsc->mount_options->mon_addr = fsopt->mon_addr;
1408 pr_notice_client(fsc->client,
1528 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(s);
1529 struct ceph_client *cl = fsc->client;
1530 struct ceph_mds_client *mdsc = fsc->mdsc;
1536 flush_fs_workqueues(fsc);
1562 fsc->client->options->mount_timeout);
1572 fsc->client->extra_mon_dispatch = NULL;
1573 ceph_fs_debugfs_cleanup(fsc);
1575 ceph_fscache_unregister_fs(fsc);
1577 destroy_fs_client(fsc);
1591 struct ceph_fs_client *fsc = ceph_sb_to_fs_client(sb);
1594 fsc->mount_state = CEPH_MOUNT_RECOVER;
1595 __ceph_umount_begin(fsc);
1599 flush_workqueue(fsc->inode_wq);
1603 ceph_reset_client_addr(fsc->client);
1605 ceph_osdc_clear_abort_err(&fsc->client->osdc);
1607 fsc->blocklisted = false;
1608 fsc->mount_state = CEPH_MOUNT_MOUNTED;
1647 struct ceph_fs_client *fsc;
1658 list_for_each_entry(fsc, &ceph_fsc_list, metric_wakeup) {
1659 metric_schedule_delayed(&fsc->mdsc->metric);