Lines Matching refs:ci
47 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_set_ino_cb() local
50 ci->i_vino = *(struct ceph_vino *)data; in ceph_set_ino_cb()
51 inode->i_ino = ceph_vino_to_ino_t(ci->i_vino); in ceph_set_ino_cb()
167 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_get_snapdir() local
191 ci->i_rbytes = 0; in ceph_get_snapdir()
192 ci->i_btime = ceph_inode(parent)->i_btime; in ceph_get_snapdir()
199 ci->fscrypt_auth = kmemdup(pci->fscrypt_auth, in ceph_get_snapdir()
202 if (ci->fscrypt_auth) { in ceph_get_snapdir()
204 ci->fscrypt_auth_len = pci->fscrypt_auth_len; in ceph_get_snapdir()
215 ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ in ceph_get_snapdir()
249 static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci, in __get_or_create_frag() argument
257 p = &ci->i_fragtree.rb_node; in __get_or_create_frag()
280 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
283 ceph_vinop(&ci->netfs.inode), f); in __get_or_create_frag()
290 struct ceph_inode_frag *__ceph_find_frag(struct ceph_inode_info *ci, u32 f) in __ceph_find_frag() argument
292 struct rb_node *n = ci->i_fragtree.rb_node; in __ceph_find_frag()
313 static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in __ceph_choose_frag() argument
326 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
355 u32 ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in ceph_choose_frag() argument
359 mutex_lock(&ci->i_fragtree_mutex); in ceph_choose_frag()
360 ret = __ceph_choose_frag(ci, v, pfrag, found); in ceph_choose_frag()
361 mutex_unlock(&ci->i_fragtree_mutex); in ceph_choose_frag()
373 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_dirfrag() local
382 spin_lock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
383 if (ci->i_auth_cap) in ceph_fill_dirfrag()
384 diri_auth = ci->i_auth_cap->mds; in ceph_fill_dirfrag()
385 spin_unlock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
390 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
393 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
400 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
414 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
432 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
457 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_fragtree() local
464 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
466 if (nsplits != ci->i_fragtree_nsplits) { in ceph_fill_fragtree()
471 if (!__ceph_find_frag(ci, id)) in ceph_fill_fragtree()
473 } else if (!RB_EMPTY_ROOT(&ci->i_fragtree)) { in ceph_fill_fragtree()
474 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
481 if (id != __ceph_choose_frag(ci, id, NULL, NULL)) in ceph_fill_fragtree()
493 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
517 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
519 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
525 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
530 ci->i_fragtree_nsplits++; in ceph_fill_fragtree()
541 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
543 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
548 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
557 struct ceph_inode_info *ci; in ceph_alloc_inode() local
560 ci = alloc_inode_sb(sb, ceph_inode_cachep, GFP_NOFS); in ceph_alloc_inode()
561 if (!ci) in ceph_alloc_inode()
564 dout("alloc_inode %p\n", &ci->netfs.inode); in ceph_alloc_inode()
567 netfs_inode_init(&ci->netfs, &ceph_netfs_ops); in ceph_alloc_inode()
569 spin_lock_init(&ci->i_ceph_lock); in ceph_alloc_inode()
571 ci->i_version = 0; in ceph_alloc_inode()
572 ci->i_inline_version = 0; in ceph_alloc_inode()
573 ci->i_time_warp_seq = 0; in ceph_alloc_inode()
574 ci->i_ceph_flags = 0; in ceph_alloc_inode()
575 atomic64_set(&ci->i_ordered_count, 1); in ceph_alloc_inode()
576 atomic64_set(&ci->i_release_count, 1); in ceph_alloc_inode()
577 atomic64_set(&ci->i_complete_seq[0], 0); in ceph_alloc_inode()
578 atomic64_set(&ci->i_complete_seq[1], 0); in ceph_alloc_inode()
579 ci->i_symlink = NULL; in ceph_alloc_inode()
581 ci->i_max_bytes = 0; in ceph_alloc_inode()
582 ci->i_max_files = 0; in ceph_alloc_inode()
584 memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); in ceph_alloc_inode()
585 memset(&ci->i_cached_layout, 0, sizeof(ci->i_cached_layout)); in ceph_alloc_inode()
586 RCU_INIT_POINTER(ci->i_layout.pool_ns, NULL); in ceph_alloc_inode()
588 ci->i_fragtree = RB_ROOT; in ceph_alloc_inode()
589 mutex_init(&ci->i_fragtree_mutex); in ceph_alloc_inode()
591 ci->i_xattrs.blob = NULL; in ceph_alloc_inode()
592 ci->i_xattrs.prealloc_blob = NULL; in ceph_alloc_inode()
593 ci->i_xattrs.dirty = false; in ceph_alloc_inode()
594 ci->i_xattrs.index = RB_ROOT; in ceph_alloc_inode()
595 ci->i_xattrs.count = 0; in ceph_alloc_inode()
596 ci->i_xattrs.names_size = 0; in ceph_alloc_inode()
597 ci->i_xattrs.vals_size = 0; in ceph_alloc_inode()
598 ci->i_xattrs.version = 0; in ceph_alloc_inode()
599 ci->i_xattrs.index_version = 0; in ceph_alloc_inode()
601 ci->i_caps = RB_ROOT; in ceph_alloc_inode()
602 ci->i_auth_cap = NULL; in ceph_alloc_inode()
603 ci->i_dirty_caps = 0; in ceph_alloc_inode()
604 ci->i_flushing_caps = 0; in ceph_alloc_inode()
605 INIT_LIST_HEAD(&ci->i_dirty_item); in ceph_alloc_inode()
606 INIT_LIST_HEAD(&ci->i_flushing_item); in ceph_alloc_inode()
607 ci->i_prealloc_cap_flush = NULL; in ceph_alloc_inode()
608 INIT_LIST_HEAD(&ci->i_cap_flush_list); in ceph_alloc_inode()
609 init_waitqueue_head(&ci->i_cap_wq); in ceph_alloc_inode()
610 ci->i_hold_caps_max = 0; in ceph_alloc_inode()
611 INIT_LIST_HEAD(&ci->i_cap_delay_list); in ceph_alloc_inode()
612 INIT_LIST_HEAD(&ci->i_cap_snaps); in ceph_alloc_inode()
613 ci->i_head_snapc = NULL; in ceph_alloc_inode()
614 ci->i_snap_caps = 0; in ceph_alloc_inode()
616 ci->i_last_rd = ci->i_last_wr = jiffies - 3600 * HZ; in ceph_alloc_inode()
618 ci->i_nr_by_mode[i] = 0; in ceph_alloc_inode()
620 mutex_init(&ci->i_truncate_mutex); in ceph_alloc_inode()
621 ci->i_truncate_seq = 0; in ceph_alloc_inode()
622 ci->i_truncate_size = 0; in ceph_alloc_inode()
623 ci->i_truncate_pending = 0; in ceph_alloc_inode()
624 ci->i_truncate_pagecache_size = 0; in ceph_alloc_inode()
626 ci->i_max_size = 0; in ceph_alloc_inode()
627 ci->i_reported_size = 0; in ceph_alloc_inode()
628 ci->i_wanted_max_size = 0; in ceph_alloc_inode()
629 ci->i_requested_max_size = 0; in ceph_alloc_inode()
631 ci->i_pin_ref = 0; in ceph_alloc_inode()
632 ci->i_rd_ref = 0; in ceph_alloc_inode()
633 ci->i_rdcache_ref = 0; in ceph_alloc_inode()
634 ci->i_wr_ref = 0; in ceph_alloc_inode()
635 ci->i_wb_ref = 0; in ceph_alloc_inode()
636 ci->i_fx_ref = 0; in ceph_alloc_inode()
637 ci->i_wrbuffer_ref = 0; in ceph_alloc_inode()
638 ci->i_wrbuffer_ref_head = 0; in ceph_alloc_inode()
639 atomic_set(&ci->i_filelock_ref, 0); in ceph_alloc_inode()
640 atomic_set(&ci->i_shared_gen, 1); in ceph_alloc_inode()
641 ci->i_rdcache_gen = 0; in ceph_alloc_inode()
642 ci->i_rdcache_revoking = 0; in ceph_alloc_inode()
644 INIT_LIST_HEAD(&ci->i_unsafe_dirops); in ceph_alloc_inode()
645 INIT_LIST_HEAD(&ci->i_unsafe_iops); in ceph_alloc_inode()
646 spin_lock_init(&ci->i_unsafe_lock); in ceph_alloc_inode()
648 ci->i_snap_realm = NULL; in ceph_alloc_inode()
649 INIT_LIST_HEAD(&ci->i_snap_realm_item); in ceph_alloc_inode()
650 INIT_LIST_HEAD(&ci->i_snap_flush_item); in ceph_alloc_inode()
652 INIT_WORK(&ci->i_work, ceph_inode_work); in ceph_alloc_inode()
653 ci->i_work_mask = 0; in ceph_alloc_inode()
654 memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); in ceph_alloc_inode()
656 ci->fscrypt_auth = NULL; in ceph_alloc_inode()
657 ci->fscrypt_auth_len = 0; in ceph_alloc_inode()
659 return &ci->netfs.inode; in ceph_alloc_inode()
664 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_free_inode() local
666 kfree(ci->i_symlink); in ceph_free_inode()
668 kfree(ci->fscrypt_auth); in ceph_free_inode()
671 kmem_cache_free(ceph_inode_cachep, ci); in ceph_free_inode()
676 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_evict_inode() local
690 ceph_fscache_unregister_inode_cookie(ci); in ceph_evict_inode()
693 __ceph_remove_caps(ci); in ceph_evict_inode()
695 if (__ceph_has_quota(ci, QUOTA_GET_ANY)) in ceph_evict_inode()
702 if (ci->i_snap_realm) { in ceph_evict_inode()
705 ci->i_snap_realm); in ceph_evict_inode()
708 ceph_put_snapid_map(mdsc, ci->i_snapid_map); in ceph_evict_inode()
709 ci->i_snap_realm = NULL; in ceph_evict_inode()
713 while ((n = rb_first(&ci->i_fragtree)) != NULL) { in ceph_evict_inode()
715 rb_erase(n, &ci->i_fragtree); in ceph_evict_inode()
718 ci->i_fragtree_nsplits = 0; in ceph_evict_inode()
720 __ceph_destroy_xattrs(ci); in ceph_evict_inode()
721 if (ci->i_xattrs.blob) in ceph_evict_inode()
722 ceph_buffer_put(ci->i_xattrs.blob); in ceph_evict_inode()
723 if (ci->i_xattrs.prealloc_blob) in ceph_evict_inode()
724 ceph_buffer_put(ci->i_xattrs.prealloc_blob); in ceph_evict_inode()
726 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns)); in ceph_evict_inode()
727 ceph_put_string(rcu_dereference_raw(ci->i_cached_layout.pool_ns)); in ceph_evict_inode()
746 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_size() local
750 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) > 0 || in ceph_fill_file_size()
751 (truncate_seq == ci->i_truncate_seq && size > isize)) { in ceph_fill_file_size()
765 ci->i_reported_size = size; in ceph_fill_file_size()
766 if (truncate_seq != ci->i_truncate_seq) { in ceph_fill_file_size()
768 ci->i_truncate_seq, truncate_seq); in ceph_fill_file_size()
769 ci->i_truncate_seq = truncate_seq; in ceph_fill_file_size()
783 __ceph_is_file_opened(ci)) { in ceph_fill_file_size()
784 ci->i_truncate_pending++; in ceph_fill_file_size()
796 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) >= 0) { in ceph_fill_file_size()
798 ci->i_truncate_size, truncate_size, !!IS_ENCRYPTED(inode)); in ceph_fill_file_size()
800 ci->i_truncate_size = truncate_size; in ceph_fill_file_size()
804 __func__, ci->i_truncate_pagecache_size, size); in ceph_fill_file_size()
805 ci->i_truncate_pagecache_size = size; in ceph_fill_file_size()
807 ci->i_truncate_pagecache_size = truncate_size; in ceph_fill_file_size()
817 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_time() local
826 if (ci->i_version == 0 || in ceph_fill_file_time()
833 if (ci->i_version == 0 || in ceph_fill_file_time()
834 ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { in ceph_fill_file_time()
840 ci->i_time_warp_seq, (int)time_warp_seq); in ceph_fill_file_time()
844 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
845 } else if (time_warp_seq == ci->i_time_warp_seq) { in ceph_fill_file_time()
868 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { in ceph_fill_file_time()
872 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
879 inode, time_warp_seq, ci->i_time_warp_seq); in ceph_fill_file_time()
922 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_inode() local
941 ci->i_version); in ceph_fill_inode()
987 if (ceph_snap(inode) != CEPH_NOSNAP && !ci->i_snapid_map) in ceph_fill_inode()
988 ci->i_snapid_map = ceph_get_snapid_map(mdsc, ceph_snap(inode)); in ceph_fill_inode()
990 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
1003 if (ci->i_version == 0 || in ceph_fill_inode()
1005 le64_to_cpu(info->version) > (ci->i_version & ~1))) in ceph_fill_inode()
1011 __ceph_caps_issued(ci, &issued); in ceph_fill_inode()
1012 issued |= __ceph_caps_dirty(ci); in ceph_fill_inode()
1015 __ceph_update_quota(ci, iinfo->max_bytes, iinfo->max_files); in ceph_fill_inode()
1019 ((inode->i_state & I_NEW) || (ci->fscrypt_auth_len == 0))) { in ceph_fill_inode()
1020 kfree(ci->fscrypt_auth); in ceph_fill_inode()
1021 ci->fscrypt_auth_len = iinfo->fscrypt_auth_len; in ceph_fill_inode()
1022 ci->fscrypt_auth = iinfo->fscrypt_auth; in ceph_fill_inode()
1037 ceph_decode_timespec64(&ci->i_btime, &iinfo->btime); in ceph_fill_inode()
1038 ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); in ceph_fill_inode()
1065 ci->i_files = le64_to_cpu(info->files); in ceph_fill_inode()
1066 ci->i_subdirs = le64_to_cpu(info->subdirs); in ceph_fill_inode()
1072 s64 old_pool = ci->i_layout.pool_id; in ceph_fill_inode()
1075 ceph_file_layout_from_legacy(&ci->i_layout, &info->layout); in ceph_fill_inode()
1076 old_ns = rcu_dereference_protected(ci->i_layout.pool_ns, in ceph_fill_inode()
1077 lockdep_is_held(&ci->i_ceph_lock)); in ceph_fill_inode()
1078 rcu_assign_pointer(ci->i_layout.pool_ns, pool_ns); in ceph_fill_inode()
1080 if (ci->i_layout.pool_id != old_pool || pool_ns != old_ns) in ceph_fill_inode()
1081 ci->i_ceph_flags &= ~CEPH_I_POOL_PERM; in ceph_fill_inode()
1103 ci->i_max_size != le64_to_cpu(info->max_size)) { in ceph_fill_inode()
1104 dout("max_size %lld -> %llu\n", ci->i_max_size, in ceph_fill_inode()
1106 ci->i_max_size = le64_to_cpu(info->max_size); in ceph_fill_inode()
1114 ci->i_dir_layout = iinfo->dir_layout; in ceph_fill_inode()
1115 ci->i_rbytes = le64_to_cpu(info->rbytes); in ceph_fill_inode()
1116 ci->i_rfiles = le64_to_cpu(info->rfiles); in ceph_fill_inode()
1117 ci->i_rsubdirs = le64_to_cpu(info->rsubdirs); in ceph_fill_inode()
1118 ci->i_dir_pin = iinfo->dir_pin; in ceph_fill_inode()
1119 ci->i_rsnaps = iinfo->rsnaps; in ceph_fill_inode()
1120 ceph_decode_timespec64(&ci->i_rctime, &info->rctime); in ceph_fill_inode()
1126 if ((ci->i_xattrs.version == 0 || !(issued & CEPH_CAP_XATTR_EXCL)) && in ceph_fill_inode()
1127 le64_to_cpu(info->xattr_version) > ci->i_xattrs.version) { in ceph_fill_inode()
1128 if (ci->i_xattrs.blob) in ceph_fill_inode()
1129 old_blob = ci->i_xattrs.blob; in ceph_fill_inode()
1130 ci->i_xattrs.blob = xattr_blob; in ceph_fill_inode()
1132 memcpy(ci->i_xattrs.blob->vec.iov_base, in ceph_fill_inode()
1134 ci->i_xattrs.version = le64_to_cpu(info->xattr_version); in ceph_fill_inode()
1141 if (le64_to_cpu(info->version) > ci->i_version) in ceph_fill_inode()
1142 ci->i_version = le64_to_cpu(info->version); in ceph_fill_inode()
1160 if (!ci->i_symlink) { in ceph_fill_inode()
1164 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
1197 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
1198 if (!ci->i_symlink) in ceph_fill_inode()
1199 ci->i_symlink = sym; in ceph_fill_inode()
1211 inode->i_link = ci->i_symlink; in ceph_fill_inode()
1238 ci->i_files == 0 && ci->i_subdirs == 0 && in ceph_fill_inode()
1241 !__ceph_dir_is_complete(ci)) { in ceph_fill_inode()
1244 __ceph_dir_set_complete(ci, in ceph_fill_inode()
1245 atomic64_read(&ci->i_release_count), in ceph_fill_inode()
1246 atomic64_read(&ci->i_ordered_count)); in ceph_fill_inode()
1253 ci->i_snap_caps |= info_caps; in ceph_fill_inode()
1258 iinfo->inline_version >= ci->i_inline_version) { in ceph_fill_inode()
1260 ci->i_inline_version = iinfo->inline_version; in ceph_fill_inode()
1261 if (ceph_has_inline_data(ci) && in ceph_fill_inode()
1270 __ceph_touch_fmode(ci, mdsc, cap_fmode); in ceph_fill_inode()
1273 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
1282 wake_up_all(&ci->i_cap_wq); in ceph_fill_inode()
1828 struct ceph_inode_info *ci = ceph_inode(dir); in fill_readdir_cache() local
1851 if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) && in fill_readdir_cache()
1852 req->r_dir_ordered_cnt == atomic64_read(&ci->i_ordered_count)) { in fill_readdir_cache()
1868 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_readdir_prepopulate() local
1884 last_hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1919 atomic64_read(&ci->i_release_count); in ceph_readdir_prepopulate()
1921 atomic64_read(&ci->i_ordered_count); in ceph_readdir_prepopulate()
1980 atomic_read(&ci->i_shared_gen)) { in ceph_readdir_prepopulate()
1981 __ceph_dir_clear_ordered(ci); in ceph_readdir_prepopulate()
2064 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_set_size() local
2067 spin_lock(&ci->i_ceph_lock); in ceph_inode_set_size()
2073 ret = __ceph_should_report_size(ci); in ceph_inode_set_size()
2075 spin_unlock(&ci->i_ceph_lock); in ceph_inode_set_size()
2083 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_inode_work() local
2084 set_bit(work_bit, &ci->i_work_mask); in ceph_queue_inode_work()
2087 if (queue_work(fsc->inode_wq, &ci->i_work)) { in ceph_queue_inode_work()
2088 dout("queue_inode_work %p, mask=%lx\n", inode, ci->i_work_mask); in ceph_queue_inode_work()
2091 inode, ci->i_work_mask); in ceph_queue_inode_work()
2098 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_do_invalidate_pages() local
2104 mutex_lock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
2111 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
2115 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
2117 ci->i_rdcache_gen, ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
2118 if (ci->i_rdcache_revoking != ci->i_rdcache_gen) { in ceph_do_invalidate_pages()
2119 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
2121 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
2122 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
2125 orig_gen = ci->i_rdcache_gen; in ceph_do_invalidate_pages()
2126 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
2133 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
2134 if (orig_gen == ci->i_rdcache_gen && in ceph_do_invalidate_pages()
2135 orig_gen == ci->i_rdcache_revoking) { in ceph_do_invalidate_pages()
2137 ci->i_rdcache_gen); in ceph_do_invalidate_pages()
2138 ci->i_rdcache_revoking--; in ceph_do_invalidate_pages()
2142 inode, orig_gen, ci->i_rdcache_gen, in ceph_do_invalidate_pages()
2143 ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
2144 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
2147 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
2148 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
2151 ceph_check_caps(ci, 0); in ceph_do_invalidate_pages()
2160 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_do_pending_vmtruncate() local
2164 mutex_lock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
2166 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2167 if (ci->i_truncate_pending == 0) { in __ceph_do_pending_vmtruncate()
2169 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2170 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
2178 if (ci->i_wrbuffer_ref_head < ci->i_wrbuffer_ref) { in __ceph_do_pending_vmtruncate()
2179 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2187 WARN_ON_ONCE(ci->i_rd_ref || ci->i_wr_ref); in __ceph_do_pending_vmtruncate()
2189 to = ci->i_truncate_pagecache_size; in __ceph_do_pending_vmtruncate()
2190 wrbuffer_refs = ci->i_wrbuffer_ref; in __ceph_do_pending_vmtruncate()
2192 ci->i_truncate_pending, to); in __ceph_do_pending_vmtruncate()
2193 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2198 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2199 if (to == ci->i_truncate_pagecache_size) { in __ceph_do_pending_vmtruncate()
2200 ci->i_truncate_pending = 0; in __ceph_do_pending_vmtruncate()
2203 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
2207 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
2210 ceph_check_caps(ci, 0); in __ceph_do_pending_vmtruncate()
2212 wake_up_all(&ci->i_cap_wq); in __ceph_do_pending_vmtruncate()
2217 struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info, in ceph_inode_work() local
2219 struct inode *inode = &ci->netfs.inode; in ceph_inode_work()
2221 if (test_and_clear_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask)) { in ceph_inode_work()
2225 if (test_and_clear_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask)) in ceph_inode_work()
2228 if (test_and_clear_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask)) in ceph_inode_work()
2231 if (test_and_clear_bit(CEPH_I_WORK_CHECK_CAPS, &ci->i_work_mask)) in ceph_inode_work()
2232 ceph_check_caps(ci, 0); in ceph_inode_work()
2234 if (test_and_clear_bit(CEPH_I_WORK_FLUSH_SNAPS, &ci->i_work_mask)) in ceph_inode_work()
2235 ceph_flush_snaps(ci, NULL); in ceph_inode_work()
2244 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_encrypted_get_link() local
2249 return fscrypt_get_symlink(inode, ci->i_symlink, i_size_read(inode), in ceph_encrypted_get_link()
2294 struct ceph_inode_info *ci = ceph_inode(inode); in fill_fscrypt_truncate() local
2314 issued = __ceph_caps_issued(ci, NULL); in fill_fscrypt_truncate()
2414 ceph_put_cap_refs(ci, got); in fill_fscrypt_truncate()
2427 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_setattr() local
2455 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2456 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2458 if (!ci->i_head_snapc && in __ceph_setattr()
2462 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2464 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2465 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2476 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2481 ceph_vinop(inode), ci->fscrypt_auth_len, len); in __ceph_setattr()
2484 WARN_ON_ONCE(ci->fscrypt_auth); in __ceph_setattr()
2488 kfree(ci->fscrypt_auth); in __ceph_setattr()
2489 ci->fscrypt_auth = (u8 *)cia->fscrypt_auth; in __ceph_setattr()
2490 ci->fscrypt_auth_len = len; in __ceph_setattr()
2492 ci->fscrypt_auth_len != len || in __ceph_setattr()
2493 memcmp(ci->fscrypt_auth, cia->fscrypt_auth, len)) { in __ceph_setattr()
2503 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2558 ci->i_time_warp_seq++; in __ceph_setattr()
2600 ci->i_reported_size = attr->ia_size; in __ceph_setattr()
2631 ci->i_time_warp_seq++; in __ceph_setattr()
2678 inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, in __ceph_setattr()
2685 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2965 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_getattr() local
2988 if (ci->i_btime.tv_sec || ci->i_btime.tv_nsec) { in ceph_getattr()
2989 stat->btime = ci->i_btime; in ceph_getattr()
3001 stat->dev = ci->i_snapid_map ? ci->i_snapid_map->dev : 0; in ceph_getattr()
3005 stat->size = ci->i_rbytes; in ceph_getattr()
3025 stat->size = ci->i_files + ci->i_subdirs; in ceph_getattr()
3036 stat->nlink = 1 + 1 + ci->i_subdirs; in ceph_getattr()
3051 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_shutdown() local
3056 spin_lock(&ci->i_ceph_lock); in ceph_inode_shutdown()
3057 ci->i_ceph_flags |= CEPH_I_SHUTDOWN; in ceph_inode_shutdown()
3058 p = rb_first(&ci->i_caps); in ceph_inode_shutdown()
3065 spin_unlock(&ci->i_ceph_lock); in ceph_inode_shutdown()