• Home
  • Raw
  • Download

Lines Matching +full:dout +full:- +full:default +full:- +full:2

1 // SPDX-License-Identifier: GPL-2.0-only
5 #include <linux/backing-dev.h>
46 dout("put_super\n"); in ceph_put_super()
47 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_put_super()
53 struct ceph_mon_client *monc = &fsc->client->monc; in ceph_statfs()
58 if (fsc->mdsc->mdsmap->m_num_data_pg_pools == 1) { in ceph_statfs()
59 data_pool = fsc->mdsc->mdsmap->m_data_pg_pools[0]; in ceph_statfs()
64 dout("statfs\n"); in ceph_statfs()
70 buf->f_type = CEPH_SUPER_MAGIC; /* ?? */ in ceph_statfs()
74 * overflow on 32-bit machines. in ceph_statfs()
77 * not-yet-ancient versions of glibc that are broken. in ceph_statfs()
81 buf->f_bsize = 1 << CEPH_BLOCK_SHIFT; in ceph_statfs()
82 buf->f_frsize = 1 << CEPH_BLOCK_SHIFT; in ceph_statfs()
85 * By default use root quota for stats; fallback to overall filesystem in ceph_statfs()
91 buf->f_blocks = le64_to_cpu(st.kb) >> (CEPH_BLOCK_SHIFT-10); in ceph_statfs()
92 buf->f_bfree = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10); in ceph_statfs()
93 buf->f_bavail = le64_to_cpu(st.kb_avail) >> (CEPH_BLOCK_SHIFT-10); in ceph_statfs()
96 buf->f_files = le64_to_cpu(st.num_objects); in ceph_statfs()
97 buf->f_ffree = -1; in ceph_statfs()
98 buf->f_namelen = NAME_MAX; in ceph_statfs()
101 buf->f_fsid.val[0] = 0; in ceph_statfs()
102 mutex_lock(&monc->mutex); in ceph_statfs()
103 for (i = 0 ; i < sizeof(monc->monmap->fsid) / sizeof(__le32) ; ++i) in ceph_statfs()
104 buf->f_fsid.val[0] ^= le32_to_cpu(((__le32 *)&monc->monmap->fsid)[i]); in ceph_statfs()
105 mutex_unlock(&monc->mutex); in ceph_statfs()
108 buf->f_fsid.val[1] = monc->fs_cluster_id; in ceph_statfs()
118 dout("sync_fs (non-blocking)\n"); in ceph_sync_fs()
119 ceph_flush_dirty_caps(fsc->mdsc); in ceph_sync_fs()
120 dout("sync_fs (non-blocking) done\n"); in ceph_sync_fs()
124 dout("sync_fs (blocking)\n"); in ceph_sync_fs()
125 ceph_osdc_sync(&fsc->client->osdc); in ceph_sync_fs()
126 ceph_mdsc_sync(fsc->mdsc); in ceph_sync_fs()
127 dout("sync_fs (blocking) done\n"); in ceph_sync_fs()
214 * E.g. "//dir1////dir2///" --> "/dir1/dir2", "///" --> "/".
221 if (path[i] != '/' || j < 1 || path[j - 1] != '/') in canonicalize_path()
225 if (j > 1 && path[j - 1] == '/') in canonicalize_path()
226 j--; in canonicalize_path()
241 struct ceph_parse_opts_ctx *pctx = fc->fs_private; in ceph_parse_source()
242 struct ceph_mount_options *fsopt = pctx->opts; in ceph_parse_source()
243 char *dev_name = param->string, *dev_name_end; in ceph_parse_source()
246 dout("%s '%s'\n", __func__, dev_name); in ceph_parse_source()
256 kfree(fsopt->server_path); in ceph_parse_source()
257 fsopt->server_path = kstrdup(dev_name_end, GFP_KERNEL); in ceph_parse_source()
258 if (!fsopt->server_path) in ceph_parse_source()
259 return -ENOMEM; in ceph_parse_source()
261 canonicalize_path(fsopt->server_path); in ceph_parse_source()
266 dev_name_end--; /* back up to ':' separator */ in ceph_parse_source()
270 dout("device name '%.*s'\n", (int)(dev_name_end - dev_name), dev_name); in ceph_parse_source()
271 if (fsopt->server_path) in ceph_parse_source()
272 dout("server path '%s'\n", fsopt->server_path); in ceph_parse_source()
274 ret = ceph_parse_mon_ips(param->string, dev_name_end - dev_name, in ceph_parse_source()
275 pctx->copts, fc->log.log); in ceph_parse_source()
279 fc->source = param->string; in ceph_parse_source()
280 param->string = NULL; in ceph_parse_source()
287 struct ceph_parse_opts_ctx *pctx = fc->fs_private; in ceph_parse_mount_param()
288 struct ceph_mount_options *fsopt = pctx->opts; in ceph_parse_mount_param()
293 ret = ceph_parse_param(param, pctx->copts, fc->log.log); in ceph_parse_mount_param()
294 if (ret != -ENOPARAM) in ceph_parse_mount_param()
298 dout("%s fs_parse '%s' token %d\n", __func__, param->key, token); in ceph_parse_mount_param()
304 kfree(fsopt->snapdir_name); in ceph_parse_mount_param()
305 fsopt->snapdir_name = param->string; in ceph_parse_mount_param()
306 param->string = NULL; in ceph_parse_mount_param()
309 kfree(fsopt->mds_namespace); in ceph_parse_mount_param()
310 fsopt->mds_namespace = param->string; in ceph_parse_mount_param()
311 param->string = NULL; in ceph_parse_mount_param()
316 fsopt->flags &= ~CEPH_MOUNT_OPT_CLEANRECOVER; in ceph_parse_mount_param()
318 fsopt->flags |= CEPH_MOUNT_OPT_CLEANRECOVER; in ceph_parse_mount_param()
323 if (fc->source) in ceph_parse_mount_param()
330 fsopt->wsize = ALIGN(result.uint_32, PAGE_SIZE); in ceph_parse_mount_param()
336 fsopt->rsize = ALIGN(result.uint_32, PAGE_SIZE); in ceph_parse_mount_param()
339 fsopt->rasize = ALIGN(result.uint_32, PAGE_SIZE); in ceph_parse_mount_param()
344 fsopt->caps_wanted_delay_min = result.uint_32; in ceph_parse_mount_param()
349 fsopt->caps_wanted_delay_max = result.uint_32; in ceph_parse_mount_param()
354 fsopt->caps_max = result.int_32; in ceph_parse_mount_param()
359 fsopt->max_readdir = result.uint_32; in ceph_parse_mount_param()
364 fsopt->max_readdir_bytes = result.uint_32; in ceph_parse_mount_param()
369 fsopt->congestion_kb = result.uint_32; in ceph_parse_mount_param()
373 fsopt->flags |= CEPH_MOUNT_OPT_DIRSTAT; in ceph_parse_mount_param()
375 fsopt->flags &= ~CEPH_MOUNT_OPT_DIRSTAT; in ceph_parse_mount_param()
379 fsopt->flags |= CEPH_MOUNT_OPT_RBYTES; in ceph_parse_mount_param()
381 fsopt->flags &= ~CEPH_MOUNT_OPT_RBYTES; in ceph_parse_mount_param()
385 fsopt->flags &= ~CEPH_MOUNT_OPT_NOASYNCREADDIR; in ceph_parse_mount_param()
387 fsopt->flags |= CEPH_MOUNT_OPT_NOASYNCREADDIR; in ceph_parse_mount_param()
391 fsopt->flags |= CEPH_MOUNT_OPT_DCACHE; in ceph_parse_mount_param()
393 fsopt->flags &= ~CEPH_MOUNT_OPT_DCACHE; in ceph_parse_mount_param()
397 fsopt->flags |= CEPH_MOUNT_OPT_INO32; in ceph_parse_mount_param()
399 fsopt->flags &= ~CEPH_MOUNT_OPT_INO32; in ceph_parse_mount_param()
404 kfree(fsopt->fscache_uniq); in ceph_parse_mount_param()
405 fsopt->fscache_uniq = NULL; in ceph_parse_mount_param()
407 fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE; in ceph_parse_mount_param()
409 fsopt->flags |= CEPH_MOUNT_OPT_FSCACHE; in ceph_parse_mount_param()
410 fsopt->fscache_uniq = param->string; in ceph_parse_mount_param()
411 param->string = NULL; in ceph_parse_mount_param()
419 fsopt->flags &= ~CEPH_MOUNT_OPT_NOPOOLPERM; in ceph_parse_mount_param()
421 fsopt->flags |= CEPH_MOUNT_OPT_NOPOOLPERM; in ceph_parse_mount_param()
425 fsopt->flags &= ~CEPH_MOUNT_OPT_MOUNTWAIT; in ceph_parse_mount_param()
427 fsopt->flags |= CEPH_MOUNT_OPT_MOUNTWAIT; in ceph_parse_mount_param()
431 fsopt->flags &= ~CEPH_MOUNT_OPT_NOQUOTADF; in ceph_parse_mount_param()
433 fsopt->flags |= CEPH_MOUNT_OPT_NOQUOTADF; in ceph_parse_mount_param()
437 fsopt->flags &= ~CEPH_MOUNT_OPT_NOCOPYFROM; in ceph_parse_mount_param()
439 fsopt->flags |= CEPH_MOUNT_OPT_NOCOPYFROM; in ceph_parse_mount_param()
444 fc->sb_flags |= SB_POSIXACL; in ceph_parse_mount_param()
449 fc->sb_flags &= ~SB_POSIXACL; in ceph_parse_mount_param()
454 fsopt->flags &= ~CEPH_MOUNT_OPT_ASYNC_DIROPS; in ceph_parse_mount_param()
456 fsopt->flags |= CEPH_MOUNT_OPT_ASYNC_DIROPS; in ceph_parse_mount_param()
458 default: in ceph_parse_mount_param()
464 return invalfc(fc, "%s out of range", param->key); in ceph_parse_mount_param()
469 dout("destroy_mount_options %p\n", args); in destroy_mount_options()
473 kfree(args->snapdir_name); in destroy_mount_options()
474 kfree(args->mds_namespace); in destroy_mount_options()
475 kfree(args->server_path); in destroy_mount_options()
476 kfree(args->fscache_uniq); in destroy_mount_options()
485 return -1; in strcmp_null()
496 struct ceph_mount_options *fsopt2 = fsc->mount_options; in compare_mount_options()
504 ret = strcmp_null(fsopt1->snapdir_name, fsopt2->snapdir_name); in compare_mount_options()
508 ret = strcmp_null(fsopt1->mds_namespace, fsopt2->mds_namespace); in compare_mount_options()
512 ret = strcmp_null(fsopt1->server_path, fsopt2->server_path); in compare_mount_options()
516 ret = strcmp_null(fsopt1->fscache_uniq, fsopt2->fscache_uniq); in compare_mount_options()
520 return ceph_compare_options(new_opt, fsc->client); in compare_mount_options()
524 * ceph_show_options - Show mount options in /proc/mounts
530 struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); in ceph_show_options()
531 struct ceph_mount_options *fsopt = fsc->mount_options; in ceph_show_options()
537 pos = m->count; in ceph_show_options()
539 ret = ceph_print_client_options(m, fsc->client, false); in ceph_show_options()
544 if (m->count == pos) in ceph_show_options()
545 m->count--; in ceph_show_options()
547 if (fsopt->flags & CEPH_MOUNT_OPT_DIRSTAT) in ceph_show_options()
549 if ((fsopt->flags & CEPH_MOUNT_OPT_RBYTES)) in ceph_show_options()
551 if (fsopt->flags & CEPH_MOUNT_OPT_NOASYNCREADDIR) in ceph_show_options()
553 if ((fsopt->flags & CEPH_MOUNT_OPT_DCACHE) == 0) in ceph_show_options()
555 if (fsopt->flags & CEPH_MOUNT_OPT_INO32) in ceph_show_options()
557 if (fsopt->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_show_options()
558 seq_show_option(m, "fsc", fsopt->fscache_uniq); in ceph_show_options()
560 if (fsopt->flags & CEPH_MOUNT_OPT_NOPOOLPERM) in ceph_show_options()
562 if (fsopt->flags & CEPH_MOUNT_OPT_NOQUOTADF) in ceph_show_options()
566 if (root->d_sb->s_flags & SB_POSIXACL) in ceph_show_options()
572 if ((fsopt->flags & CEPH_MOUNT_OPT_NOCOPYFROM) == 0) in ceph_show_options()
575 if (fsopt->mds_namespace) in ceph_show_options()
576 seq_show_option(m, "mds_namespace", fsopt->mds_namespace); in ceph_show_options()
578 if (fsopt->flags & CEPH_MOUNT_OPT_CLEANRECOVER) in ceph_show_options()
581 if (fsopt->flags & CEPH_MOUNT_OPT_ASYNC_DIROPS) in ceph_show_options()
584 if (fsopt->wsize != CEPH_MAX_WRITE_SIZE) in ceph_show_options()
585 seq_printf(m, ",wsize=%u", fsopt->wsize); in ceph_show_options()
586 if (fsopt->rsize != CEPH_MAX_READ_SIZE) in ceph_show_options()
587 seq_printf(m, ",rsize=%u", fsopt->rsize); in ceph_show_options()
588 if (fsopt->rasize != CEPH_RASIZE_DEFAULT) in ceph_show_options()
589 seq_printf(m, ",rasize=%u", fsopt->rasize); in ceph_show_options()
590 if (fsopt->congestion_kb != default_congestion_kb()) in ceph_show_options()
591 seq_printf(m, ",write_congestion_kb=%u", fsopt->congestion_kb); in ceph_show_options()
592 if (fsopt->caps_max) in ceph_show_options()
593 seq_printf(m, ",caps_max=%d", fsopt->caps_max); in ceph_show_options()
594 if (fsopt->caps_wanted_delay_min != CEPH_CAPS_WANTED_DELAY_MIN_DEFAULT) in ceph_show_options()
596 fsopt->caps_wanted_delay_min); in ceph_show_options()
597 if (fsopt->caps_wanted_delay_max != CEPH_CAPS_WANTED_DELAY_MAX_DEFAULT) in ceph_show_options()
599 fsopt->caps_wanted_delay_max); in ceph_show_options()
600 if (fsopt->max_readdir != CEPH_MAX_READDIR_DEFAULT) in ceph_show_options()
601 seq_printf(m, ",readdir_max_entries=%u", fsopt->max_readdir); in ceph_show_options()
602 if (fsopt->max_readdir_bytes != CEPH_MAX_READDIR_BYTES_DEFAULT) in ceph_show_options()
603 seq_printf(m, ",readdir_max_bytes=%u", fsopt->max_readdir_bytes); in ceph_show_options()
604 if (strcmp(fsopt->snapdir_name, CEPH_SNAPDIRNAME_DEFAULT)) in ceph_show_options()
605 seq_show_option(m, "snapdirname", fsopt->snapdir_name); in ceph_show_options()
616 struct ceph_fs_client *fsc = client->private; in extra_mon_dispatch()
617 int type = le16_to_cpu(msg->hdr.type); in extra_mon_dispatch()
621 ceph_mdsc_handle_mdsmap(fsc->mdsc, msg); in extra_mon_dispatch()
624 ceph_mdsc_handle_fsmap(fsc->mdsc, msg); in extra_mon_dispatch()
626 default: in extra_mon_dispatch()
627 return -1; in extra_mon_dispatch()
644 err = -ENOMEM; in create_fs_client()
648 fsc->client = ceph_create_client(opt, fsc); in create_fs_client()
649 if (IS_ERR(fsc->client)) { in create_fs_client()
650 err = PTR_ERR(fsc->client); in create_fs_client()
653 opt = NULL; /* fsc->client now owns this */ in create_fs_client()
655 fsc->client->extra_mon_dispatch = extra_mon_dispatch; in create_fs_client()
656 ceph_set_opt(fsc->client, ABORT_ON_FULL); in create_fs_client()
658 if (!fsopt->mds_namespace) { in create_fs_client()
659 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_MDSMAP, in create_fs_client()
662 ceph_monc_want_map(&fsc->client->monc, CEPH_SUB_FSMAP, in create_fs_client()
666 fsc->mount_options = fsopt; in create_fs_client()
668 fsc->sb = NULL; in create_fs_client()
669 fsc->mount_state = CEPH_MOUNT_MOUNTING; in create_fs_client()
670 fsc->filp_gen = 1; in create_fs_client()
671 fsc->have_copy_from2 = true; in create_fs_client()
673 atomic_long_set(&fsc->writeback_count, 0); in create_fs_client()
675 err = -ENOMEM; in create_fs_client()
680 fsc->inode_wq = alloc_workqueue("ceph-inode", WQ_UNBOUND, 0); in create_fs_client()
681 if (!fsc->inode_wq) in create_fs_client()
683 fsc->cap_wq = alloc_workqueue("ceph-cap", 0, 1); in create_fs_client()
684 if (!fsc->cap_wq) in create_fs_client()
688 list_add_tail(&fsc->metric_wakeup, &ceph_fsc_list); in create_fs_client()
694 destroy_workqueue(fsc->inode_wq); in create_fs_client()
696 ceph_destroy_client(fsc->client); in create_fs_client()
707 flush_workqueue(fsc->inode_wq); in flush_fs_workqueues()
708 flush_workqueue(fsc->cap_wq); in flush_fs_workqueues()
713 dout("destroy_fs_client %p\n", fsc); in destroy_fs_client()
716 list_del(&fsc->metric_wakeup); in destroy_fs_client()
720 destroy_workqueue(fsc->inode_wq); in destroy_fs_client()
721 destroy_workqueue(fsc->cap_wq); in destroy_fs_client()
723 destroy_mount_options(fsc->mount_options); in destroy_fs_client()
725 ceph_destroy_client(fsc->client); in destroy_fs_client()
728 dout("destroy_fs_client %p done\n", fsc); in destroy_fs_client()
746 inode_init_once(&ci->vfs_inode); in ceph_inode_init_once()
751 int error = -ENOMEM; in init_caches()
759 return -ENOMEM; in init_caches()
836 * ceph_umount_begin - initiate forced umount. Tear down the
843 dout("ceph_umount_begin - starting forced umount\n"); in ceph_umount_begin()
846 fsc->mount_state = CEPH_MOUNT_SHUTDOWN; in ceph_umount_begin()
847 ceph_osdc_abort_requests(&fsc->client->osdc, -EIO); in ceph_umount_begin()
848 ceph_mdsc_force_umount(fsc->mdsc); in ceph_umount_begin()
849 fsc->filp_gen++; // invalidate open files in ceph_umount_begin()
873 struct ceph_mds_client *mdsc = fsc->mdsc; in open_root_dentry()
879 dout("open_root_inode opening '%s'\n", path); in open_root_dentry()
883 req->r_path1 = kstrdup(path, GFP_NOFS); in open_root_dentry()
884 if (!req->r_path1) { in open_root_dentry()
885 root = ERR_PTR(-ENOMEM); in open_root_dentry()
889 req->r_ino1.ino = CEPH_INO_ROOT; in open_root_dentry()
890 req->r_ino1.snap = CEPH_NOSNAP; in open_root_dentry()
891 req->r_started = started; in open_root_dentry()
892 req->r_timeout = fsc->client->options->mount_timeout; in open_root_dentry()
893 req->r_args.getattr.mask = cpu_to_le32(CEPH_STAT_CAP_INODE); in open_root_dentry()
894 req->r_num_caps = 2; in open_root_dentry()
897 struct inode *inode = req->r_target_inode; in open_root_dentry()
898 req->r_target_inode = NULL; in open_root_dentry()
899 dout("open_root_inode success\n"); in open_root_dentry()
902 root = ERR_PTR(-ENOMEM); in open_root_dentry()
905 dout("open_root_inode success, root dentry is %p\n", root); in open_root_dentry()
924 dout("mount start %p\n", fsc); in ceph_real_mount()
925 mutex_lock(&fsc->client->mount_mutex); in ceph_real_mount()
927 if (!fsc->sb->s_root) { in ceph_real_mount()
928 const char *path = fsc->mount_options->server_path ? in ceph_real_mount()
929 fsc->mount_options->server_path + 1 : ""; in ceph_real_mount()
931 err = __ceph_open_session(fsc->client, started); in ceph_real_mount()
936 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) { in ceph_real_mount()
942 dout("mount opening path '%s'\n", path); in ceph_real_mount()
951 fsc->sb->s_root = dget(root); in ceph_real_mount()
953 root = dget(fsc->sb->s_root); in ceph_real_mount()
956 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_real_mount()
957 dout("mount success\n"); in ceph_real_mount()
958 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
962 mutex_unlock(&fsc->client->mount_mutex); in ceph_real_mount()
968 struct ceph_fs_client *fsc = s->s_fs_info; in ceph_set_super()
971 dout("set_super %p\n", s); in ceph_set_super()
973 s->s_maxbytes = MAX_LFS_FILESIZE; in ceph_set_super()
975 s->s_xattr = ceph_xattr_handlers; in ceph_set_super()
976 fsc->sb = s; in ceph_set_super()
977 fsc->max_file_size = 1ULL << 40; /* temp value until we get mdsmap */ in ceph_set_super()
979 s->s_op = &ceph_super_ops; in ceph_set_super()
980 s->s_d_op = &ceph_dentry_ops; in ceph_set_super()
981 s->s_export_op = &ceph_export_ops; in ceph_set_super()
983 s->s_time_gran = 1; in ceph_set_super()
984 s->s_time_min = 0; in ceph_set_super()
985 s->s_time_max = U32_MAX; in ceph_set_super()
989 fsc->sb = NULL; in ceph_set_super()
998 struct ceph_fs_client *new = fc->s_fs_info; in ceph_compare_super()
999 struct ceph_mount_options *fsopt = new->mount_options; in ceph_compare_super()
1000 struct ceph_options *opt = new->client->options; in ceph_compare_super()
1003 dout("ceph_compare_super %p\n", sb); in ceph_compare_super()
1006 dout("monitor(s)/mount options don't match\n"); in ceph_compare_super()
1009 if ((opt->flags & CEPH_OPT_FSID) && in ceph_compare_super()
1010 ceph_fsid_compare(&opt->fsid, &fsc->client->fsid)) { in ceph_compare_super()
1011 dout("fsid doesn't match\n"); in ceph_compare_super()
1014 if (fc->sb_flags != (sb->s_flags & ~SB_BORN)) { in ceph_compare_super()
1015 dout("flags differ\n"); in ceph_compare_super()
1019 if (fsc->blocklisted && !ceph_test_mount_opt(fsc, CLEANRECOVER)) { in ceph_compare_super()
1020 dout("client is blocklisted (and CLEANRECOVER is not set)\n"); in ceph_compare_super()
1024 if (fsc->mount_state == CEPH_MOUNT_SHUTDOWN) { in ceph_compare_super()
1025 dout("client has been forcibly unmounted\n"); in ceph_compare_super()
1041 err = super_setup_bdi_name(sb, "ceph-%ld", in ceph_setup_bdi()
1047 sb->s_bdi->ra_pages = fsc->mount_options->rasize >> PAGE_SHIFT; in ceph_setup_bdi()
1050 sb->s_bdi->io_pages = fsc->mount_options->rsize >> PAGE_SHIFT; in ceph_setup_bdi()
1057 struct ceph_parse_opts_ctx *pctx = fc->fs_private; in ceph_get_tree()
1065 dout("ceph_get_tree\n"); in ceph_get_tree()
1067 if (!fc->source) in ceph_get_tree()
1071 fsc = create_fs_client(pctx->opts, pctx->copts); in ceph_get_tree()
1072 pctx->opts = NULL; in ceph_get_tree()
1073 pctx->copts = NULL; in ceph_get_tree()
1083 if (ceph_test_opt(fsc->client, NOSHARE)) in ceph_get_tree()
1086 fc->s_fs_info = fsc; in ceph_get_tree()
1088 fc->s_fs_info = NULL; in ceph_get_tree()
1097 dout("get_sb got existing client %p\n", fsc); in ceph_get_tree()
1099 dout("get_sb using new client %p\n", fsc); in ceph_get_tree()
1110 dout("root %p inode %p ino %llx.%llx\n", res, in ceph_get_tree()
1112 fc->root = fsc->sb->s_root; in ceph_get_tree()
1116 if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) { in ceph_get_tree()
1118 err = -EHOSTUNREACH; in ceph_get_tree()
1121 ceph_mdsc_close_sessions(fsc->mdsc); in ceph_get_tree()
1128 dout("ceph_get_tree fail %d\n", err); in ceph_get_tree()
1134 struct ceph_parse_opts_ctx *pctx = fc->fs_private; in ceph_free_fc()
1137 destroy_mount_options(pctx->opts); in ceph_free_fc()
1138 ceph_destroy_options(pctx->copts); in ceph_free_fc()
1145 struct ceph_parse_opts_ctx *pctx = fc->fs_private; in ceph_reconfigure_fc()
1146 struct ceph_mount_options *fsopt = pctx->opts; in ceph_reconfigure_fc()
1147 struct ceph_fs_client *fsc = ceph_sb_to_client(fc->root->d_sb); in ceph_reconfigure_fc()
1149 if (fsopt->flags & CEPH_MOUNT_OPT_ASYNC_DIROPS) in ceph_reconfigure_fc()
1154 sync_filesystem(fc->root->d_sb); in ceph_reconfigure_fc()
1175 return -ENOMEM; in ceph_init_fs_context()
1177 pctx->copts = ceph_alloc_options(); in ceph_init_fs_context()
1178 if (!pctx->copts) in ceph_init_fs_context()
1181 pctx->opts = kzalloc(sizeof(*pctx->opts), GFP_KERNEL); in ceph_init_fs_context()
1182 if (!pctx->opts) in ceph_init_fs_context()
1185 fsopt = pctx->opts; in ceph_init_fs_context()
1186 fsopt->flags = CEPH_MOUNT_OPT_DEFAULT; in ceph_init_fs_context()
1188 fsopt->wsize = CEPH_MAX_WRITE_SIZE; in ceph_init_fs_context()
1189 fsopt->rsize = CEPH_MAX_READ_SIZE; in ceph_init_fs_context()
1190 fsopt->rasize = CEPH_RASIZE_DEFAULT; in ceph_init_fs_context()
1191 fsopt->snapdir_name = kstrdup(CEPH_SNAPDIRNAME_DEFAULT, GFP_KERNEL); in ceph_init_fs_context()
1192 if (!fsopt->snapdir_name) in ceph_init_fs_context()
1195 fsopt->caps_wanted_delay_min = CEPH_CAPS_WANTED_DELAY_MIN_DEFAULT; in ceph_init_fs_context()
1196 fsopt->caps_wanted_delay_max = CEPH_CAPS_WANTED_DELAY_MAX_DEFAULT; in ceph_init_fs_context()
1197 fsopt->max_readdir = CEPH_MAX_READDIR_DEFAULT; in ceph_init_fs_context()
1198 fsopt->max_readdir_bytes = CEPH_MAX_READDIR_BYTES_DEFAULT; in ceph_init_fs_context()
1199 fsopt->congestion_kb = default_congestion_kb(); in ceph_init_fs_context()
1202 fc->sb_flags |= SB_POSIXACL; in ceph_init_fs_context()
1205 fc->fs_private = pctx; in ceph_init_fs_context()
1206 fc->ops = &ceph_context_ops; in ceph_init_fs_context()
1210 destroy_mount_options(pctx->opts); in ceph_init_fs_context()
1211 ceph_destroy_options(pctx->copts); in ceph_init_fs_context()
1213 return -ENOMEM; in ceph_init_fs_context()
1220 dout("kill_sb %p\n", s); in ceph_kill_sb()
1222 ceph_mdsc_pre_umount(fsc->mdsc); in ceph_kill_sb()
1233 fsc->mdsc->stopping = CEPH_MDSC_STOPPING_FLUSHED; in ceph_kill_sb()
1237 fsc->client->extra_mon_dispatch = NULL; in ceph_kill_sb()
1263 flush_workqueue(fsc->inode_wq); in ceph_force_reconnect()
1267 ceph_reset_client_addr(fsc->client); in ceph_force_reconnect()
1269 ceph_osdc_clear_abort_err(&fsc->client->osdc); in ceph_force_reconnect()
1271 fsc->blocklisted = false; in ceph_force_reconnect()
1272 fsc->mount_state = CEPH_MOUNT_MOUNTED; in ceph_force_reconnect()
1274 if (sb->s_root) { in ceph_force_reconnect()
1275 err = __ceph_do_getattr(d_inode(sb->s_root), NULL, in ceph_force_reconnect()
1304 dout("exit_ceph\n"); in exit_ceph()
1323 metric_schedule_delayed(&fsc->mdsc->metric); in param_set_metrics()
1338 MODULE_PARM_DESC(disable_send_metrics, "Enable sending perf metrics to ceph cluster (default: on)");