Lines Matching defs:fsc

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