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()
305 struct ceph_fs_client *fsc) in compare_mount_options() argument
308 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
320 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
412 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options() local
413 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
421 ret = ceph_print_client_options(m, fsc->client); in ceph_show_options()
480 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch() local
485 ceph_mdsc_handle_map(fsc->mdsc, msg); in extra_mon_dispatch()
499 struct ceph_fs_client *fsc; in create_fs_client() local
509 fsc = kzalloc(sizeof(*fsc), GFP_KERNEL); in create_fs_client()
510 if (!fsc) in create_fs_client()
513 fsc->client = ceph_create_client(opt, fsc, supported_features, in create_fs_client()
515 if (IS_ERR(fsc->client)) { in create_fs_client()
516 err = PTR_ERR(fsc->client); in create_fs_client()
519 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
520 fsc->client->monc.want_mdsmap = 1; in create_fs_client()
522 fsc->mount_options = fsopt; in create_fs_client()
524 fsc->sb = NULL; in create_fs_client()
525 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
527 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
529 err = bdi_init(&fsc->backing_dev_info); in create_fs_client()
538 fsc->wb_wq = alloc_workqueue("ceph-writeback", 0, 1); in create_fs_client()
539 if (fsc->wb_wq == NULL) in create_fs_client()
541 fsc->pg_inv_wq = alloc_workqueue("ceph-pg-invalid", 0, 1); in create_fs_client()
542 if (fsc->pg_inv_wq == NULL) in create_fs_client()
544 fsc->trunc_wq = alloc_workqueue("ceph-trunc", 0, 1); in create_fs_client()
545 if (fsc->trunc_wq == NULL) in create_fs_client()
550 page_count = fsc->mount_options->wsize >> PAGE_CACHE_SHIFT; in create_fs_client()
552 fsc->wb_pagevec_pool = mempool_create_kmalloc_pool(10, size); in create_fs_client()
553 if (!fsc->wb_pagevec_pool) in create_fs_client()
558 (ceph_fscache_register_fs(fsc) != 0)) in create_fs_client()
562 fsc->min_caps = fsopt->max_readdir; in create_fs_client()
564 return fsc; in create_fs_client()
567 ceph_fscache_unregister_fs(fsc); in create_fs_client()
569 destroy_workqueue(fsc->trunc_wq); in create_fs_client()
571 destroy_workqueue(fsc->pg_inv_wq); in create_fs_client()
573 destroy_workqueue(fsc->wb_wq); in create_fs_client()
575 bdi_destroy(&fsc->backing_dev_info); in create_fs_client()
577 ceph_destroy_client(fsc->client); in create_fs_client()
579 kfree(fsc); in create_fs_client()
583 static void destroy_fs_client(struct ceph_fs_client *fsc) in destroy_fs_client() argument
585 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
587 ceph_fscache_unregister_fs(fsc); in destroy_fs_client()
589 destroy_workqueue(fsc->wb_wq); in destroy_fs_client()
590 destroy_workqueue(fsc->pg_inv_wq); in destroy_fs_client()
591 destroy_workqueue(fsc->trunc_wq); in destroy_fs_client()
593 bdi_destroy(&fsc->backing_dev_info); in destroy_fs_client()
595 mempool_destroy(fsc->wb_pagevec_pool); in destroy_fs_client()
597 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
599 ceph_fs_debugfs_cleanup(fsc); in destroy_fs_client()
601 ceph_destroy_client(fsc->client); in destroy_fs_client()
603 kfree(fsc); in destroy_fs_client()
604 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
684 struct ceph_fs_client *fsc = ceph_sb_to_client(sb); in ceph_umount_begin() local
687 if (!fsc) in ceph_umount_begin()
689 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
709 static struct dentry *open_root_dentry(struct ceph_fs_client *fsc, in open_root_dentry() argument
713 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
732 req->r_timeout = fsc->client->options->mount_timeout * HZ; in open_root_dentry()
741 fsc->sb->s_root == NULL) { in open_root_dentry()
766 static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, in ceph_real_mount() argument
775 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
777 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
782 root = open_root_dentry(fsc, "", started); in ceph_real_mount()
787 if (fsc->sb->s_root) { in ceph_real_mount()
790 fsc->sb->s_root = root; in ceph_real_mount()
793 err = ceph_fs_debugfs_init(fsc); in ceph_real_mount()
802 root = open_root_dentry(fsc, path, started); in ceph_real_mount()
809 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
811 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
815 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
820 dput(fsc->sb->s_root); in ceph_real_mount()
821 fsc->sb->s_root = NULL; in ceph_real_mount()
828 struct ceph_fs_client *fsc = data; in ceph_set_super() local
833 s->s_flags = fsc->mount_options->sb_flags; in ceph_set_super()
837 s->s_fs_info = fsc; in ceph_set_super()
838 fsc->sb = s; in ceph_set_super()
853 fsc->sb = NULL; in ceph_set_super()
891 struct ceph_fs_client *fsc) in ceph_register_bdi() argument
896 if (fsc->mount_options->rasize >= PAGE_CACHE_SIZE) in ceph_register_bdi()
897 fsc->backing_dev_info.ra_pages = in ceph_register_bdi()
898 (fsc->mount_options->rasize + PAGE_CACHE_SIZE - 1) in ceph_register_bdi()
901 fsc->backing_dev_info.ra_pages = in ceph_register_bdi()
904 err = bdi_register(&fsc->backing_dev_info, NULL, "ceph-%ld", in ceph_register_bdi()
907 sb->s_bdi = &fsc->backing_dev_info; in ceph_register_bdi()
915 struct ceph_fs_client *fsc; in ceph_mount() local
935 fsc = create_fs_client(fsopt, opt); in ceph_mount()
936 if (IS_ERR(fsc)) { in ceph_mount()
937 res = ERR_CAST(fsc); in ceph_mount()
943 err = ceph_mdsc_init(fsc); in ceph_mount()
949 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_mount()
951 sb = sget(fs_type, compare_super, ceph_set_super, flags, fsc); in ceph_mount()
957 if (ceph_sb_to_client(sb) != fsc) { in ceph_mount()
958 ceph_mdsc_destroy(fsc); in ceph_mount()
959 destroy_fs_client(fsc); in ceph_mount()
960 fsc = ceph_sb_to_client(sb); in ceph_mount()
961 dout("get_sb got existing client %p\n", fsc); in ceph_mount()
963 dout("get_sb using new client %p\n", fsc); in ceph_mount()
964 err = ceph_register_bdi(sb, fsc); in ceph_mount()
971 res = ceph_real_mount(fsc, path); in ceph_mount()
979 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_mount()
984 ceph_mdsc_destroy(fsc); in ceph_mount()
985 destroy_fs_client(fsc); in ceph_mount()
993 struct ceph_fs_client *fsc = ceph_sb_to_client(s); in ceph_kill_sb() local
998 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1000 ceph_mdsc_destroy(fsc); in ceph_kill_sb()
1002 destroy_fs_client(fsc); in ceph_kill_sb()