• Home
  • Raw
  • Download

Lines Matching refs:di

32 static bool __dentry_lease_is_valid(struct ceph_dentry_info *di);
40 struct ceph_dentry_info *di; in ceph_d_init() local
43 di = kmem_cache_zalloc(ceph_dentry_cachep, GFP_KERNEL); in ceph_d_init()
44 if (!di) in ceph_d_init()
47 di->dentry = dentry; in ceph_d_init()
48 di->lease_session = NULL; in ceph_d_init()
49 di->time = jiffies; in ceph_d_init()
50 dentry->d_fsdata = di; in ceph_d_init()
51 INIT_LIST_HEAD(&di->lease_list); in ceph_d_init()
188 struct ceph_dentry_info *di; in __dcache_readdir() local
211 di = ceph_dentry(dentry); in __dcache_readdir()
213 if (fpos_cmp(di->offset, ctx->pos) < 0) { in __dcache_readdir()
241 di = ceph_dentry(dentry); in __dcache_readdir()
244 di->lease_shared_gen != shared_gen) { in __dcache_readdir()
250 if (fpos_cmp(ctx->pos, di->offset) <= 0) { in __dcache_readdir()
251 __ceph_dentry_dir_lease_touch(di); in __dcache_readdir()
257 dout(" %llx dentry %p %pd %p\n", di->offset, in __dcache_readdir()
259 ctx->pos = di->offset; in __dcache_readdir()
280 di = ceph_dentry(last); in __dcache_readdir()
282 fpos_off(di->offset) + 1); in __dcache_readdir()
766 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_lookup() local
781 di->lease_shared_gen = atomic_read(&ci->i_shared_gen); in ceph_lookup()
1110 struct ceph_dentry_info *di; in get_caps_for_async_unlink() local
1125 di = ceph_dentry(dentry); in get_caps_for_async_unlink()
1130 if (atomic_read(&ci->i_shared_gen) != di->lease_shared_gen || in get_caps_for_async_unlink()
1131 !(di->flags & CEPH_DENTRY_PRIMARY_LINK)) in get_caps_for_async_unlink()
1283 void __ceph_dentry_lease_touch(struct ceph_dentry_info *di) in __ceph_dentry_lease_touch() argument
1285 struct dentry *dn = di->dentry; in __ceph_dentry_lease_touch()
1288 dout("dentry_lease_touch %p %p '%pd'\n", di, dn, dn); in __ceph_dentry_lease_touch()
1290 di->flags |= CEPH_DENTRY_LEASE_LIST; in __ceph_dentry_lease_touch()
1291 if (di->flags & CEPH_DENTRY_SHRINK_LIST) { in __ceph_dentry_lease_touch()
1292 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_lease_touch()
1298 list_move_tail(&di->lease_list, &mdsc->dentry_leases); in __ceph_dentry_lease_touch()
1303 struct ceph_dentry_info *di) in __dentry_dir_lease_touch() argument
1305 di->flags &= ~(CEPH_DENTRY_LEASE_LIST | CEPH_DENTRY_REFERENCED); in __dentry_dir_lease_touch()
1306 di->lease_gen = 0; in __dentry_dir_lease_touch()
1307 di->time = jiffies; in __dentry_dir_lease_touch()
1308 list_move_tail(&di->lease_list, &mdsc->dentry_dir_leases); in __dentry_dir_lease_touch()
1317 void __ceph_dentry_dir_lease_touch(struct ceph_dentry_info *di) in __ceph_dentry_dir_lease_touch() argument
1319 struct dentry *dn = di->dentry; in __ceph_dentry_dir_lease_touch()
1323 di, dn, dn, di->offset); in __ceph_dentry_dir_lease_touch()
1325 if (!list_empty(&di->lease_list)) { in __ceph_dentry_dir_lease_touch()
1326 if (di->flags & CEPH_DENTRY_LEASE_LIST) { in __ceph_dentry_dir_lease_touch()
1329 if (__dentry_lease_is_valid(di)) in __ceph_dentry_dir_lease_touch()
1332 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_dir_lease_touch()
1337 if (di->flags & CEPH_DENTRY_SHRINK_LIST) { in __ceph_dentry_dir_lease_touch()
1338 di->flags |= CEPH_DENTRY_REFERENCED; in __ceph_dentry_dir_lease_touch()
1339 di->flags &= ~CEPH_DENTRY_LEASE_LIST; in __ceph_dentry_dir_lease_touch()
1345 __dentry_dir_lease_touch(mdsc, di), in __ceph_dentry_dir_lease_touch()
1349 static void __dentry_lease_unlist(struct ceph_dentry_info *di) in __dentry_lease_unlist() argument
1352 if (di->flags & CEPH_DENTRY_SHRINK_LIST) in __dentry_lease_unlist()
1354 if (list_empty(&di->lease_list)) in __dentry_lease_unlist()
1357 mdsc = ceph_sb_to_client(di->dentry->d_sb)->mdsc; in __dentry_lease_unlist()
1359 list_del_init(&di->lease_list); in __dentry_lease_unlist()
1382 struct ceph_dentry_info *di, *tmp; in __dentry_leases_walk() local
1391 list_for_each_entry_safe(di, tmp, list, lease_list) { in __dentry_leases_walk()
1396 dentry = di->dentry; in __dentry_leases_walk()
1404 list_del_init(&di->lease_list); in __dentry_leases_walk()
1411 __dentry_dir_lease_touch(mdsc, di); in __dentry_leases_walk()
1417 di->flags &= ~CEPH_DENTRY_REFERENCED; in __dentry_leases_walk()
1423 list_del_init(&di->lease_list); in __dentry_leases_walk()
1425 di->flags |= CEPH_DENTRY_SHRINK_LIST; in __dentry_leases_walk()
1426 list_move_tail(&di->lease_list, &dispose); in __dentry_leases_walk()
1438 di = list_first_entry(&dispose, struct ceph_dentry_info, in __dentry_leases_walk()
1440 dentry = di->dentry; in __dentry_leases_walk()
1443 list_del_init(&di->lease_list); in __dentry_leases_walk()
1444 di->flags &= ~CEPH_DENTRY_SHRINK_LIST; in __dentry_leases_walk()
1445 if (di->flags & CEPH_DENTRY_REFERENCED) { in __dentry_leases_walk()
1447 if (di->flags & CEPH_DENTRY_LEASE_LIST) { in __dentry_leases_walk()
1448 list_add_tail(&di->lease_list, in __dentry_leases_walk()
1451 __dentry_dir_lease_touch(mdsc, di); in __dentry_leases_walk()
1467 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dentry_lease_check() local
1470 if (__dentry_lease_is_valid(di)) in __dentry_lease_check()
1483 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dir_lease_check() local
1489 if (time_before(jiffies, di->time + lwc->dir_lease_ttl)) in __dir_lease_check()
1497 (di->flags & CEPH_DENTRY_REFERENCED)) in __dir_lease_check()
1500 di->lease_shared_gen = 0; in __dir_lease_check()
1543 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_invalidate_dentry_lease() local
1545 di->time = jiffies; in ceph_invalidate_dentry_lease()
1546 di->lease_shared_gen = 0; in ceph_invalidate_dentry_lease()
1547 di->flags &= ~CEPH_DENTRY_PRIMARY_LINK; in ceph_invalidate_dentry_lease()
1548 __dentry_lease_unlist(di); in ceph_invalidate_dentry_lease()
1556 static bool __dentry_lease_is_valid(struct ceph_dentry_info *di) in __dentry_lease_is_valid() argument
1560 if (!di->lease_gen) in __dentry_lease_is_valid()
1563 session = di->lease_session; in __dentry_lease_is_valid()
1571 if (di->lease_gen == gen && in __dentry_lease_is_valid()
1573 time_before(jiffies, di->time)) in __dentry_lease_is_valid()
1576 di->lease_gen = 0; in __dentry_lease_is_valid()
1582 struct ceph_dentry_info *di; in dentry_lease_is_valid() local
1588 di = ceph_dentry(dentry); in dentry_lease_is_valid()
1589 if (di && __dentry_lease_is_valid(di)) { in dentry_lease_is_valid()
1592 if (di->lease_renew_after && in dentry_lease_is_valid()
1593 time_after(jiffies, di->lease_renew_after)) { in dentry_lease_is_valid()
1602 session = ceph_get_mds_session(di->lease_session); in dentry_lease_is_valid()
1603 seq = di->lease_seq; in dentry_lease_is_valid()
1604 di->lease_renew_after = 0; in dentry_lease_is_valid()
1605 di->lease_renew_from = jiffies; in dentry_lease_is_valid()
1625 struct ceph_dentry_info *di = ceph_dentry(dentry); in __dir_lease_try_check() local
1630 if (!di->lease_shared_gen) in __dir_lease_try_check()
1639 if (atomic_read(&ci->i_shared_gen) == di->lease_shared_gen && in __dir_lease_try_check()
1648 di->lease_shared_gen = 0; in __dir_lease_try_check()
1670 struct ceph_dentry_info *di; in dir_lease_is_valid() local
1672 di = ceph_dentry(dentry); in dir_lease_is_valid()
1674 di && di->lease_shared_gen == shared_gen) in dir_lease_is_valid()
1675 __ceph_dentry_dir_lease_touch(di); in dir_lease_is_valid()
1793 struct ceph_dentry_info *di; in ceph_d_delete() local
1801 di = ceph_dentry(dentry); in ceph_d_delete()
1802 if (di) { in ceph_d_delete()
1803 if (__dentry_lease_is_valid(di)) in ceph_d_delete()
1816 struct ceph_dentry_info *di = ceph_dentry(dentry); in ceph_d_release() local
1824 __dentry_lease_unlist(di); in ceph_d_release()
1828 ceph_put_mds_session(di->lease_session); in ceph_d_release()
1829 kmem_cache_free(ceph_dentry_cachep, di); in ceph_d_release()
1841 struct ceph_dentry_info *di; in ceph_d_prune() local
1867 di = ceph_dentry(dentry); in ceph_d_prune()
1868 if (di->offset > 0 && in ceph_d_prune()
1869 di->lease_shared_gen == atomic_read(&dir_ci->i_shared_gen)) in ceph_d_prune()