Lines Matching full: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
93 ci->i_rbytes = 0; in ceph_get_snapdir()
94 ci->i_btime = ceph_inode(parent)->i_btime; in ceph_get_snapdir()
99 ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ in ceph_get_snapdir()
127 static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci, in __get_or_create_frag() argument
135 p = &ci->i_fragtree.rb_node; in __get_or_create_frag()
158 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
161 ceph_vinop(&ci->vfs_inode), f); in __get_or_create_frag()
168 struct ceph_inode_frag *__ceph_find_frag(struct ceph_inode_info *ci, u32 f) in __ceph_find_frag() argument
170 struct rb_node *n = ci->i_fragtree.rb_node; in __ceph_find_frag()
191 static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in __ceph_choose_frag() argument
204 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
233 u32 ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in ceph_choose_frag() argument
237 mutex_lock(&ci->i_fragtree_mutex); in ceph_choose_frag()
238 ret = __ceph_choose_frag(ci, v, pfrag, found); in ceph_choose_frag()
239 mutex_unlock(&ci->i_fragtree_mutex); in ceph_choose_frag()
251 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_dirfrag() local
260 spin_lock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
261 if (ci->i_auth_cap) in ceph_fill_dirfrag()
262 diri_auth = ci->i_auth_cap->mds; in ceph_fill_dirfrag()
263 spin_unlock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
268 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
271 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
278 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
292 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
310 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
335 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_fragtree() local
342 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
344 if (nsplits != ci->i_fragtree_nsplits) { in ceph_fill_fragtree()
349 if (!__ceph_find_frag(ci, id)) in ceph_fill_fragtree()
351 } else if (!RB_EMPTY_ROOT(&ci->i_fragtree)) { in ceph_fill_fragtree()
352 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
359 if (id != __ceph_choose_frag(ci, id, NULL, NULL)) in ceph_fill_fragtree()
371 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
395 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
397 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
403 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
408 ci->i_fragtree_nsplits++; in ceph_fill_fragtree()
419 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
421 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
426 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
435 struct ceph_inode_info *ci; in ceph_alloc_inode() local
438 ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS); in ceph_alloc_inode()
439 if (!ci) in ceph_alloc_inode()
442 dout("alloc_inode %p\n", &ci->vfs_inode); in ceph_alloc_inode()
444 spin_lock_init(&ci->i_ceph_lock); in ceph_alloc_inode()
446 ci->i_version = 0; in ceph_alloc_inode()
447 ci->i_inline_version = 0; in ceph_alloc_inode()
448 ci->i_time_warp_seq = 0; in ceph_alloc_inode()
449 ci->i_ceph_flags = 0; in ceph_alloc_inode()
450 atomic64_set(&ci->i_ordered_count, 1); in ceph_alloc_inode()
451 atomic64_set(&ci->i_release_count, 1); in ceph_alloc_inode()
452 atomic64_set(&ci->i_complete_seq[0], 0); in ceph_alloc_inode()
453 atomic64_set(&ci->i_complete_seq[1], 0); in ceph_alloc_inode()
454 ci->i_symlink = NULL; in ceph_alloc_inode()
456 ci->i_max_bytes = 0; in ceph_alloc_inode()
457 ci->i_max_files = 0; in ceph_alloc_inode()
459 memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); in ceph_alloc_inode()
460 memset(&ci->i_cached_layout, 0, sizeof(ci->i_cached_layout)); in ceph_alloc_inode()
461 RCU_INIT_POINTER(ci->i_layout.pool_ns, NULL); in ceph_alloc_inode()
463 ci->i_fragtree = RB_ROOT; in ceph_alloc_inode()
464 mutex_init(&ci->i_fragtree_mutex); in ceph_alloc_inode()
466 ci->i_xattrs.blob = NULL; in ceph_alloc_inode()
467 ci->i_xattrs.prealloc_blob = NULL; in ceph_alloc_inode()
468 ci->i_xattrs.dirty = false; in ceph_alloc_inode()
469 ci->i_xattrs.index = RB_ROOT; in ceph_alloc_inode()
470 ci->i_xattrs.count = 0; in ceph_alloc_inode()
471 ci->i_xattrs.names_size = 0; in ceph_alloc_inode()
472 ci->i_xattrs.vals_size = 0; in ceph_alloc_inode()
473 ci->i_xattrs.version = 0; in ceph_alloc_inode()
474 ci->i_xattrs.index_version = 0; in ceph_alloc_inode()
476 ci->i_caps = RB_ROOT; in ceph_alloc_inode()
477 ci->i_auth_cap = NULL; in ceph_alloc_inode()
478 ci->i_dirty_caps = 0; in ceph_alloc_inode()
479 ci->i_flushing_caps = 0; in ceph_alloc_inode()
480 INIT_LIST_HEAD(&ci->i_dirty_item); in ceph_alloc_inode()
481 INIT_LIST_HEAD(&ci->i_flushing_item); in ceph_alloc_inode()
482 ci->i_prealloc_cap_flush = NULL; in ceph_alloc_inode()
483 INIT_LIST_HEAD(&ci->i_cap_flush_list); in ceph_alloc_inode()
484 init_waitqueue_head(&ci->i_cap_wq); in ceph_alloc_inode()
485 ci->i_hold_caps_max = 0; in ceph_alloc_inode()
486 INIT_LIST_HEAD(&ci->i_cap_delay_list); in ceph_alloc_inode()
487 INIT_LIST_HEAD(&ci->i_cap_snaps); in ceph_alloc_inode()
488 ci->i_head_snapc = NULL; in ceph_alloc_inode()
489 ci->i_snap_caps = 0; in ceph_alloc_inode()
491 ci->i_last_rd = ci->i_last_wr = jiffies - 3600 * HZ; in ceph_alloc_inode()
493 ci->i_nr_by_mode[i] = 0; in ceph_alloc_inode()
495 mutex_init(&ci->i_truncate_mutex); in ceph_alloc_inode()
496 ci->i_truncate_seq = 0; in ceph_alloc_inode()
497 ci->i_truncate_size = 0; in ceph_alloc_inode()
498 ci->i_truncate_pending = 0; in ceph_alloc_inode()
500 ci->i_max_size = 0; in ceph_alloc_inode()
501 ci->i_reported_size = 0; in ceph_alloc_inode()
502 ci->i_wanted_max_size = 0; in ceph_alloc_inode()
503 ci->i_requested_max_size = 0; in ceph_alloc_inode()
505 ci->i_pin_ref = 0; in ceph_alloc_inode()
506 ci->i_rd_ref = 0; in ceph_alloc_inode()
507 ci->i_rdcache_ref = 0; in ceph_alloc_inode()
508 ci->i_wr_ref = 0; in ceph_alloc_inode()
509 ci->i_wb_ref = 0; in ceph_alloc_inode()
510 ci->i_fx_ref = 0; in ceph_alloc_inode()
511 ci->i_wrbuffer_ref = 0; in ceph_alloc_inode()
512 ci->i_wrbuffer_ref_head = 0; in ceph_alloc_inode()
513 atomic_set(&ci->i_filelock_ref, 0); in ceph_alloc_inode()
514 atomic_set(&ci->i_shared_gen, 1); in ceph_alloc_inode()
515 ci->i_rdcache_gen = 0; in ceph_alloc_inode()
516 ci->i_rdcache_revoking = 0; in ceph_alloc_inode()
518 INIT_LIST_HEAD(&ci->i_unsafe_dirops); in ceph_alloc_inode()
519 INIT_LIST_HEAD(&ci->i_unsafe_iops); in ceph_alloc_inode()
520 spin_lock_init(&ci->i_unsafe_lock); in ceph_alloc_inode()
522 ci->i_snap_realm = NULL; in ceph_alloc_inode()
523 INIT_LIST_HEAD(&ci->i_snap_realm_item); in ceph_alloc_inode()
524 INIT_LIST_HEAD(&ci->i_snap_flush_item); in ceph_alloc_inode()
526 INIT_WORK(&ci->i_work, ceph_inode_work); in ceph_alloc_inode()
527 ci->i_work_mask = 0; in ceph_alloc_inode()
528 memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); in ceph_alloc_inode()
530 ceph_fscache_inode_init(ci); in ceph_alloc_inode()
532 return &ci->vfs_inode; in ceph_alloc_inode()
537 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_free_inode() local
539 kfree(ci->i_symlink); in ceph_free_inode()
540 kmem_cache_free(ceph_inode_cachep, ci); in ceph_free_inode()
545 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_evict_inode() local
557 ceph_fscache_unregister_inode_cookie(ci); in ceph_evict_inode()
559 __ceph_remove_caps(ci); in ceph_evict_inode()
561 if (__ceph_has_any_quota(ci)) in ceph_evict_inode()
568 if (ci->i_snap_realm) { in ceph_evict_inode()
570 struct ceph_snap_realm *realm = ci->i_snap_realm; in ceph_evict_inode()
574 list_del_init(&ci->i_snap_realm_item); in ceph_evict_inode()
575 ci->i_snap_realm = NULL; in ceph_evict_inode()
576 if (realm->ino == ci->i_vino.ino) in ceph_evict_inode()
581 ceph_put_snapid_map(mdsc, ci->i_snapid_map); in ceph_evict_inode()
582 ci->i_snap_realm = NULL; in ceph_evict_inode()
586 while ((n = rb_first(&ci->i_fragtree)) != NULL) { in ceph_evict_inode()
588 rb_erase(n, &ci->i_fragtree); in ceph_evict_inode()
591 ci->i_fragtree_nsplits = 0; in ceph_evict_inode()
593 __ceph_destroy_xattrs(ci); in ceph_evict_inode()
594 if (ci->i_xattrs.blob) in ceph_evict_inode()
595 ceph_buffer_put(ci->i_xattrs.blob); in ceph_evict_inode()
596 if (ci->i_xattrs.prealloc_blob) in ceph_evict_inode()
597 ceph_buffer_put(ci->i_xattrs.prealloc_blob); in ceph_evict_inode()
599 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns)); in ceph_evict_inode()
600 ceph_put_string(rcu_dereference_raw(ci->i_cached_layout.pool_ns)); in ceph_evict_inode()
619 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_size() local
622 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) > 0 || in ceph_fill_file_size()
623 (truncate_seq == ci->i_truncate_seq && size > inode->i_size)) { in ceph_fill_file_size()
631 ci->i_reported_size = size; in ceph_fill_file_size()
632 if (truncate_seq != ci->i_truncate_seq) { in ceph_fill_file_size()
634 ci->i_truncate_seq, truncate_seq); in ceph_fill_file_size()
635 ci->i_truncate_seq = truncate_seq; in ceph_fill_file_size()
651 __ceph_is_file_opened(ci)) { in ceph_fill_file_size()
652 ci->i_truncate_pending++; in ceph_fill_file_size()
657 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) >= 0 && in ceph_fill_file_size()
658 ci->i_truncate_size != truncate_size) { in ceph_fill_file_size()
659 dout("truncate_size %lld -> %llu\n", ci->i_truncate_size, in ceph_fill_file_size()
661 ci->i_truncate_size = truncate_size; in ceph_fill_file_size()
674 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_time() local
682 if (ci->i_version == 0 || in ceph_fill_file_time()
689 if (ci->i_version == 0 || in ceph_fill_file_time()
690 ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { in ceph_fill_file_time()
696 ci->i_time_warp_seq, (int)time_warp_seq); in ceph_fill_file_time()
700 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
701 } else if (time_warp_seq == ci->i_time_warp_seq) { in ceph_fill_file_time()
724 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { in ceph_fill_file_time()
728 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
735 inode, time_warp_seq, ci->i_time_warp_seq); in ceph_fill_file_time()
750 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_inode() local
767 ci->i_version); in ceph_fill_inode()
794 if (ceph_snap(inode) != CEPH_NOSNAP && !ci->i_snapid_map) in ceph_fill_inode()
795 ci->i_snapid_map = ceph_get_snapid_map(mdsc, ceph_snap(inode)); in ceph_fill_inode()
797 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
810 if (ci->i_version == 0 || in ceph_fill_inode()
812 le64_to_cpu(info->version) > (ci->i_version & ~1))) in ceph_fill_inode()
818 __ceph_caps_issued(ci, &issued); in ceph_fill_inode()
819 issued |= __ceph_caps_dirty(ci); in ceph_fill_inode()
831 __ceph_update_quota(ci, iinfo->max_bytes, iinfo->max_files); in ceph_fill_inode()
841 ceph_decode_timespec64(&ci->i_btime, &iinfo->btime); in ceph_fill_inode()
842 ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); in ceph_fill_inode()
860 ci->i_files = le64_to_cpu(info->files); in ceph_fill_inode()
861 ci->i_subdirs = le64_to_cpu(info->subdirs); in ceph_fill_inode()
866 s64 old_pool = ci->i_layout.pool_id; in ceph_fill_inode()
869 ceph_file_layout_from_legacy(&ci->i_layout, &info->layout); in ceph_fill_inode()
870 old_ns = rcu_dereference_protected(ci->i_layout.pool_ns, in ceph_fill_inode()
871 lockdep_is_held(&ci->i_ceph_lock)); in ceph_fill_inode()
872 rcu_assign_pointer(ci->i_layout.pool_ns, pool_ns); in ceph_fill_inode()
874 if (ci->i_layout.pool_id != old_pool || pool_ns != old_ns) in ceph_fill_inode()
875 ci->i_ceph_flags &= ~CEPH_I_POOL_PERM; in ceph_fill_inode()
885 ci->i_max_size != le64_to_cpu(info->max_size)) { in ceph_fill_inode()
886 dout("max_size %lld -> %llu\n", ci->i_max_size, in ceph_fill_inode()
888 ci->i_max_size = le64_to_cpu(info->max_size); in ceph_fill_inode()
896 ci->i_dir_layout = iinfo->dir_layout; in ceph_fill_inode()
897 ci->i_rbytes = le64_to_cpu(info->rbytes); in ceph_fill_inode()
898 ci->i_rfiles = le64_to_cpu(info->rfiles); in ceph_fill_inode()
899 ci->i_rsubdirs = le64_to_cpu(info->rsubdirs); in ceph_fill_inode()
900 ci->i_dir_pin = iinfo->dir_pin; in ceph_fill_inode()
901 ceph_decode_timespec64(&ci->i_rctime, &info->rctime); in ceph_fill_inode()
907 if ((ci->i_xattrs.version == 0 || !(issued & CEPH_CAP_XATTR_EXCL)) && in ceph_fill_inode()
908 le64_to_cpu(info->xattr_version) > ci->i_xattrs.version) { in ceph_fill_inode()
909 if (ci->i_xattrs.blob) in ceph_fill_inode()
910 old_blob = ci->i_xattrs.blob; in ceph_fill_inode()
911 ci->i_xattrs.blob = xattr_blob; in ceph_fill_inode()
913 memcpy(ci->i_xattrs.blob->vec.iov_base, in ceph_fill_inode()
915 ci->i_xattrs.version = le64_to_cpu(info->xattr_version); in ceph_fill_inode()
922 if (le64_to_cpu(info->version) > ci->i_version) in ceph_fill_inode()
923 ci->i_version = le64_to_cpu(info->version); in ceph_fill_inode()
942 if (!ci->i_symlink) { in ceph_fill_inode()
946 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
962 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
963 if (!ci->i_symlink) in ceph_fill_inode()
964 ci->i_symlink = sym; in ceph_fill_inode()
968 inode->i_link = ci->i_symlink; in ceph_fill_inode()
993 ci->i_files == 0 && ci->i_subdirs == 0 && in ceph_fill_inode()
996 !__ceph_dir_is_complete(ci)) { in ceph_fill_inode()
999 __ceph_dir_set_complete(ci, in ceph_fill_inode()
1000 atomic64_read(&ci->i_release_count), in ceph_fill_inode()
1001 atomic64_read(&ci->i_ordered_count)); in ceph_fill_inode()
1008 ci->i_snap_caps |= info_caps; in ceph_fill_inode()
1013 iinfo->inline_version >= ci->i_inline_version) { in ceph_fill_inode()
1015 ci->i_inline_version = iinfo->inline_version; in ceph_fill_inode()
1016 if (ci->i_inline_version != CEPH_INLINE_NONE && in ceph_fill_inode()
1025 __ceph_touch_fmode(ci, mdsc, cap_fmode); in ceph_fill_inode()
1028 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
1035 wake_up_all(&ci->i_cap_wq); in ceph_fill_inode()
1559 struct ceph_inode_info *ci = ceph_inode(dir); in fill_readdir_cache() local
1582 if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) && in fill_readdir_cache()
1583 req->r_dir_ordered_cnt == atomic64_read(&ci->i_ordered_count)) { in fill_readdir_cache()
1598 struct ceph_inode_info *ci = ceph_inode(d_inode(parent)); in ceph_readdir_prepopulate() local
1615 last_hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1650 atomic64_read(&ci->i_release_count); in ceph_readdir_prepopulate()
1652 atomic64_read(&ci->i_ordered_count); in ceph_readdir_prepopulate()
1673 u32 hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1708 atomic_read(&ci->i_shared_gen)) { in ceph_readdir_prepopulate()
1709 __ceph_dir_clear_ordered(ci); in ceph_readdir_prepopulate()
1794 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_set_size() local
1797 spin_lock(&ci->i_ceph_lock); in ceph_inode_set_size()
1802 ret = __ceph_should_report_size(ci); in ceph_inode_set_size()
1804 spin_unlock(&ci->i_ceph_lock); in ceph_inode_set_size()
1833 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_writeback() local
1834 set_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask); in ceph_queue_writeback()
1838 &ci->i_work)) { in ceph_queue_writeback()
1842 inode, ci->i_work_mask); in ceph_queue_writeback()
1852 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_invalidate() local
1853 set_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask); in ceph_queue_invalidate()
1861 inode, ci->i_work_mask); in ceph_queue_invalidate()
1872 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_vmtruncate() local
1873 set_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask); in ceph_queue_vmtruncate()
1877 &ci->i_work)) { in ceph_queue_vmtruncate()
1881 inode, ci->i_work_mask); in ceph_queue_vmtruncate()
1888 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_do_invalidate_pages() local
1893 mutex_lock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1900 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1904 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1906 ci->i_rdcache_gen, ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1907 if (ci->i_rdcache_revoking != ci->i_rdcache_gen) { in ceph_do_invalidate_pages()
1908 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1910 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1911 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1914 orig_gen = ci->i_rdcache_gen; in ceph_do_invalidate_pages()
1915 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1922 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1923 if (orig_gen == ci->i_rdcache_gen && in ceph_do_invalidate_pages()
1924 orig_gen == ci->i_rdcache_revoking) { in ceph_do_invalidate_pages()
1926 ci->i_rdcache_gen); in ceph_do_invalidate_pages()
1927 ci->i_rdcache_revoking--; in ceph_do_invalidate_pages()
1931 inode, orig_gen, ci->i_rdcache_gen, in ceph_do_invalidate_pages()
1932 ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1933 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1936 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1937 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1940 ceph_check_caps(ci, 0, NULL); in ceph_do_invalidate_pages()
1949 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_do_pending_vmtruncate() local
1953 mutex_lock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1955 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1956 if (ci->i_truncate_pending == 0) { in __ceph_do_pending_vmtruncate()
1958 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1959 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1967 if (ci->i_wrbuffer_ref_head < ci->i_wrbuffer_ref) { in __ceph_do_pending_vmtruncate()
1968 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1977 WARN_ON_ONCE(ci->i_rd_ref || ci->i_wr_ref); in __ceph_do_pending_vmtruncate()
1979 to = ci->i_truncate_size; in __ceph_do_pending_vmtruncate()
1980 wrbuffer_refs = ci->i_wrbuffer_ref; in __ceph_do_pending_vmtruncate()
1982 ci->i_truncate_pending, to); in __ceph_do_pending_vmtruncate()
1983 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1987 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1988 if (to == ci->i_truncate_size) { in __ceph_do_pending_vmtruncate()
1989 ci->i_truncate_pending = 0; in __ceph_do_pending_vmtruncate()
1992 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1996 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1999 ceph_check_caps(ci, 0, NULL); in __ceph_do_pending_vmtruncate()
2001 wake_up_all(&ci->i_cap_wq); in __ceph_do_pending_vmtruncate()
2006 struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info, in ceph_inode_work() local
2008 struct inode *inode = &ci->vfs_inode; in ceph_inode_work()
2010 if (test_and_clear_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask)) { in ceph_inode_work()
2014 if (test_and_clear_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask)) in ceph_inode_work()
2017 if (test_and_clear_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask)) in ceph_inode_work()
2035 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_setattr() local
2058 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2059 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2061 if (!ci->i_head_snapc && in __ceph_setattr()
2065 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2067 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2068 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2124 ci->i_time_warp_seq++; in __ceph_setattr()
2148 ci->i_reported_size = attr->ia_size; in __ceph_setattr()
2166 ci->i_time_warp_seq++; in __ceph_setattr()
2212 inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, in __ceph_setattr()
2218 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2376 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_getattr() local
2395 if (ci->i_btime.tv_sec || ci->i_btime.tv_nsec) { in ceph_getattr()
2396 stat->btime = ci->i_btime; in ceph_getattr()
2403 stat->dev = ci->i_snapid_map ? ci->i_snapid_map->dev : 0; in ceph_getattr()
2408 stat->size = ci->i_rbytes; in ceph_getattr()
2410 stat->size = ci->i_files + ci->i_subdirs; in ceph_getattr()
2420 stat->nlink = 1 + 1 + ci->i_subdirs; in ceph_getattr()