Lines Matching refs:fsc
39 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_put_super() local
42 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
47 struct ceph_fs_client *fsc = ceph_inode_to_client(d_inode(dentry)); in ceph_statfs() local
48 struct ceph_monmap *monmap = fsc->client->monc.monmap; in ceph_statfs()
54 err = ceph_monc_do_statfs(&fsc->client->monc, &st); in ceph_statfs()
91 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_sync_fs() local
95 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
101 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
102 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
316 struct ceph_fs_client *fsc) in compare_mount_options() argument
319 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
331 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
423 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
424 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
432 ret = ceph_print_client_options(m, fsc->client); in ceph_show_options()
493 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
498 ceph_mdsc_handle_map(fsc->mdsc, msg); in extra_mon_dispatch()
512 struct ceph_fs_client *fsc; in create_fs_client() local
522 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
523 if (!fsc) in create_fs_client()
526 fsc->client = ceph_create_client(opt, fsc, supported_features, in create_fs_client()
528 if (IS_ERR(fsc->client)) { in create_fs_client()
529 err = PTR_ERR(fsc->client); in create_fs_client()
532 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
533 fsc->client->monc.want_mdsmap = 1; in create_fs_client()
535 fsc->mount_options = fsopt; in create_fs_client()
537 fsc->sb = NULL; in create_fs_client()
538 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
540 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
542 err = bdi_init(&fsc->backing_dev_info); in create_fs_client()
551 fsc->wb_wq = alloc_workqueue("ceph-writeback", 0, 1); in create_fs_client()
552 if (fsc->wb_wq == NULL) in create_fs_client()
554 fsc->pg_inv_wq = alloc_workqueue("ceph-pg-invalid", 0, 1); in create_fs_client()
555 if (fsc->pg_inv_wq == NULL) in create_fs_client()
557 fsc->trunc_wq = alloc_workqueue("ceph-trunc", 0, 1); in create_fs_client()
558 if (fsc->trunc_wq == NULL) in create_fs_client()
563 page_count = fsc->mount_options->wsize >> PAGE_CACHE_SHIFT; in create_fs_client()
565 fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, size); in create_fs_client()
566 if (!fsc->wb_pagevec_pool) in create_fs_client()
571 (ceph_fscache_register_fs(fsc) != 0)) in create_fs_client()
575 fsc->min_caps = fsopt->max_readdir; in create_fs_client()
577 return fsc; in create_fs_client()
580 ceph_fscache_unregister_fs(fsc); in create_fs_client()
582 destroy_workqueue(fsc->trunc_wq); in create_fs_client()
584 destroy_workqueue(fsc->pg_inv_wq); in create_fs_client()
586 destroy_workqueue(fsc->wb_wq); in create_fs_client()
588 bdi_destroy(&fsc->backing_dev_info); in create_fs_client()
590 ceph_destroy_client(fsc->client); in create_fs_client()
592 kfree(fsc); in create_fs_client()
596 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
598 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
600 ceph_fscache_unregister_fs(fsc); in destroy_fs_client()
602 destroy_workqueue(fsc->wb_wq); in destroy_fs_client()
603 destroy_workqueue(fsc->pg_inv_wq); in destroy_fs_client()
604 destroy_workqueue(fsc->trunc_wq); in destroy_fs_client()
606 bdi_destroy(&fsc->backing_dev_info); in destroy_fs_client()
608 mempool_destroy(fsc->wb_pagevec_pool); in destroy_fs_client()
610 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
612 ceph_fs_debugfs_cleanup(fsc); in destroy_fs_client()
614 ceph_destroy_client(fsc->client); in destroy_fs_client()
616 kfree(fsc); in destroy_fs_client()
617 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
705 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
708 if (!fsc) in ceph_umount_begin()
710 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
711 ceph_mdsc_force_umount(fsc->mdsc); in ceph_umount_begin()
731 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
735 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
754 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
763 fsc->sb->s_root == NULL) { in open_root_dentry()
788 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
797 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
799 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
804 root = open_root_dentry(fsc, "", started); in ceph_real_mount()
809 if (fsc->sb->s_root) { in ceph_real_mount()
812 fsc->sb->s_root = root; in ceph_real_mount()
815 err = ceph_fs_debugfs_init(fsc); in ceph_real_mount()
824 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
831 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
833 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
837 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
842 dput(fsc->sb->s_root); in ceph_real_mount()
843 fsc->sb->s_root = NULL; in ceph_real_mount()
850 struct ceph_fs_client *fsc = data; in ceph_set_super() local
855 s->s_flags = fsc->mount_options->sb_flags; in ceph_set_super()
859 s->s_fs_info = fsc; in ceph_set_super()
860 fsc->sb = s; in ceph_set_super()
875 fsc->sb = NULL; in ceph_set_super()
913 struct ceph_fs_client *fsc) in ceph_register_bdi() argument
918 if (fsc->mount_options->rasize >= PAGE_CACHE_SIZE) in ceph_register_bdi()
919 fsc->backing_dev_info.ra_pages = in ceph_register_bdi()
920 (fsc->mount_options->rasize + PAGE_CACHE_SIZE - 1) in ceph_register_bdi()
923 fsc->backing_dev_info.ra_pages = in ceph_register_bdi()
926 err = bdi_register(&fsc->backing_dev_info, NULL, "ceph-%ld", in ceph_register_bdi()
929 sb->s_bdi = &fsc->backing_dev_info; in ceph_register_bdi()
937 struct ceph_fs_client *fsc; in ceph_mount() local
957 fsc = create_fs_client(fsopt, opt); in ceph_mount()
958 if (IS_ERR(fsc)) { in ceph_mount()
959 res = ERR_CAST(fsc); in ceph_mount()
965 err = ceph_mdsc_init(fsc); in ceph_mount()
971 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_mount()
973 sb = sget(fs_type, compare_super, ceph_set_super, flags, fsc); in ceph_mount()
979 if (ceph_sb_to_client(sb) != fsc) { in ceph_mount()
980 ceph_mdsc_destroy(fsc); in ceph_mount()
981 destroy_fs_client(fsc); in ceph_mount()
982 fsc = ceph_sb_to_client(sb); in ceph_mount()
983 dout("get_sb got existing client %p\n", fsc); in ceph_mount()
985 dout("get_sb using new client %p\n", fsc); in ceph_mount()
986 err = ceph_register_bdi(sb, fsc); in ceph_mount()
993 res = ceph_real_mount(fsc, path); in ceph_mount()
1001 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_mount()
1006 ceph_mdsc_destroy(fsc); in ceph_mount()
1007 destroy_fs_client(fsc); in ceph_mount()
1015 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
1020 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1022 ceph_mdsc_destroy(fsc); in ceph_kill_sb()
1024 destroy_fs_client(fsc); in ceph_kill_sb()