Lines Matching refs:di

33 static bool __dentry_lease_is_valid(struct ceph_dentry_info *di);
41 struct ceph_dentry_info *di; in ceph_d_init() local
44 di = kmem_cache_zalloc(ceph_dentry_cachep, GFP_KERNEL); in ceph_d_init()
45 if (!di) in ceph_d_init()
48 di->dentry = dentry; in ceph_d_init()
49 di->lease_session = NULL; in ceph_d_init()
50 di->time = jiffies; in ceph_d_init()
51 dentry->d_fsdata = di; in ceph_d_init()
52 INIT_LIST_HEAD(&di->lease_list); in ceph_d_init()
195 struct ceph_dentry_info *di; in __dcache_readdir() local
219 di = ceph_dentry(dentry); in __dcache_readdir()
221 if (fpos_cmp(di->offset, ctx->pos) < 0) { in __dcache_readdir()
250 di = ceph_dentry(dentry); in __dcache_readdir()
253 di->lease_shared_gen != shared_gen || in __dcache_readdir()
261 if (fpos_cmp(ctx->pos, di->offset) <= 0) { in __dcache_readdir()
262 __ceph_dentry_dir_lease_touch(di); in __dcache_readdir()
268 doutc(cl, " %llx dentry %p %pd %p\n", di->offset, in __dcache_readdir()
270 ctx->pos = di->offset; in __dcache_readdir()
291 di = ceph_dentry(last); in __dcache_readdir()
294 fpos_off(di->offset) + 1); in __dcache_readdir()
827 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_lookup() local
844 di->lease_shared_gen = atomic_read(&ci->i_shared_gen); in ceph_lookup()
1249 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_async_unlink_cb() local
1253 if (!test_bit(CEPH_DENTRY_ASYNC_UNLINK_BIT, &di->flags)) in ceph_async_unlink_cb()
1259 hash_del_rcu(&di->hnode); in ceph_async_unlink_cb()
1263 di->flags &= ~CEPH_DENTRY_ASYNC_UNLINK; in ceph_async_unlink_cb()
1264 wake_up_bit(&di->flags, CEPH_DENTRY_ASYNC_UNLINK_BIT); in ceph_async_unlink_cb()
1302 struct ceph_dentry_info *di; in get_caps_for_async_unlink() local
1317 di = ceph_dentry(dentry); in get_caps_for_async_unlink()
1322 if (atomic_read(&ci->i_shared_gen) != di->lease_shared_gen || in get_caps_for_async_unlink()
1323 !(di->flags & CEPH_DENTRY_PRIMARY_LINK)) in get_caps_for_async_unlink()
1405 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_unlink() local
1416 di->flags |= CEPH_DENTRY_ASYNC_UNLINK; in ceph_unlink()
1420 hash_add_rcu(fsc->async_unlink_conflict, &di->hnode, in ceph_unlink()
1434 hash_del_rcu(&di->hnode); in ceph_unlink()
1438 di->flags &= ~CEPH_DENTRY_ASYNC_UNLINK; in ceph_unlink()
1538 void __ceph_dentry_lease_touch(struct ceph_dentry_info *di) in __ceph_dentry_lease_touch() argument
1540 struct dentry *dn = di->dentry; in __ceph_dentry_lease_touch()
1544 doutc(cl, "%p %p '%pd'\n", di, dn, dn); in __ceph_dentry_lease_touch()
1546 di->flags |= CEPH_DENTRY_LEASE_LIST; in __ceph_dentry_lease_touch()
1547 if (di->flags & CEPH_DENTRY_SHRINK_LIST) { in __ceph_dentry_lease_touch()
1548 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_lease_touch()
1553 list_move_tail(&di->lease_list, &mdsc->dentry_leases); in __ceph_dentry_lease_touch()
1558 struct ceph_dentry_info *di) in __dentry_dir_lease_touch() argument
1560 di->flags &= ~(CEPH_DENTRY_LEASE_LIST | CEPH_DENTRY_REFERENCED); in __dentry_dir_lease_touch()
1561 di->lease_gen = 0; in __dentry_dir_lease_touch()
1562 di->time = jiffies; in __dentry_dir_lease_touch()
1563 list_move_tail(&di->lease_list, &mdsc->dentry_dir_leases); in __dentry_dir_lease_touch()
1572 void __ceph_dentry_dir_lease_touch(struct ceph_dentry_info *di) in __ceph_dentry_dir_lease_touch() argument
1574 struct dentry *dn = di->dentry; in __ceph_dentry_dir_lease_touch()
1578 doutc(cl, "%p %p '%pd' (offset 0x%llx)\n", di, dn, dn, di->offset); in __ceph_dentry_dir_lease_touch()
1580 if (!list_empty(&di->lease_list)) { in __ceph_dentry_dir_lease_touch()
1581 if (di->flags & CEPH_DENTRY_LEASE_LIST) { in __ceph_dentry_dir_lease_touch()
1584 if (__dentry_lease_is_valid(di)) in __ceph_dentry_dir_lease_touch()
1587 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_dir_lease_touch()
1592 if (di->flags & CEPH_DENTRY_SHRINK_LIST) { in __ceph_dentry_dir_lease_touch()
1593 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_dir_lease_touch()
1594 di->flags &= ~CEPH_DENTRY_LEASE_LIST; in __ceph_dentry_dir_lease_touch()
1599 __dentry_dir_lease_touch(mdsc, di); in __ceph_dentry_dir_lease_touch()
1603 static void __dentry_lease_unlist(struct ceph_dentry_info *di) in __dentry_lease_unlist() argument
1606 if (di->flags & CEPH_DENTRY_SHRINK_LIST) in __dentry_lease_unlist()
1608 if (list_empty(&di->lease_list)) in __dentry_lease_unlist()
1611 mdsc = ceph_sb_to_fs_client(di->dentry->d_sb)->mdsc; in __dentry_lease_unlist()
1613 list_del_init(&di->lease_list); in __dentry_lease_unlist()
1638 struct ceph_dentry_info *di, *tmp; in __dentry_leases_walk() local
1647 list_for_each_entry_safe(di, tmp, list, lease_list) { in __dentry_leases_walk()
1652 dentry = di->dentry; in __dentry_leases_walk()
1660 list_del_init(&di->lease_list); in __dentry_leases_walk()
1670 __dentry_dir_lease_touch(mdsc, di); in __dentry_leases_walk()
1676 di->flags &= ~CEPH_DENTRY_REFERENCED; in __dentry_leases_walk()
1682 list_del_init(&di->lease_list); in __dentry_leases_walk()
1684 di->flags |= CEPH_DENTRY_SHRINK_LIST; in __dentry_leases_walk()
1685 list_move_tail(&di->lease_list, &dispose); in __dentry_leases_walk()
1697 di = list_first_entry(&dispose, struct ceph_dentry_info, in __dentry_leases_walk()
1699 dentry = di->dentry; in __dentry_leases_walk()
1702 list_del_init(&di->lease_list); in __dentry_leases_walk()
1703 di->flags &= ~CEPH_DENTRY_SHRINK_LIST; in __dentry_leases_walk()
1704 if (di->flags & CEPH_DENTRY_REFERENCED) { in __dentry_leases_walk()
1706 if (di->flags & CEPH_DENTRY_LEASE_LIST) { in __dentry_leases_walk()
1707 list_add_tail(&di->lease_list, in __dentry_leases_walk()
1710 __dentry_dir_lease_touch(mdsc, di); in __dentry_leases_walk()
1726 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dentry_lease_check() local
1729 if (__dentry_lease_is_valid(di)) in __dentry_lease_check()
1742 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dir_lease_check() local
1748 if (time_before(jiffies, di->time + lwc->dir_lease_ttl)) in __dir_lease_check()
1756 (di->flags & CEPH_DENTRY_REFERENCED)) in __dir_lease_check()
1759 di->lease_shared_gen = 0; in __dir_lease_check()
1802 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_invalidate_dentry_lease() local
1804 di->time = jiffies; in ceph_invalidate_dentry_lease()
1805 di->lease_shared_gen = 0; in ceph_invalidate_dentry_lease()
1806 di->flags &= ~CEPH_DENTRY_PRIMARY_LINK; in ceph_invalidate_dentry_lease()
1807 __dentry_lease_unlist(di); in ceph_invalidate_dentry_lease()
1815 static bool __dentry_lease_is_valid(struct ceph_dentry_info *di) in __dentry_lease_is_valid() argument
1819 if (!di->lease_gen) in __dentry_lease_is_valid()
1822 session = di->lease_session; in __dentry_lease_is_valid()
1830 if (di->lease_gen == gen && in __dentry_lease_is_valid()
1832 time_before(jiffies, di->time)) in __dentry_lease_is_valid()
1835 di->lease_gen = 0; in __dentry_lease_is_valid()
1841 struct ceph_dentry_info *di; in dentry_lease_is_valid() local
1849 di = ceph_dentry(dentry); in dentry_lease_is_valid()
1850 if (di && __dentry_lease_is_valid(di)) { in dentry_lease_is_valid()
1853 if (di->lease_renew_after && in dentry_lease_is_valid()
1854 time_after(jiffies, di->lease_renew_after)) { in dentry_lease_is_valid()
1863 session = ceph_get_mds_session(di->lease_session); in dentry_lease_is_valid()
1864 seq = di->lease_seq; in dentry_lease_is_valid()
1865 di->lease_renew_after = 0; in dentry_lease_is_valid()
1866 di->lease_renew_from = jiffies; in dentry_lease_is_valid()
1886 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dir_lease_try_check() local
1891 if (!di->lease_shared_gen) in __dir_lease_try_check()
1900 if (atomic_read(&ci->i_shared_gen) == di->lease_shared_gen && in __dir_lease_try_check()
1909 di->lease_shared_gen = 0; in __dir_lease_try_check()
1932 struct ceph_dentry_info *di; in dir_lease_is_valid() local
1934 di = ceph_dentry(dentry); in dir_lease_is_valid()
1936 di && di->lease_shared_gen == shared_gen) in dir_lease_is_valid()
1937 __ceph_dentry_dir_lease_touch(di); in dir_lease_is_valid()
2051 struct ceph_dentry_info *di; in ceph_d_delete() local
2059 di = ceph_dentry(dentry); in ceph_d_delete()
2060 if (di) { in ceph_d_delete()
2061 if (__dentry_lease_is_valid(di)) in ceph_d_delete()
2074 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_d_release() local
2082 __dentry_lease_unlist(di); in ceph_d_release()
2086 ceph_put_mds_session(di->lease_session); in ceph_d_release()
2087 kmem_cache_free(ceph_dentry_cachep, di); in ceph_d_release()
2101 struct ceph_dentry_info *di; in ceph_d_prune() local
2127 di = ceph_dentry(dentry); in ceph_d_prune()
2128 if (di->offset > 0 && in ceph_d_prune()
2129 di->lease_shared_gen == atomic_read(&dir_ci->i_shared_gen)) in ceph_d_prune()