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()
79 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_get_snapdir() local
92 ci->i_snap_caps = CEPH_CAP_PIN; /* so we can open */ in ceph_get_snapdir()
93 ci->i_rbytes = 0; in ceph_get_snapdir()
94 ci->i_btime = ceph_inode(parent)->i_btime; in ceph_get_snapdir()
123 static struct ceph_inode_frag *__get_or_create_frag(struct ceph_inode_info *ci, in __get_or_create_frag() argument
131 p = &ci->i_fragtree.rb_node; in __get_or_create_frag()
154 rb_insert_color(&frag->node, &ci->i_fragtree); in __get_or_create_frag()
157 ceph_vinop(&ci->vfs_inode), f); in __get_or_create_frag()
164 struct ceph_inode_frag *__ceph_find_frag(struct ceph_inode_info *ci, u32 f) in __ceph_find_frag() argument
166 struct rb_node *n = ci->i_fragtree.rb_node; in __ceph_find_frag()
187 static u32 __ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in __ceph_choose_frag() argument
200 frag = __ceph_find_frag(ci, t); in __ceph_choose_frag()
229 u32 ceph_choose_frag(struct ceph_inode_info *ci, u32 v, in ceph_choose_frag() argument
233 mutex_lock(&ci->i_fragtree_mutex); in ceph_choose_frag()
234 ret = __ceph_choose_frag(ci, v, pfrag, found); in ceph_choose_frag()
235 mutex_unlock(&ci->i_fragtree_mutex); in ceph_choose_frag()
247 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_dirfrag() local
256 spin_lock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
257 if (ci->i_auth_cap) in ceph_fill_dirfrag()
258 diri_auth = ci->i_auth_cap->mds; in ceph_fill_dirfrag()
259 spin_unlock(&ci->i_ceph_lock); in ceph_fill_dirfrag()
264 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
267 frag = __ceph_find_frag(ci, id); in ceph_fill_dirfrag()
274 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_dirfrag()
288 frag = __get_or_create_frag(ci, id); in ceph_fill_dirfrag()
306 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_dirfrag()
331 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_fragtree() local
338 mutex_lock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
340 if (nsplits != ci->i_fragtree_nsplits) { in ceph_fill_fragtree()
345 if (!__ceph_find_frag(ci, id)) in ceph_fill_fragtree()
347 } else if (!RB_EMPTY_ROOT(&ci->i_fragtree)) { in ceph_fill_fragtree()
348 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
355 if (id != __ceph_choose_frag(ci, id, NULL, NULL)) in ceph_fill_fragtree()
367 rb_node = rb_first(&ci->i_fragtree); in ceph_fill_fragtree()
391 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
393 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
399 frag = __get_or_create_frag(ci, id); in ceph_fill_fragtree()
404 ci->i_fragtree_nsplits++; in ceph_fill_fragtree()
415 rb_erase(&frag->node, &ci->i_fragtree); in ceph_fill_fragtree()
417 ci->i_fragtree_nsplits--; in ceph_fill_fragtree()
422 mutex_unlock(&ci->i_fragtree_mutex); in ceph_fill_fragtree()
431 struct ceph_inode_info *ci; in ceph_alloc_inode() local
434 ci = kmem_cache_alloc(ceph_inode_cachep, GFP_NOFS); in ceph_alloc_inode()
435 if (!ci) in ceph_alloc_inode()
438 dout("alloc_inode %p\n", &ci->vfs_inode); in ceph_alloc_inode()
440 spin_lock_init(&ci->i_ceph_lock); in ceph_alloc_inode()
442 ci->i_version = 0; in ceph_alloc_inode()
443 ci->i_inline_version = 0; in ceph_alloc_inode()
444 ci->i_time_warp_seq = 0; in ceph_alloc_inode()
445 ci->i_ceph_flags = 0; in ceph_alloc_inode()
446 atomic64_set(&ci->i_ordered_count, 1); in ceph_alloc_inode()
447 atomic64_set(&ci->i_release_count, 1); in ceph_alloc_inode()
448 atomic64_set(&ci->i_complete_seq[0], 0); in ceph_alloc_inode()
449 atomic64_set(&ci->i_complete_seq[1], 0); in ceph_alloc_inode()
450 ci->i_symlink = NULL; in ceph_alloc_inode()
452 ci->i_max_bytes = 0; in ceph_alloc_inode()
453 ci->i_max_files = 0; in ceph_alloc_inode()
455 memset(&ci->i_dir_layout, 0, sizeof(ci->i_dir_layout)); in ceph_alloc_inode()
456 memset(&ci->i_cached_layout, 0, sizeof(ci->i_cached_layout)); in ceph_alloc_inode()
457 RCU_INIT_POINTER(ci->i_layout.pool_ns, NULL); in ceph_alloc_inode()
459 ci->i_fragtree = RB_ROOT; in ceph_alloc_inode()
460 mutex_init(&ci->i_fragtree_mutex); in ceph_alloc_inode()
462 ci->i_xattrs.blob = NULL; in ceph_alloc_inode()
463 ci->i_xattrs.prealloc_blob = NULL; in ceph_alloc_inode()
464 ci->i_xattrs.dirty = false; in ceph_alloc_inode()
465 ci->i_xattrs.index = RB_ROOT; in ceph_alloc_inode()
466 ci->i_xattrs.count = 0; in ceph_alloc_inode()
467 ci->i_xattrs.names_size = 0; in ceph_alloc_inode()
468 ci->i_xattrs.vals_size = 0; in ceph_alloc_inode()
469 ci->i_xattrs.version = 0; in ceph_alloc_inode()
470 ci->i_xattrs.index_version = 0; in ceph_alloc_inode()
472 ci->i_caps = RB_ROOT; in ceph_alloc_inode()
473 ci->i_auth_cap = NULL; in ceph_alloc_inode()
474 ci->i_dirty_caps = 0; in ceph_alloc_inode()
475 ci->i_flushing_caps = 0; in ceph_alloc_inode()
476 INIT_LIST_HEAD(&ci->i_dirty_item); in ceph_alloc_inode()
477 INIT_LIST_HEAD(&ci->i_flushing_item); in ceph_alloc_inode()
478 ci->i_prealloc_cap_flush = NULL; in ceph_alloc_inode()
479 INIT_LIST_HEAD(&ci->i_cap_flush_list); in ceph_alloc_inode()
480 init_waitqueue_head(&ci->i_cap_wq); in ceph_alloc_inode()
481 ci->i_hold_caps_max = 0; in ceph_alloc_inode()
482 INIT_LIST_HEAD(&ci->i_cap_delay_list); in ceph_alloc_inode()
483 INIT_LIST_HEAD(&ci->i_cap_snaps); in ceph_alloc_inode()
484 ci->i_head_snapc = NULL; in ceph_alloc_inode()
485 ci->i_snap_caps = 0; in ceph_alloc_inode()
487 ci->i_last_rd = ci->i_last_wr = jiffies - 3600 * HZ; in ceph_alloc_inode()
489 ci->i_nr_by_mode[i] = 0; in ceph_alloc_inode()
491 mutex_init(&ci->i_truncate_mutex); in ceph_alloc_inode()
492 ci->i_truncate_seq = 0; in ceph_alloc_inode()
493 ci->i_truncate_size = 0; in ceph_alloc_inode()
494 ci->i_truncate_pending = 0; in ceph_alloc_inode()
496 ci->i_max_size = 0; in ceph_alloc_inode()
497 ci->i_reported_size = 0; in ceph_alloc_inode()
498 ci->i_wanted_max_size = 0; in ceph_alloc_inode()
499 ci->i_requested_max_size = 0; in ceph_alloc_inode()
501 ci->i_pin_ref = 0; in ceph_alloc_inode()
502 ci->i_rd_ref = 0; in ceph_alloc_inode()
503 ci->i_rdcache_ref = 0; in ceph_alloc_inode()
504 ci->i_wr_ref = 0; in ceph_alloc_inode()
505 ci->i_wb_ref = 0; in ceph_alloc_inode()
506 ci->i_fx_ref = 0; in ceph_alloc_inode()
507 ci->i_wrbuffer_ref = 0; in ceph_alloc_inode()
508 ci->i_wrbuffer_ref_head = 0; in ceph_alloc_inode()
509 atomic_set(&ci->i_filelock_ref, 0); in ceph_alloc_inode()
510 atomic_set(&ci->i_shared_gen, 1); in ceph_alloc_inode()
511 ci->i_rdcache_gen = 0; in ceph_alloc_inode()
512 ci->i_rdcache_revoking = 0; in ceph_alloc_inode()
514 INIT_LIST_HEAD(&ci->i_unsafe_dirops); in ceph_alloc_inode()
515 INIT_LIST_HEAD(&ci->i_unsafe_iops); in ceph_alloc_inode()
516 spin_lock_init(&ci->i_unsafe_lock); in ceph_alloc_inode()
518 ci->i_snap_realm = NULL; in ceph_alloc_inode()
519 INIT_LIST_HEAD(&ci->i_snap_realm_item); in ceph_alloc_inode()
520 INIT_LIST_HEAD(&ci->i_snap_flush_item); in ceph_alloc_inode()
522 INIT_WORK(&ci->i_work, ceph_inode_work); in ceph_alloc_inode()
523 ci->i_work_mask = 0; in ceph_alloc_inode()
524 memset(&ci->i_btime, '\0', sizeof(ci->i_btime)); in ceph_alloc_inode()
526 ceph_fscache_inode_init(ci); in ceph_alloc_inode()
528 ci->i_meta_err = 0; in ceph_alloc_inode()
530 return &ci->vfs_inode; in ceph_alloc_inode()
535 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_free_inode() local
537 kfree(ci->i_symlink); in ceph_free_inode()
538 kmem_cache_free(ceph_inode_cachep, ci); in ceph_free_inode()
543 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_evict_inode() local
555 ceph_fscache_unregister_inode_cookie(ci); in ceph_evict_inode()
557 __ceph_remove_caps(ci); in ceph_evict_inode()
559 if (__ceph_has_any_quota(ci)) in ceph_evict_inode()
566 if (ci->i_snap_realm) { in ceph_evict_inode()
568 struct ceph_snap_realm *realm = ci->i_snap_realm; in ceph_evict_inode()
572 list_del_init(&ci->i_snap_realm_item); in ceph_evict_inode()
573 ci->i_snap_realm = NULL; in ceph_evict_inode()
574 if (realm->ino == ci->i_vino.ino) in ceph_evict_inode()
579 ceph_put_snapid_map(mdsc, ci->i_snapid_map); in ceph_evict_inode()
580 ci->i_snap_realm = NULL; in ceph_evict_inode()
584 while ((n = rb_first(&ci->i_fragtree)) != NULL) { in ceph_evict_inode()
586 rb_erase(n, &ci->i_fragtree); in ceph_evict_inode()
589 ci->i_fragtree_nsplits = 0; in ceph_evict_inode()
591 __ceph_destroy_xattrs(ci); in ceph_evict_inode()
592 if (ci->i_xattrs.blob) in ceph_evict_inode()
593 ceph_buffer_put(ci->i_xattrs.blob); in ceph_evict_inode()
594 if (ci->i_xattrs.prealloc_blob) in ceph_evict_inode()
595 ceph_buffer_put(ci->i_xattrs.prealloc_blob); in ceph_evict_inode()
597 ceph_put_string(rcu_dereference_raw(ci->i_layout.pool_ns)); in ceph_evict_inode()
598 ceph_put_string(rcu_dereference_raw(ci->i_cached_layout.pool_ns)); in ceph_evict_inode()
617 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_size() local
620 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) > 0 || in ceph_fill_file_size()
621 (truncate_seq == ci->i_truncate_seq && size > inode->i_size)) { in ceph_fill_file_size()
629 ci->i_reported_size = size; in ceph_fill_file_size()
630 if (truncate_seq != ci->i_truncate_seq) { in ceph_fill_file_size()
632 ci->i_truncate_seq, truncate_seq); in ceph_fill_file_size()
633 ci->i_truncate_seq = truncate_seq; in ceph_fill_file_size()
649 __ceph_is_file_opened(ci)) { in ceph_fill_file_size()
650 ci->i_truncate_pending++; in ceph_fill_file_size()
655 if (ceph_seq_cmp(truncate_seq, ci->i_truncate_seq) >= 0 && in ceph_fill_file_size()
656 ci->i_truncate_size != truncate_size) { in ceph_fill_file_size()
657 dout("truncate_size %lld -> %llu\n", ci->i_truncate_size, in ceph_fill_file_size()
659 ci->i_truncate_size = truncate_size; in ceph_fill_file_size()
672 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_file_time() local
680 if (ci->i_version == 0 || in ceph_fill_file_time()
687 if (ci->i_version == 0 || in ceph_fill_file_time()
688 ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { in ceph_fill_file_time()
694 ci->i_time_warp_seq, (int)time_warp_seq); in ceph_fill_file_time()
698 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
699 } else if (time_warp_seq == ci->i_time_warp_seq) { in ceph_fill_file_time()
722 if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { in ceph_fill_file_time()
726 ci->i_time_warp_seq = time_warp_seq; in ceph_fill_file_time()
733 inode, time_warp_seq, ci->i_time_warp_seq); in ceph_fill_file_time()
748 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_fill_inode() local
763 ci->i_version); in ceph_fill_inode()
790 if (ceph_snap(inode) != CEPH_NOSNAP && !ci->i_snapid_map) in ceph_fill_inode()
791 ci->i_snapid_map = ceph_get_snapid_map(mdsc, ceph_snap(inode)); in ceph_fill_inode()
793 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
806 if (ci->i_version == 0 || in ceph_fill_inode()
808 le64_to_cpu(info->version) > (ci->i_version & ~1))) in ceph_fill_inode()
814 __ceph_caps_issued(ci, &issued); in ceph_fill_inode()
815 issued |= __ceph_caps_dirty(ci); in ceph_fill_inode()
827 __ceph_update_quota(ci, iinfo->max_bytes, iinfo->max_files); in ceph_fill_inode()
837 ceph_decode_timespec64(&ci->i_btime, &iinfo->btime); in ceph_fill_inode()
838 ceph_decode_timespec64(&ci->i_snap_btime, &iinfo->snap_btime); in ceph_fill_inode()
856 ci->i_files = le64_to_cpu(info->files); in ceph_fill_inode()
857 ci->i_subdirs = le64_to_cpu(info->subdirs); in ceph_fill_inode()
862 s64 old_pool = ci->i_layout.pool_id; in ceph_fill_inode()
865 ceph_file_layout_from_legacy(&ci->i_layout, &info->layout); in ceph_fill_inode()
866 old_ns = rcu_dereference_protected(ci->i_layout.pool_ns, in ceph_fill_inode()
867 lockdep_is_held(&ci->i_ceph_lock)); in ceph_fill_inode()
868 rcu_assign_pointer(ci->i_layout.pool_ns, pool_ns); in ceph_fill_inode()
870 if (ci->i_layout.pool_id != old_pool || pool_ns != old_ns) in ceph_fill_inode()
871 ci->i_ceph_flags &= ~CEPH_I_POOL_PERM; in ceph_fill_inode()
881 ci->i_max_size != le64_to_cpu(info->max_size)) { in ceph_fill_inode()
882 dout("max_size %lld -> %llu\n", ci->i_max_size, in ceph_fill_inode()
884 ci->i_max_size = le64_to_cpu(info->max_size); in ceph_fill_inode()
892 ci->i_dir_layout = iinfo->dir_layout; in ceph_fill_inode()
893 ci->i_rbytes = le64_to_cpu(info->rbytes); in ceph_fill_inode()
894 ci->i_rfiles = le64_to_cpu(info->rfiles); in ceph_fill_inode()
895 ci->i_rsubdirs = le64_to_cpu(info->rsubdirs); in ceph_fill_inode()
896 ci->i_dir_pin = iinfo->dir_pin; in ceph_fill_inode()
897 ceph_decode_timespec64(&ci->i_rctime, &info->rctime); in ceph_fill_inode()
903 if ((ci->i_xattrs.version == 0 || !(issued & CEPH_CAP_XATTR_EXCL)) && in ceph_fill_inode()
904 le64_to_cpu(info->xattr_version) > ci->i_xattrs.version) { in ceph_fill_inode()
905 if (ci->i_xattrs.blob) in ceph_fill_inode()
906 old_blob = ci->i_xattrs.blob; in ceph_fill_inode()
907 ci->i_xattrs.blob = xattr_blob; in ceph_fill_inode()
909 memcpy(ci->i_xattrs.blob->vec.iov_base, in ceph_fill_inode()
911 ci->i_xattrs.version = le64_to_cpu(info->xattr_version); in ceph_fill_inode()
918 if (le64_to_cpu(info->version) > ci->i_version) in ceph_fill_inode()
919 ci->i_version = le64_to_cpu(info->version); in ceph_fill_inode()
938 if (!ci->i_symlink) { in ceph_fill_inode()
942 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
958 spin_lock(&ci->i_ceph_lock); in ceph_fill_inode()
959 if (!ci->i_symlink) in ceph_fill_inode()
960 ci->i_symlink = sym; in ceph_fill_inode()
964 inode->i_link = ci->i_symlink; in ceph_fill_inode()
989 ci->i_files == 0 && ci->i_subdirs == 0 && in ceph_fill_inode()
992 !__ceph_dir_is_complete(ci)) { in ceph_fill_inode()
995 __ceph_dir_set_complete(ci, in ceph_fill_inode()
996 atomic64_read(&ci->i_release_count), in ceph_fill_inode()
997 atomic64_read(&ci->i_ordered_count)); in ceph_fill_inode()
1004 ci->i_snap_caps |= info_caps; in ceph_fill_inode()
1009 iinfo->inline_version >= ci->i_inline_version) { in ceph_fill_inode()
1011 ci->i_inline_version = iinfo->inline_version; in ceph_fill_inode()
1012 if (ci->i_inline_version != CEPH_INLINE_NONE && in ceph_fill_inode()
1021 __ceph_touch_fmode(ci, mdsc, cap_fmode); in ceph_fill_inode()
1024 spin_unlock(&ci->i_ceph_lock); in ceph_fill_inode()
1031 wake_up_all(&ci->i_cap_wq); in ceph_fill_inode()
1555 struct ceph_inode_info *ci = ceph_inode(dir); in fill_readdir_cache() local
1578 if (req->r_dir_release_cnt == atomic64_read(&ci->i_release_count) && in fill_readdir_cache()
1579 req->r_dir_ordered_cnt == atomic64_read(&ci->i_ordered_count)) { in fill_readdir_cache()
1594 struct ceph_inode_info *ci = ceph_inode(d_inode(parent)); in ceph_readdir_prepopulate() local
1611 last_hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1646 atomic64_read(&ci->i_release_count); in ceph_readdir_prepopulate()
1648 atomic64_read(&ci->i_ordered_count); in ceph_readdir_prepopulate()
1669 u32 hash = ceph_str_hash(ci->i_dir_layout.dl_dir_hash, in ceph_readdir_prepopulate()
1704 atomic_read(&ci->i_shared_gen)) { in ceph_readdir_prepopulate()
1705 __ceph_dir_clear_ordered(ci); in ceph_readdir_prepopulate()
1790 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_inode_set_size() local
1793 spin_lock(&ci->i_ceph_lock); in ceph_inode_set_size()
1798 ret = __ceph_should_report_size(ci); in ceph_inode_set_size()
1800 spin_unlock(&ci->i_ceph_lock); in ceph_inode_set_size()
1829 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_writeback() local
1830 set_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask); in ceph_queue_writeback()
1834 &ci->i_work)) { in ceph_queue_writeback()
1838 inode, ci->i_work_mask); in ceph_queue_writeback()
1848 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_invalidate() local
1849 set_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask); in ceph_queue_invalidate()
1857 inode, ci->i_work_mask); in ceph_queue_invalidate()
1868 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_queue_vmtruncate() local
1869 set_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask); in ceph_queue_vmtruncate()
1873 &ci->i_work)) { in ceph_queue_vmtruncate()
1877 inode, ci->i_work_mask); in ceph_queue_vmtruncate()
1884 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_do_invalidate_pages() local
1889 mutex_lock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1896 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1900 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1902 ci->i_rdcache_gen, ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1903 if (ci->i_rdcache_revoking != ci->i_rdcache_gen) { in ceph_do_invalidate_pages()
1904 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1906 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1907 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1910 orig_gen = ci->i_rdcache_gen; in ceph_do_invalidate_pages()
1911 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1917 spin_lock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1918 if (orig_gen == ci->i_rdcache_gen && in ceph_do_invalidate_pages()
1919 orig_gen == ci->i_rdcache_revoking) { in ceph_do_invalidate_pages()
1921 ci->i_rdcache_gen); in ceph_do_invalidate_pages()
1922 ci->i_rdcache_revoking--; in ceph_do_invalidate_pages()
1926 inode, orig_gen, ci->i_rdcache_gen, in ceph_do_invalidate_pages()
1927 ci->i_rdcache_revoking); in ceph_do_invalidate_pages()
1928 if (__ceph_caps_revoking_other(ci, NULL, CEPH_CAP_FILE_CACHE)) in ceph_do_invalidate_pages()
1931 spin_unlock(&ci->i_ceph_lock); in ceph_do_invalidate_pages()
1932 mutex_unlock(&ci->i_truncate_mutex); in ceph_do_invalidate_pages()
1935 ceph_check_caps(ci, 0, NULL); in ceph_do_invalidate_pages()
1944 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_do_pending_vmtruncate() local
1948 mutex_lock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1950 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1951 if (ci->i_truncate_pending == 0) { in __ceph_do_pending_vmtruncate()
1953 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1954 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1962 if (ci->i_wrbuffer_ref_head < ci->i_wrbuffer_ref) { in __ceph_do_pending_vmtruncate()
1963 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1972 WARN_ON_ONCE(ci->i_rd_ref || ci->i_wr_ref); in __ceph_do_pending_vmtruncate()
1974 to = ci->i_truncate_size; in __ceph_do_pending_vmtruncate()
1975 wrbuffer_refs = ci->i_wrbuffer_ref; in __ceph_do_pending_vmtruncate()
1977 ci->i_truncate_pending, to); in __ceph_do_pending_vmtruncate()
1978 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1982 spin_lock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1983 if (to == ci->i_truncate_size) { in __ceph_do_pending_vmtruncate()
1984 ci->i_truncate_pending = 0; in __ceph_do_pending_vmtruncate()
1987 spin_unlock(&ci->i_ceph_lock); in __ceph_do_pending_vmtruncate()
1991 mutex_unlock(&ci->i_truncate_mutex); in __ceph_do_pending_vmtruncate()
1994 ceph_check_caps(ci, 0, NULL); in __ceph_do_pending_vmtruncate()
1996 wake_up_all(&ci->i_cap_wq); in __ceph_do_pending_vmtruncate()
2001 struct ceph_inode_info *ci = container_of(work, struct ceph_inode_info, in ceph_inode_work() local
2003 struct inode *inode = &ci->vfs_inode; in ceph_inode_work()
2005 if (test_and_clear_bit(CEPH_I_WORK_WRITEBACK, &ci->i_work_mask)) { in ceph_inode_work()
2009 if (test_and_clear_bit(CEPH_I_WORK_INVALIDATE_PAGES, &ci->i_work_mask)) in ceph_inode_work()
2012 if (test_and_clear_bit(CEPH_I_WORK_VMTRUNCATE, &ci->i_work_mask)) in ceph_inode_work()
2030 struct ceph_inode_info *ci = ceph_inode(inode); in __ceph_setattr() local
2053 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2054 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2056 if (!ci->i_head_snapc && in __ceph_setattr()
2060 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2062 spin_lock(&ci->i_ceph_lock); in __ceph_setattr()
2063 issued = __ceph_caps_issued(ci, NULL); in __ceph_setattr()
2119 ci->i_time_warp_seq++; in __ceph_setattr()
2143 ci->i_reported_size = attr->ia_size; in __ceph_setattr()
2161 ci->i_time_warp_seq++; in __ceph_setattr()
2207 inode_dirty_flags = __ceph_mark_dirty_caps(ci, dirtied, in __ceph_setattr()
2213 spin_unlock(&ci->i_ceph_lock); in __ceph_setattr()
2371 struct ceph_inode_info *ci = ceph_inode(inode); in ceph_getattr() local
2390 if (ci->i_btime.tv_sec || ci->i_btime.tv_nsec) { in ceph_getattr()
2391 stat->btime = ci->i_btime; in ceph_getattr()
2398 stat->dev = ci->i_snapid_map ? ci->i_snapid_map->dev : 0; in ceph_getattr()
2403 stat->size = ci->i_rbytes; in ceph_getattr()
2405 stat->size = ci->i_files + ci->i_subdirs; in ceph_getattr()
2415 stat->nlink = 1 + 1 + ci->i_subdirs; in ceph_getattr()