Lines Matching +full:realm +full:-

1 /* SPDX-License-Identifier: GPL-2.0 */
9 #include <linux/backing-dev.h>
29 * large volume sizes on 32-bit machines. */
44 #define CEPH_MOUNT_OPT_NOCOPYFROM (1<<14) /* don't use RADOS 'copy-from' op */
55 (fsc)->mount_options->flags |= CEPH_MOUNT_OPT_##opt
57 (fsc)->mount_options->flags &= ~CEPH_MOUNT_OPT_##opt
59 (!!((fsc)->mount_options->flags & CEPH_MOUNT_OPT_##opt))
173 * Each cap is referenced by the inode's i_caps rbtree and by per-mds
178 struct rb_node ci_node; /* per-ci cap tree */
180 struct list_head session_caps; /* per-session caplist */
183 /* in-use caps */
219 * we first complete any in-process sync writes and writeback any dirty
253 if (refcount_dec_and_test(&capsnap->nref)) { in ceph_put_cap_snap()
254 if (capsnap->xattr_blob) in ceph_put_cap_snap()
255 ceph_buffer_put(capsnap->xattr_blob); in ceph_put_cap_snap()
278 int mds; /* -1 if same authority as parent */
331 * blob->vec.iov_len == 4 implies there are no xattrs; blob ==
383 /* capabilities. protected _both_ by i_ceph_lock and cap->session's
391 * is protected by the mdsc->cap_dirty_lock, but each individual item
393 * requires the mdsc->cap_dirty_lock. List presence for an item can
402 * or msdc->cap_dirty_lock. List presence can also be checked while
407 /* we need to track cap writeback on a per-cap-bit basis, to allow
454 struct ceph_snap_realm *i_snap_realm; /* snap realm (if caps) */
455 struct ceph_snapid_map *i_snapid_map; /* snapid -> dev_t */
495 return (struct ceph_fs_client *)inode->i_sb->s_fs_info; in ceph_inode_to_fs_client()
501 return (struct ceph_fs_client *)sb->s_fs_info; in ceph_sb_to_fs_client()
507 return (struct ceph_mds_client *)ceph_sb_to_fs_client(sb)->mdsc; in ceph_sb_to_mdsc()
513 return (struct ceph_client *)ceph_inode_to_fs_client(inode)->client; in ceph_inode_to_client()
519 return ceph_inode(inode)->i_vino; in ceph_vino()
532 * Inode numbers in cephfs are 64 bits, but inode->i_ino is 32-bits on
544 /* for printf-style formatting */
545 #define ceph_vinop(i) ceph_inode(i)->i_vino.ino, ceph_inode(i)->i_vino.snap
549 return ceph_inode(inode)->i_vino.ino; in ceph_ino()
554 return ceph_inode(inode)->i_vino.snap; in ceph_snap()
558 * ceph_present_ino - format an inode number for presentation to userland
562 * If the user mounted with the ino32 option, then the 64-bit value needs
576 return ceph_present_ino(inode->i_sb, ceph_ino(inode)); in ceph_present_inode()
583 return ci->i_vino.ino == pvino->ino && in ceph_ino_compare()
584 ci->i_vino.snap == pvino->snap; in ceph_ino_compare()
622 * 32-bits first. Just use low-order bits on arches with 32-bit long. in ceph_find_inode()
666 if (!(READ_ONCE(ci->i_ceph_flags) & CEPH_I_ERROR_WRITE)) { in ceph_set_error_write()
667 spin_lock(&ci->i_ceph_lock); in ceph_set_error_write()
668 ci->i_ceph_flags |= CEPH_I_ERROR_WRITE; in ceph_set_error_write()
669 spin_unlock(&ci->i_ceph_lock); in ceph_set_error_write()
675 if (READ_ONCE(ci->i_ceph_flags) & CEPH_I_ERROR_WRITE) { in ceph_clear_error_write()
676 spin_lock(&ci->i_ceph_lock); in ceph_clear_error_write()
677 ci->i_ceph_flags &= ~CEPH_I_ERROR_WRITE; in ceph_clear_error_write()
678 spin_unlock(&ci->i_ceph_lock); in ceph_clear_error_write()
692 atomic64_set(&ci->i_complete_seq[0], release_count); in __ceph_dir_set_complete()
693 atomic64_set(&ci->i_complete_seq[1], ordered_count); in __ceph_dir_set_complete()
698 atomic64_inc(&ci->i_release_count); in __ceph_dir_clear_complete()
703 atomic64_inc(&ci->i_ordered_count); in __ceph_dir_clear_ordered()
708 return atomic64_read(&ci->i_complete_seq[0]) == in __ceph_dir_is_complete()
709 atomic64_read(&ci->i_release_count); in __ceph_dir_is_complete()
714 return atomic64_read(&ci->i_complete_seq[0]) == in __ceph_dir_is_complete_ordered()
715 atomic64_read(&ci->i_release_count) && in __ceph_dir_is_complete_ordered()
716 atomic64_read(&ci->i_complete_seq[1]) == in __ceph_dir_is_complete_ordered()
717 atomic64_read(&ci->i_ordered_count); in __ceph_dir_is_complete_ordered()
751 return (struct ceph_dentry_info *)dentry->d_fsdata; in ceph_dentry()
759 return !RB_EMPTY_ROOT(&ci->i_caps); in __ceph_is_any_real_caps()
772 spin_lock(&ci->i_ceph_lock); in ceph_caps_issued()
774 spin_unlock(&ci->i_ceph_lock); in ceph_caps_issued()
782 spin_lock(&ci->i_ceph_lock); in ceph_caps_issued_mask_metric()
784 spin_unlock(&ci->i_ceph_lock); in ceph_caps_issued_mask_metric()
790 return ci->i_dirty_caps | ci->i_flushing_caps; in __ceph_caps_dirty()
803 return ci->i_nr_by_mode[0]; in __ceph_is_file_opened()
828 * we keep buffered readdir results attached to file->private_data
857 /* used for -o dirstat read() on directory thing */
877 spin_lock(&cf->rw_contexts_lock); in ceph_add_rw_context()
878 list_add(&ctx->list, &cf->rw_contexts); in ceph_add_rw_context()
879 spin_unlock(&cf->rw_contexts_lock); in ceph_add_rw_context()
885 spin_lock(&cf->rw_contexts_lock); in ceph_del_rw_context()
886 list_del(&ctx->list); in ceph_del_rw_context()
887 spin_unlock(&cf->rw_contexts_lock); in ceph_del_rw_context()
894 spin_lock(&cf->rw_contexts_lock); in ceph_find_rw_context()
895 list_for_each_entry(ctx, &cf->rw_contexts, list) { in ceph_find_rw_context()
896 if (ctx->thread == current) { in ceph_find_rw_context()
901 spin_unlock(&cf->rw_contexts_lock); in ceph_find_rw_context()
912 * A "snap realm" describes a subset of the file hierarchy sharing
917 * All inodes within the realm that have capabilities are linked into a
918 * per-realm list.
932 u64 *snaps; /* snaps specific to this realm */
941 struct list_head dirty_item; /* if realm needs new context */
945 /* the current set of snaps for this realm */
974 congestion_kb = (16*int_sqrt(totalram_pages())) << (PAGE_SHIFT-10); in default_congestion_kb()
988 struct ceph_snap_realm *realm);
990 struct ceph_snap_realm *realm);
994 void ceph_change_snap_realm(struct inode *inode, struct ceph_snap_realm *realm);
1012 * a cap_snap is "pending" if it is still awaiting an in-progress
1017 return !list_empty(&ci->i_cap_snaps) && in __ceph_have_pending_cap_snap()
1018 list_last_entry(&ci->i_cap_snaps, struct ceph_cap_snap, in __ceph_have_pending_cap_snap()
1019 ci_item)->writing; in __ceph_have_pending_cap_snap()
1113 unsigned long flags = READ_ONCE(ceph_inode(inode)->i_ceph_flags); in ceph_inode_is_shutdown()
1115 int state = READ_ONCE(fsc->mount_state); in ceph_inode_is_shutdown()
1297 if (ci->i_inline_version == CEPH_INLINE_NONE || in ceph_has_inline_data()
1298 ci->i_inline_version == 1) /* initial version, no data */ in ceph_has_inline_data()
1377 has_quota = !!ci->i_max_bytes; in __ceph_has_quota()
1380 has_quota = !!ci->i_max_files; in __ceph_has_quota()
1383 has_quota = !!(ci->i_max_files || ci->i_max_bytes); in __ceph_has_quota()
1395 ci->i_max_bytes = max_bytes; in __ceph_update_quota()
1396 ci->i_max_files = max_files; in __ceph_update_quota()
1400 ceph_adjust_quota_realms_count(&ci->netfs.inode, has_quota); in __ceph_update_quota()