Lines Matching refs:ci
44 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_set_ino_cb() local
47 ci->i_vino = *(struct ceph_vino *)data; in ceph_set_ino_cb()
48 inode->i_ino = ceph_vino_to_ino_t(ci->i_vino); in ceph_set_ino_cb()
82 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_get_snapdir() local
105 ci->i_rbytes = 0; in ceph_get_snapdir()
106 ci->i_btime = ceph_inode(parent)->i_btime; in ceph_get_snapdir()
111 ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ in ceph_get_snapdir()
139 static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci, in __get_or_create_frag() argument
147 p = &ci->i_fragtree.rb_node; in __get_or_create_frag()
170 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
173 ceph_vinop(&ci->vfs_inode), f); in __get_or_create_frag()
180 struct ceph_inode_frag *__ceph_find_frag(struct ceph_inode_info *ci, u32 f) in __ceph_find_frag() argument
182 struct rb_node *n = ci->i_fragtree.rb_node; in __ceph_find_frag()
203 static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in __ceph_choose_frag() argument
216 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
245 u32 ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in ceph_choose_frag() argument
249 mutex_lock(&ci->i_fragtree_mutex); in ceph_choose_frag()
250 ret = __ceph_choose_frag(ci, v, pfrag, found); in ceph_choose_frag()
251 mutex_unlock(&ci->i_fragtree_mutex); in ceph_choose_frag()
263 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_dirfrag() local
272 spin_lock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
273 if (ci->i_auth_cap) in ceph_fill_dirfrag()
274 diri_auth = ci->i_auth_cap->mds; in ceph_fill_dirfrag()
275 spin_unlock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
280 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
283 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
290 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
304 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
322 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
347 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_fragtree() local
354 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
356 if (nsplits != ci->i_fragtree_nsplits) { in ceph_fill_fragtree()
361 if (!__ceph_find_frag(ci, id)) in ceph_fill_fragtree()
363 } else if (!RB_EMPTY_ROOT(&ci->i_fragtree)) { in ceph_fill_fragtree()
364 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
371 if (id != __ceph_choose_frag(ci, id, NULL, NULL)) in ceph_fill_fragtree()
383 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
407 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
409 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
415 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
420 ci->i_fragtree_nsplits++; in ceph_fill_fragtree()
431 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
433 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
438 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
447 struct ceph_inode_info *ci; in ceph_alloc_inode() local
450 ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS); in ceph_alloc_inode()
451 if (!ci) in ceph_alloc_inode()
454 dout("alloc_inode %p\n", &ci->vfs_inode); in ceph_alloc_inode()
456 spin_lock_init(&ci->i_ceph_lock); in ceph_alloc_inode()
458 ci->i_version = 0; in ceph_alloc_inode()
459 ci->i_inline_version = 0; in ceph_alloc_inode()
460 ci->i_time_warp_seq = 0; in ceph_alloc_inode()
461 ci->i_ceph_flags = 0; in ceph_alloc_inode()
462 atomic64_set(&ci->i_ordered_count, 1); in ceph_alloc_inode()
463 atomic64_set(&ci->i_release_count, 1); in ceph_alloc_inode()
464 atomic64_set(&ci->i_complete_seq[0], 0); in ceph_alloc_inode()
465 atomic64_set(&ci->i_complete_seq[1], 0); in ceph_alloc_inode()
466 ci->i_symlink = NULL; in ceph_alloc_inode()
468 ci->i_max_bytes = 0; in ceph_alloc_inode()
469 ci->i_max_files = 0; in ceph_alloc_inode()
471 memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); in ceph_alloc_inode()
472 memset(&ci->i_cached_layout, 0, sizeof(ci->i_cached_layout)); in ceph_alloc_inode()
473 RCU_INIT_POINTER(ci->i_layout.pool_ns, NULL); in ceph_alloc_inode()
475 ci->i_fragtree = RB_ROOT; in ceph_alloc_inode()
476 mutex_init(&ci->i_fragtree_mutex); in ceph_alloc_inode()
478 ci->i_xattrs.blob = NULL; in ceph_alloc_inode()
479 ci->i_xattrs.prealloc_blob = NULL; in ceph_alloc_inode()
480 ci->i_xattrs.dirty = false; in ceph_alloc_inode()
481 ci->i_xattrs.index = RB_ROOT; in ceph_alloc_inode()
482 ci->i_xattrs.count = 0; in ceph_alloc_inode()
483 ci->i_xattrs.names_size = 0; in ceph_alloc_inode()
484 ci->i_xattrs.vals_size = 0; in ceph_alloc_inode()
485 ci->i_xattrs.version = 0; in ceph_alloc_inode()
486 ci->i_xattrs.index_version = 0; in ceph_alloc_inode()
488 ci->i_caps = RB_ROOT; in ceph_alloc_inode()
489 ci->i_auth_cap = NULL; in ceph_alloc_inode()
490 ci->i_dirty_caps = 0; in ceph_alloc_inode()
491 ci->i_flushing_caps = 0; in ceph_alloc_inode()
492 INIT_LIST_HEAD(&ci->i_dirty_item); in ceph_alloc_inode()
493 INIT_LIST_HEAD(&ci->i_flushing_item); in ceph_alloc_inode()
494 ci->i_prealloc_cap_flush = NULL; in ceph_alloc_inode()
495 INIT_LIST_HEAD(&ci->i_cap_flush_list); in ceph_alloc_inode()
496 init_waitqueue_head(&ci->i_cap_wq); in ceph_alloc_inode()
497 ci->i_hold_caps_max = 0; in ceph_alloc_inode()
498 INIT_LIST_HEAD(&ci->i_cap_delay_list); in ceph_alloc_inode()
499 INIT_LIST_HEAD(&ci->i_cap_snaps); in ceph_alloc_inode()
500 ci->i_head_snapc = NULL; in ceph_alloc_inode()
501 ci->i_snap_caps = 0; in ceph_alloc_inode()
503 ci->i_last_rd = ci->i_last_wr = jiffies - 3600 * HZ; in ceph_alloc_inode()
505 ci->i_nr_by_mode[i] = 0; in ceph_alloc_inode()
507 mutex_init(&ci->i_truncate_mutex); in ceph_alloc_inode()
508 ci->i_truncate_seq = 0; in ceph_alloc_inode()
509 ci->i_truncate_size = 0; in ceph_alloc_inode()
510 ci->i_truncate_pending = 0; in ceph_alloc_inode()
512 ci->i_max_size = 0; in ceph_alloc_inode()
513 ci->i_reported_size = 0; in ceph_alloc_inode()
514 ci->i_wanted_max_size = 0; in ceph_alloc_inode()
515 ci->i_requested_max_size = 0; in ceph_alloc_inode()
517 ci->i_pin_ref = 0; in ceph_alloc_inode()
518 ci->i_rd_ref = 0; in ceph_alloc_inode()
519 ci->i_rdcache_ref = 0; in ceph_alloc_inode()
520 ci->i_wr_ref = 0; in ceph_alloc_inode()
521 ci->i_wb_ref = 0; in ceph_alloc_inode()
522 ci->i_fx_ref = 0; in ceph_alloc_inode()
523 ci->i_wrbuffer_ref = 0; in ceph_alloc_inode()
524 ci->i_wrbuffer_ref_head = 0; in ceph_alloc_inode()
525 atomic_set(&ci->i_filelock_ref, 0); in ceph_alloc_inode()
526 atomic_set(&ci->i_shared_gen, 1); in ceph_alloc_inode()
527 ci->i_rdcache_gen = 0; in ceph_alloc_inode()
528 ci->i_rdcache_revoking = 0; in ceph_alloc_inode()
530 INIT_LIST_HEAD(&ci->i_unsafe_dirops); in ceph_alloc_inode()
531 INIT_LIST_HEAD(&ci->i_unsafe_iops); in ceph_alloc_inode()
532 spin_lock_init(&ci->i_unsafe_lock); in ceph_alloc_inode()
534 ci->i_snap_realm = NULL; in ceph_alloc_inode()
535 INIT_LIST_HEAD(&ci->i_snap_realm_item); in ceph_alloc_inode()
536 INIT_LIST_HEAD(&ci->i_snap_flush_item); in ceph_alloc_inode()
538 INIT_WORK(&ci->i_work, ceph_inode_work); in ceph_alloc_inode()
539 ci->i_work_mask = 0; in ceph_alloc_inode()
540 memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); in ceph_alloc_inode()
542 ceph_fscache_inode_init(ci); in ceph_alloc_inode()
544 return &ci->vfs_inode; in ceph_alloc_inode()
549 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_free_inode() local
551 kfree(ci->i_symlink); in ceph_free_inode()
552 kmem_cache_free(ceph_inode_cachep, ci); in ceph_free_inode()
557 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_evict_inode() local
569 ceph_fscache_unregister_inode_cookie(ci); in ceph_evict_inode()
571 __ceph_remove_caps(ci); in ceph_evict_inode()
573 if (__ceph_has_any_quota(ci)) in ceph_evict_inode()
580 if (ci->i_snap_realm) { in ceph_evict_inode()
583 ci->i_snap_realm); in ceph_evict_inode()
586 ceph_put_snapid_map(mdsc, ci->i_snapid_map); in ceph_evict_inode()
587 ci->i_snap_realm = NULL; in ceph_evict_inode()
591 while ((n = rb_first(&ci->i_fragtree)) != NULL) { in ceph_evict_inode()
593 rb_erase(n, &ci->i_fragtree); in ceph_evict_inode()
596 ci->i_fragtree_nsplits = 0; in ceph_evict_inode()
598 __ceph_destroy_xattrs(ci); in ceph_evict_inode()
599 if (ci->i_xattrs.blob) in ceph_evict_inode()
600 ceph_buffer_put(ci->i_xattrs.blob); in ceph_evict_inode()
601 if (ci->i_xattrs.prealloc_blob) in ceph_evict_inode()
602 ceph_buffer_put(ci->i_xattrs.prealloc_blob); in ceph_evict_inode()
604 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns)); in ceph_evict_inode()
605 ceph_put_string(rcu_dereference_raw(ci->i_cached_layout.pool_ns)); in ceph_evict_inode()
624 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_size() local
628 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) > 0 || in ceph_fill_file_size()
629 (truncate_seq == ci->i_truncate_seq && size > isize)) { in ceph_fill_file_size()
637 ci->i_reported_size = size; in ceph_fill_file_size()
638 if (truncate_seq != ci->i_truncate_seq) { in ceph_fill_file_size()
640 ci->i_truncate_seq, truncate_seq); in ceph_fill_file_size()
641 ci->i_truncate_seq = truncate_seq; in ceph_fill_file_size()
657 __ceph_is_file_opened(ci)) { in ceph_fill_file_size()
658 ci->i_truncate_pending++; in ceph_fill_file_size()
663 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) >= 0 && in ceph_fill_file_size()
664 ci->i_truncate_size != truncate_size) { in ceph_fill_file_size()
665 dout("truncate_size %lld -> %llu\n", ci->i_truncate_size, in ceph_fill_file_size()
667 ci->i_truncate_size = truncate_size; in ceph_fill_file_size()
680 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_time() local
688 if (ci->i_version == 0 || in ceph_fill_file_time()
695 if (ci->i_version == 0 || in ceph_fill_file_time()
696 ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { in ceph_fill_file_time()
702 ci->i_time_warp_seq, (int)time_warp_seq); in ceph_fill_file_time()
706 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
707 } else if (time_warp_seq == ci->i_time_warp_seq) { in ceph_fill_file_time()
730 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { in ceph_fill_file_time()
734 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
741 inode, time_warp_seq, ci->i_time_warp_seq); in ceph_fill_file_time()
756 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_inode() local
775 ci->i_version); in ceph_fill_inode()
821 if (ceph_snap(inode) != CEPH_NOSNAP && !ci->i_snapid_map) in ceph_fill_inode()
822 ci->i_snapid_map = ceph_get_snapid_map(mdsc, ceph_snap(inode)); in ceph_fill_inode()
824 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
837 if (ci->i_version == 0 || in ceph_fill_inode()
839 le64_to_cpu(info->version) > (ci->i_version & ~1))) in ceph_fill_inode()
845 __ceph_caps_issued(ci, &issued); in ceph_fill_inode()
846 issued |= __ceph_caps_dirty(ci); in ceph_fill_inode()
856 __ceph_update_quota(ci, iinfo->max_bytes, iinfo->max_files); in ceph_fill_inode()
866 ceph_decode_timespec64(&ci->i_btime, &iinfo->btime); in ceph_fill_inode()
867 ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); in ceph_fill_inode()
885 ci->i_files = le64_to_cpu(info->files); in ceph_fill_inode()
886 ci->i_subdirs = le64_to_cpu(info->subdirs); in ceph_fill_inode()
891 s64 old_pool = ci->i_layout.pool_id; in ceph_fill_inode()
894 ceph_file_layout_from_legacy(&ci->i_layout, &info->layout); in ceph_fill_inode()
895 old_ns = rcu_dereference_protected(ci->i_layout.pool_ns, in ceph_fill_inode()
896 lockdep_is_held(&ci->i_ceph_lock)); in ceph_fill_inode()
897 rcu_assign_pointer(ci->i_layout.pool_ns, pool_ns); in ceph_fill_inode()
899 if (ci->i_layout.pool_id != old_pool || pool_ns != old_ns) in ceph_fill_inode()
900 ci->i_ceph_flags &= ~CEPH_I_POOL_PERM; in ceph_fill_inode()
910 ci->i_max_size != le64_to_cpu(info->max_size)) { in ceph_fill_inode()
911 dout("max_size %lld -> %llu\n", ci->i_max_size, in ceph_fill_inode()
913 ci->i_max_size = le64_to_cpu(info->max_size); in ceph_fill_inode()
921 ci->i_dir_layout = iinfo->dir_layout; in ceph_fill_inode()
922 ci->i_rbytes = le64_to_cpu(info->rbytes); in ceph_fill_inode()
923 ci->i_rfiles = le64_to_cpu(info->rfiles); in ceph_fill_inode()
924 ci->i_rsubdirs = le64_to_cpu(info->rsubdirs); in ceph_fill_inode()
925 ci->i_dir_pin = iinfo->dir_pin; in ceph_fill_inode()
926 ci->i_rsnaps = iinfo->rsnaps; in ceph_fill_inode()
927 ceph_decode_timespec64(&ci->i_rctime, &info->rctime); in ceph_fill_inode()
933 if ((ci->i_xattrs.version == 0 || !(issued & CEPH_CAP_XATTR_EXCL)) && in ceph_fill_inode()
934 le64_to_cpu(info->xattr_version) > ci->i_xattrs.version) { in ceph_fill_inode()
935 if (ci->i_xattrs.blob) in ceph_fill_inode()
936 old_blob = ci->i_xattrs.blob; in ceph_fill_inode()
937 ci->i_xattrs.blob = xattr_blob; in ceph_fill_inode()
939 memcpy(ci->i_xattrs.blob->vec.iov_base, in ceph_fill_inode()
941 ci->i_xattrs.version = le64_to_cpu(info->xattr_version); in ceph_fill_inode()
948 if (le64_to_cpu(info->version) > ci->i_version) in ceph_fill_inode()
949 ci->i_version = le64_to_cpu(info->version); in ceph_fill_inode()
968 if (!ci->i_symlink) { in ceph_fill_inode()
972 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
988 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
989 if (!ci->i_symlink) in ceph_fill_inode()
990 ci->i_symlink = sym; in ceph_fill_inode()
994 inode->i_link = ci->i_symlink; in ceph_fill_inode()
1019 ci->i_files == 0 && ci->i_subdirs == 0 && in ceph_fill_inode()
1022 !__ceph_dir_is_complete(ci)) { in ceph_fill_inode()
1025 __ceph_dir_set_complete(ci, in ceph_fill_inode()
1026 atomic64_read(&ci->i_release_count), in ceph_fill_inode()
1027 atomic64_read(&ci->i_ordered_count)); in ceph_fill_inode()
1034 ci->i_snap_caps |= info_caps; in ceph_fill_inode()
1039 iinfo->inline_version >= ci->i_inline_version) { in ceph_fill_inode()
1041 ci->i_inline_version = iinfo->inline_version; in ceph_fill_inode()
1042 if (ci->i_inline_version != CEPH_INLINE_NONE && in ceph_fill_inode()
1051 __ceph_touch_fmode(ci, mdsc, cap_fmode); in ceph_fill_inode()
1054 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
1061 wake_up_all(&ci->i_cap_wq); in ceph_fill_inode()
1579 struct ceph_inode_info *ci = ceph_inode(dir); in fill_readdir_cache() local
1602 if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) && in fill_readdir_cache()
1603 req->r_dir_ordered_cnt == atomic64_read(&ci->i_ordered_count)) { in fill_readdir_cache()
1618 struct ceph_inode_info *ci = ceph_inode(d_inode(parent)); in ceph_readdir_prepopulate() local
1634 last_hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1669 atomic64_read(&ci->i_release_count); in ceph_readdir_prepopulate()
1671 atomic64_read(&ci->i_ordered_count); in ceph_readdir_prepopulate()
1692 u32 hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1727 atomic_read(&ci->i_shared_gen)) { in ceph_readdir_prepopulate()
1728 __ceph_dir_clear_ordered(ci); in ceph_readdir_prepopulate()
1811 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_set_size() local
1814 spin_lock(&ci->i_ceph_lock); in ceph_inode_set_size()
1819 ret = __ceph_should_report_size(ci); in ceph_inode_set_size()
1821 spin_unlock(&ci->i_ceph_lock); in ceph_inode_set_size()
1828 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_inode_work() local
1829 set_bit(work_bit, &ci->i_work_mask); in ceph_queue_inode_work()
1832 if (queue_work(fsc->inode_wq, &ci->i_work)) { in ceph_queue_inode_work()
1833 dout("queue_inode_work %p, mask=%lx\n", inode, ci->i_work_mask); in ceph_queue_inode_work()
1836 inode, ci->i_work_mask); in ceph_queue_inode_work()
1843 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_do_invalidate_pages() local
1847 mutex_lock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1854 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1858 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1860 ci->i_rdcache_gen, ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1861 if (ci->i_rdcache_revoking != ci->i_rdcache_gen) { in ceph_do_invalidate_pages()
1862 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1864 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1865 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1868 orig_gen = ci->i_rdcache_gen; in ceph_do_invalidate_pages()
1869 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1877 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1878 if (orig_gen == ci->i_rdcache_gen && in ceph_do_invalidate_pages()
1879 orig_gen == ci->i_rdcache_revoking) { in ceph_do_invalidate_pages()
1881 ci->i_rdcache_gen); in ceph_do_invalidate_pages()
1882 ci->i_rdcache_revoking--; in ceph_do_invalidate_pages()
1886 inode, orig_gen, ci->i_rdcache_gen, in ceph_do_invalidate_pages()
1887 ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1888 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1891 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1892 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1895 ceph_check_caps(ci, 0, NULL); in ceph_do_invalidate_pages()
1904 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_do_pending_vmtruncate() local
1908 mutex_lock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1910 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1911 if (ci->i_truncate_pending == 0) { in __ceph_do_pending_vmtruncate()
1913 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1914 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1922 if (ci->i_wrbuffer_ref_head < ci->i_wrbuffer_ref) { in __ceph_do_pending_vmtruncate()
1923 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1932 WARN_ON_ONCE(ci->i_rd_ref || ci->i_wr_ref); in __ceph_do_pending_vmtruncate()
1934 to = ci->i_truncate_size; in __ceph_do_pending_vmtruncate()
1935 wrbuffer_refs = ci->i_wrbuffer_ref; in __ceph_do_pending_vmtruncate()
1937 ci->i_truncate_pending, to); in __ceph_do_pending_vmtruncate()
1938 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1942 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1943 if (to == ci->i_truncate_size) { in __ceph_do_pending_vmtruncate()
1944 ci->i_truncate_pending = 0; in __ceph_do_pending_vmtruncate()
1947 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1951 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1954 ceph_check_caps(ci, 0, NULL); in __ceph_do_pending_vmtruncate()
1956 wake_up_all(&ci->i_cap_wq); in __ceph_do_pending_vmtruncate()
1961 struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info, in ceph_inode_work() local
1963 struct inode *inode = &ci->vfs_inode; in ceph_inode_work()
1965 if (test_and_clear_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask)) { in ceph_inode_work()
1969 if (test_and_clear_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask)) in ceph_inode_work()
1972 if (test_and_clear_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask)) in ceph_inode_work()
1975 if (test_and_clear_bit(CEPH_I_WORK_CHECK_CAPS, &ci->i_work_mask)) in ceph_inode_work()
1976 ceph_check_caps(ci, 0, NULL); in ceph_inode_work()
1978 if (test_and_clear_bit(CEPH_I_WORK_FLUSH_SNAPS, &ci->i_work_mask)) in ceph_inode_work()
1979 ceph_flush_snaps(ci, NULL); in ceph_inode_work()
1996 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_setattr() local
2019 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2020 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2022 if (!ci->i_head_snapc && in __ceph_setattr()
2026 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2028 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2029 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2085 ci->i_time_warp_seq++; in __ceph_setattr()
2110 ci->i_reported_size = attr->ia_size; in __ceph_setattr()
2128 ci->i_time_warp_seq++; in __ceph_setattr()
2174 inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, in __ceph_setattr()
2180 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2351 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_getattr() local
2374 if (ci->i_btime.tv_sec || ci->i_btime.tv_nsec) { in ceph_getattr()
2375 stat->btime = ci->i_btime; in ceph_getattr()
2382 stat->dev = ci->i_snapid_map ? ci->i_snapid_map->dev : 0; in ceph_getattr()
2387 stat->size = ci->i_rbytes; in ceph_getattr()
2389 stat->size = ci->i_files + ci->i_subdirs; in ceph_getattr()
2399 stat->nlink = 1 + 1 + ci->i_subdirs; in ceph_getattr()
2408 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_shutdown() local
2413 spin_lock(&ci->i_ceph_lock); in ceph_inode_shutdown()
2414 ci->i_ceph_flags |= CEPH_I_SHUTDOWN; in ceph_inode_shutdown()
2415 p = rb_first(&ci->i_caps); in ceph_inode_shutdown()
2422 spin_unlock(&ci->i_ceph_lock); in ceph_inode_shutdown()