• Home
  • Raw
  • Download

Lines Matching refs:dentry

109 static inline struct hlist_bl_head *in_lookup_hash(const struct dentry *parent,  in in_lookup_hash()
231 static inline int dentry_cmp(const struct dentry *dentry, const unsigned char *ct, unsigned tcount) in dentry_cmp() argument
249 const unsigned char *cs = READ_ONCE(dentry->d_name.name); in dentry_cmp()
262 static inline struct external_name *external_name(struct dentry *dentry) in external_name() argument
264 return container_of(dentry->d_name.name, struct external_name, name[0]); in external_name()
269 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); in __d_free() local
271 kmem_cache_free(dentry_cache, dentry); in __d_free()
276 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); in __d_free_external() local
277 kfree(external_name(dentry)); in __d_free_external()
278 kmem_cache_free(dentry_cache, dentry); in __d_free_external()
281 static inline int dname_external(const struct dentry *dentry) in dname_external() argument
283 return dentry->d_name.name != dentry->d_iname; in dname_external()
286 void take_dentry_name_snapshot(struct name_snapshot *name, struct dentry *dentry) in take_dentry_name_snapshot() argument
288 spin_lock(&dentry->d_lock); in take_dentry_name_snapshot()
289 name->name = dentry->d_name; in take_dentry_name_snapshot()
290 if (unlikely(dname_external(dentry))) { in take_dentry_name_snapshot()
291 atomic_inc(&external_name(dentry)->u.count); in take_dentry_name_snapshot()
293 memcpy(name->inline_name, dentry->d_iname, in take_dentry_name_snapshot()
294 dentry->d_name.len + 1); in take_dentry_name_snapshot()
297 spin_unlock(&dentry->d_lock); in take_dentry_name_snapshot()
312 static inline void __d_set_inode_and_type(struct dentry *dentry, in __d_set_inode_and_type() argument
318 dentry->d_inode = inode; in __d_set_inode_and_type()
319 flags = READ_ONCE(dentry->d_flags); in __d_set_inode_and_type()
322 WRITE_ONCE(dentry->d_flags, flags); in __d_set_inode_and_type()
325 static inline void __d_clear_type_and_inode(struct dentry *dentry) in __d_clear_type_and_inode() argument
327 unsigned flags = READ_ONCE(dentry->d_flags); in __d_clear_type_and_inode()
330 WRITE_ONCE(dentry->d_flags, flags); in __d_clear_type_and_inode()
331 dentry->d_inode = NULL; in __d_clear_type_and_inode()
332 if (dentry->d_flags & DCACHE_LRU_LIST) in __d_clear_type_and_inode()
336 static void dentry_free(struct dentry *dentry) in dentry_free() argument
338 WARN_ON(!hlist_unhashed(&dentry->d_u.d_alias)); in dentry_free()
339 if (unlikely(dname_external(dentry))) { in dentry_free()
340 struct external_name *p = external_name(dentry); in dentry_free()
342 call_rcu(&dentry->d_u.d_rcu, __d_free_external); in dentry_free()
347 if (dentry->d_flags & DCACHE_NORCU) in dentry_free()
348 __d_free(&dentry->d_u.d_rcu); in dentry_free()
350 call_rcu(&dentry->d_u.d_rcu, __d_free); in dentry_free()
357 static void dentry_unlink_inode(struct dentry * dentry) in dentry_unlink_inode() argument
358 __releases(dentry->d_lock) in dentry_unlink_inode()
359 __releases(dentry->d_inode->i_lock) in dentry_unlink_inode()
361 struct inode *inode = dentry->d_inode; in dentry_unlink_inode()
363 raw_write_seqcount_begin(&dentry->d_seq); in dentry_unlink_inode()
364 __d_clear_type_and_inode(dentry); in dentry_unlink_inode()
365 hlist_del_init(&dentry->d_u.d_alias); in dentry_unlink_inode()
366 raw_write_seqcount_end(&dentry->d_seq); in dentry_unlink_inode()
367 spin_unlock(&dentry->d_lock); in dentry_unlink_inode()
371 if (dentry->d_op && dentry->d_op->d_iput) in dentry_unlink_inode()
372 dentry->d_op->d_iput(dentry, inode); in dentry_unlink_inode()
396 #define D_FLAG_VERIFY(dentry,x) WARN_ON_ONCE(((dentry)->d_flags & (DCACHE_LRU_LIST | DCACHE_SHRINK_… argument
397 static void d_lru_add(struct dentry *dentry) in d_lru_add() argument
399 D_FLAG_VERIFY(dentry, 0); in d_lru_add()
400 dentry->d_flags |= DCACHE_LRU_LIST; in d_lru_add()
402 if (d_is_negative(dentry)) in d_lru_add()
404 WARN_ON_ONCE(!list_lru_add(&dentry->d_sb->s_dentry_lru, &dentry->d_lru)); in d_lru_add()
407 static void d_lru_del(struct dentry *dentry) in d_lru_del() argument
409 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); in d_lru_del()
410 dentry->d_flags &= ~DCACHE_LRU_LIST; in d_lru_del()
412 if (d_is_negative(dentry)) in d_lru_del()
414 WARN_ON_ONCE(!list_lru_del(&dentry->d_sb->s_dentry_lru, &dentry->d_lru)); in d_lru_del()
417 static void d_shrink_del(struct dentry *dentry) in d_shrink_del() argument
419 D_FLAG_VERIFY(dentry, DCACHE_SHRINK_LIST | DCACHE_LRU_LIST); in d_shrink_del()
420 list_del_init(&dentry->d_lru); in d_shrink_del()
421 dentry->d_flags &= ~(DCACHE_SHRINK_LIST | DCACHE_LRU_LIST); in d_shrink_del()
425 static void d_shrink_add(struct dentry *dentry, struct list_head *list) in d_shrink_add() argument
427 D_FLAG_VERIFY(dentry, 0); in d_shrink_add()
428 list_add(&dentry->d_lru, list); in d_shrink_add()
429 dentry->d_flags |= DCACHE_SHRINK_LIST | DCACHE_LRU_LIST; in d_shrink_add()
439 static void d_lru_isolate(struct list_lru_one *lru, struct dentry *dentry) in d_lru_isolate() argument
441 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); in d_lru_isolate()
442 dentry->d_flags &= ~DCACHE_LRU_LIST; in d_lru_isolate()
444 if (d_is_negative(dentry)) in d_lru_isolate()
446 list_lru_isolate(lru, &dentry->d_lru); in d_lru_isolate()
449 static void d_lru_shrink_move(struct list_lru_one *lru, struct dentry *dentry, in d_lru_shrink_move() argument
452 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST); in d_lru_shrink_move()
453 dentry->d_flags |= DCACHE_SHRINK_LIST; in d_lru_shrink_move()
454 if (d_is_negative(dentry)) in d_lru_shrink_move()
456 list_lru_isolate_move(lru, &dentry->d_lru, list); in d_lru_shrink_move()
476 static void ___d_drop(struct dentry *dentry) in ___d_drop() argument
484 if (unlikely(IS_ROOT(dentry))) in ___d_drop()
485 b = &dentry->d_sb->s_roots; in ___d_drop()
487 b = d_hash(dentry->d_name.hash); in ___d_drop()
490 __hlist_bl_del(&dentry->d_hash); in ___d_drop()
494 void __d_drop(struct dentry *dentry) in __d_drop() argument
496 if (!d_unhashed(dentry)) { in __d_drop()
497 ___d_drop(dentry); in __d_drop()
498 dentry->d_hash.pprev = NULL; in __d_drop()
499 write_seqcount_invalidate(&dentry->d_seq); in __d_drop()
504 void d_drop(struct dentry *dentry) in d_drop() argument
506 spin_lock(&dentry->d_lock); in d_drop()
507 __d_drop(dentry); in d_drop()
508 spin_unlock(&dentry->d_lock); in d_drop()
512 static inline void dentry_unlist(struct dentry *dentry, struct dentry *parent) in dentry_unlist() argument
514 struct dentry *next; in dentry_unlist()
519 dentry->d_flags |= DCACHE_DENTRY_KILLED; in dentry_unlist()
520 if (unlikely(list_empty(&dentry->d_child))) in dentry_unlist()
522 __list_del_entry(&dentry->d_child); in dentry_unlist()
542 while (dentry->d_child.next != &parent->d_subdirs) { in dentry_unlist()
543 next = list_entry(dentry->d_child.next, struct dentry, d_child); in dentry_unlist()
546 dentry->d_child.next = next->d_child.next; in dentry_unlist()
550 static void __dentry_kill(struct dentry *dentry) in __dentry_kill() argument
552 struct dentry *parent = NULL; in __dentry_kill()
554 if (!IS_ROOT(dentry)) in __dentry_kill()
555 parent = dentry->d_parent; in __dentry_kill()
560 lockref_mark_dead(&dentry->d_lockref); in __dentry_kill()
566 if (dentry->d_flags & DCACHE_OP_PRUNE) in __dentry_kill()
567 dentry->d_op->d_prune(dentry); in __dentry_kill()
569 if (dentry->d_flags & DCACHE_LRU_LIST) { in __dentry_kill()
570 if (!(dentry->d_flags & DCACHE_SHRINK_LIST)) in __dentry_kill()
571 d_lru_del(dentry); in __dentry_kill()
574 __d_drop(dentry); in __dentry_kill()
575 dentry_unlist(dentry, parent); in __dentry_kill()
578 if (dentry->d_inode) in __dentry_kill()
579 dentry_unlink_inode(dentry); in __dentry_kill()
581 spin_unlock(&dentry->d_lock); in __dentry_kill()
583 if (dentry->d_op && dentry->d_op->d_release) in __dentry_kill()
584 dentry->d_op->d_release(dentry); in __dentry_kill()
586 spin_lock(&dentry->d_lock); in __dentry_kill()
587 if (dentry->d_flags & DCACHE_SHRINK_LIST) { in __dentry_kill()
588 dentry->d_flags |= DCACHE_MAY_FREE; in __dentry_kill()
591 spin_unlock(&dentry->d_lock); in __dentry_kill()
593 dentry_free(dentry); in __dentry_kill()
597 static struct dentry *__lock_parent(struct dentry *dentry) in __lock_parent() argument
599 struct dentry *parent; in __lock_parent()
601 spin_unlock(&dentry->d_lock); in __lock_parent()
603 parent = READ_ONCE(dentry->d_parent); in __lock_parent()
613 if (unlikely(parent != dentry->d_parent)) { in __lock_parent()
618 if (parent != dentry) in __lock_parent()
619 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); in __lock_parent()
625 static inline struct dentry *lock_parent(struct dentry *dentry) in lock_parent() argument
627 struct dentry *parent = dentry->d_parent; in lock_parent()
628 if (IS_ROOT(dentry)) in lock_parent()
632 return __lock_parent(dentry); in lock_parent()
635 static inline bool retain_dentry(struct dentry *dentry) in retain_dentry() argument
637 WARN_ON(d_in_lookup(dentry)); in retain_dentry()
640 if (unlikely(d_unhashed(dentry))) in retain_dentry()
643 if (unlikely(dentry->d_flags & DCACHE_DISCONNECTED)) in retain_dentry()
646 if (unlikely(dentry->d_flags & DCACHE_OP_DELETE)) { in retain_dentry()
647 if (dentry->d_op->d_delete(dentry)) in retain_dentry()
651 dentry->d_lockref.count--; in retain_dentry()
652 if (unlikely(!(dentry->d_flags & DCACHE_LRU_LIST))) in retain_dentry()
653 d_lru_add(dentry); in retain_dentry()
654 else if (unlikely(!(dentry->d_flags & DCACHE_REFERENCED))) in retain_dentry()
655 dentry->d_flags |= DCACHE_REFERENCED; in retain_dentry()
664 static struct dentry *dentry_kill(struct dentry *dentry) in dentry_kill() argument
665 __releases(dentry->d_lock) in dentry_kill()
667 struct inode *inode = dentry->d_inode; in dentry_kill()
668 struct dentry *parent = NULL; in dentry_kill()
673 if (!IS_ROOT(dentry)) { in dentry_kill()
674 parent = dentry->d_parent; in dentry_kill()
676 parent = __lock_parent(dentry); in dentry_kill()
677 if (likely(inode || !dentry->d_inode)) in dentry_kill()
682 inode = dentry->d_inode; in dentry_kill()
686 __dentry_kill(dentry); in dentry_kill()
690 spin_unlock(&dentry->d_lock); in dentry_kill()
692 spin_lock(&dentry->d_lock); in dentry_kill()
693 parent = lock_parent(dentry); in dentry_kill()
695 if (unlikely(dentry->d_lockref.count != 1)) { in dentry_kill()
696 dentry->d_lockref.count--; in dentry_kill()
697 } else if (likely(!retain_dentry(dentry))) { in dentry_kill()
698 __dentry_kill(dentry); in dentry_kill()
706 spin_unlock(&dentry->d_lock); in dentry_kill()
718 static inline bool fast_dput(struct dentry *dentry) in fast_dput() argument
727 if (unlikely(dentry->d_flags & DCACHE_OP_DELETE)) in fast_dput()
728 return lockref_put_or_lock(&dentry->d_lockref); in fast_dput()
734 ret = lockref_put_return(&dentry->d_lockref); in fast_dput()
742 spin_lock(&dentry->d_lock); in fast_dput()
743 if (dentry->d_lockref.count > 1) { in fast_dput()
744 dentry->d_lockref.count--; in fast_dput()
745 spin_unlock(&dentry->d_lock); in fast_dput()
779 d_flags = READ_ONCE(dentry->d_flags); in fast_dput()
783 if (d_flags == (DCACHE_REFERENCED | DCACHE_LRU_LIST) && !d_unhashed(dentry)) in fast_dput()
791 spin_lock(&dentry->d_lock); in fast_dput()
799 if (dentry->d_lockref.count) { in fast_dput()
800 spin_unlock(&dentry->d_lock); in fast_dput()
809 dentry->d_lockref.count = 1; in fast_dput()
840 void dput(struct dentry *dentry) in dput() argument
842 while (dentry) { in dput()
846 if (likely(fast_dput(dentry))) { in dput()
854 if (likely(retain_dentry(dentry))) { in dput()
855 spin_unlock(&dentry->d_lock); in dput()
859 dentry = dentry_kill(dentry); in dput()
864 static void __dput_to_list(struct dentry *dentry, struct list_head *list) in __dput_to_list() argument
865 __must_hold(&dentry->d_lock) in __dput_to_list()
867 if (dentry->d_flags & DCACHE_SHRINK_LIST) { in __dput_to_list()
869 --dentry->d_lockref.count; in __dput_to_list()
871 if (dentry->d_flags & DCACHE_LRU_LIST) in __dput_to_list()
872 d_lru_del(dentry); in __dput_to_list()
873 if (!--dentry->d_lockref.count) in __dput_to_list()
874 d_shrink_add(dentry, list); in __dput_to_list()
878 void dput_to_list(struct dentry *dentry, struct list_head *list) in dput_to_list() argument
881 if (likely(fast_dput(dentry))) { in dput_to_list()
886 if (!retain_dentry(dentry)) in dput_to_list()
887 __dput_to_list(dentry, list); in dput_to_list()
888 spin_unlock(&dentry->d_lock); in dput_to_list()
892 static inline void __dget_dlock(struct dentry *dentry) in __dget_dlock() argument
894 dentry->d_lockref.count++; in __dget_dlock()
897 static inline void __dget(struct dentry *dentry) in __dget() argument
899 lockref_get(&dentry->d_lockref); in __dget()
902 struct dentry *dget_parent(struct dentry *dentry) in dget_parent() argument
905 struct dentry *ret; in dget_parent()
912 ret = READ_ONCE(dentry->d_parent); in dget_parent()
916 if (likely(ret == READ_ONCE(dentry->d_parent))) in dget_parent()
927 ret = dentry->d_parent; in dget_parent()
929 if (unlikely(ret != dentry->d_parent)) { in dget_parent()
942 static struct dentry * __d_find_any_alias(struct inode *inode) in __d_find_any_alias()
944 struct dentry *alias; in __d_find_any_alias()
948 alias = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias); in __d_find_any_alias()
960 struct dentry *d_find_any_alias(struct inode *inode) in d_find_any_alias()
962 struct dentry *de; in d_find_any_alias()
985 static struct dentry *__d_find_alias(struct inode *inode) in __d_find_alias()
987 struct dentry *alias; in __d_find_alias()
1004 struct dentry *d_find_alias(struct inode *inode) in d_find_alias()
1006 struct dentry *de = NULL; in d_find_alias()
1023 struct dentry *dentry; in d_prune_aliases() local
1026 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { in d_prune_aliases()
1027 spin_lock(&dentry->d_lock); in d_prune_aliases()
1028 if (!dentry->d_lockref.count) { in d_prune_aliases()
1029 struct dentry *parent = lock_parent(dentry); in d_prune_aliases()
1030 if (likely(!dentry->d_lockref.count)) { in d_prune_aliases()
1031 __dentry_kill(dentry); in d_prune_aliases()
1038 spin_unlock(&dentry->d_lock); in d_prune_aliases()
1055 static bool shrink_lock_dentry(struct dentry *dentry) in shrink_lock_dentry() argument
1058 struct dentry *parent; in shrink_lock_dentry()
1060 if (dentry->d_lockref.count) in shrink_lock_dentry()
1063 inode = dentry->d_inode; in shrink_lock_dentry()
1065 spin_unlock(&dentry->d_lock); in shrink_lock_dentry()
1067 spin_lock(&dentry->d_lock); in shrink_lock_dentry()
1068 if (unlikely(dentry->d_lockref.count)) in shrink_lock_dentry()
1071 if (unlikely(inode != dentry->d_inode)) in shrink_lock_dentry()
1075 parent = dentry->d_parent; in shrink_lock_dentry()
1076 if (IS_ROOT(dentry) || likely(spin_trylock(&parent->d_lock))) in shrink_lock_dentry()
1079 spin_unlock(&dentry->d_lock); in shrink_lock_dentry()
1081 if (unlikely(parent != dentry->d_parent)) { in shrink_lock_dentry()
1083 spin_lock(&dentry->d_lock); in shrink_lock_dentry()
1086 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); in shrink_lock_dentry()
1087 if (likely(!dentry->d_lockref.count)) in shrink_lock_dentry()
1099 struct dentry *dentry, *parent; in shrink_dentry_list() local
1101 dentry = list_entry(list->prev, struct dentry, d_lru); in shrink_dentry_list()
1102 spin_lock(&dentry->d_lock); in shrink_dentry_list()
1104 if (!shrink_lock_dentry(dentry)) { in shrink_dentry_list()
1107 d_shrink_del(dentry); in shrink_dentry_list()
1108 if (dentry->d_lockref.count < 0) in shrink_dentry_list()
1109 can_free = dentry->d_flags & DCACHE_MAY_FREE; in shrink_dentry_list()
1110 spin_unlock(&dentry->d_lock); in shrink_dentry_list()
1112 dentry_free(dentry); in shrink_dentry_list()
1116 d_shrink_del(dentry); in shrink_dentry_list()
1117 parent = dentry->d_parent; in shrink_dentry_list()
1118 if (parent != dentry) in shrink_dentry_list()
1120 __dentry_kill(dentry); in shrink_dentry_list()
1128 struct dentry *dentry = container_of(item, struct dentry, d_lru); in dentry_lru_isolate() local
1136 if (!spin_trylock(&dentry->d_lock)) in dentry_lru_isolate()
1144 if (dentry->d_lockref.count) { in dentry_lru_isolate()
1145 d_lru_isolate(lru, dentry); in dentry_lru_isolate()
1146 spin_unlock(&dentry->d_lock); in dentry_lru_isolate()
1150 if (dentry->d_flags & DCACHE_REFERENCED) { in dentry_lru_isolate()
1151 dentry->d_flags &= ~DCACHE_REFERENCED; in dentry_lru_isolate()
1152 spin_unlock(&dentry->d_lock); in dentry_lru_isolate()
1176 d_lru_shrink_move(lru, dentry, freeable); in dentry_lru_isolate()
1177 spin_unlock(&dentry->d_lock); in dentry_lru_isolate()
1209 struct dentry *dentry = container_of(item, struct dentry, d_lru); in dentry_lru_isolate_shrink() local
1216 if (!spin_trylock(&dentry->d_lock)) in dentry_lru_isolate_shrink()
1219 d_lru_shrink_move(lru, dentry, freeable); in dentry_lru_isolate_shrink()
1220 spin_unlock(&dentry->d_lock); in dentry_lru_isolate_shrink()
1267 static void d_walk(struct dentry *parent, void *data, in d_walk() argument
1268 enum d_walk_ret (*enter)(void *, struct dentry *)) in d_walk()
1270 struct dentry *this_parent; in d_walk()
1297 struct dentry *dentry = list_entry(tmp, struct dentry, d_child); in d_walk() local
1300 if (unlikely(dentry->d_flags & DCACHE_DENTRY_CURSOR)) in d_walk()
1303 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); in d_walk()
1305 ret = enter(data, dentry); in d_walk()
1310 spin_unlock(&dentry->d_lock); in d_walk()
1316 spin_unlock(&dentry->d_lock); in d_walk()
1320 if (!list_empty(&dentry->d_subdirs)) { in d_walk()
1322 spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_); in d_walk()
1323 this_parent = dentry; in d_walk()
1327 spin_unlock(&dentry->d_lock); in d_walk()
1335 struct dentry *child = this_parent; in d_walk()
1349 child = list_entry(next, struct dentry, d_child); in d_walk()
1378 static enum d_walk_ret path_check_mount(void *data, struct dentry *dentry) in path_check_mount() argument
1381 struct path path = { .mnt = info->mnt, .dentry = dentry }; in path_check_mount()
1383 if (likely(!d_mountpoint(dentry))) in path_check_mount()
1405 d_walk(parent->dentry, &data, path_check_mount); in path_has_submounts()
1420 int d_set_mounted(struct dentry *dentry) in d_set_mounted() argument
1422 struct dentry *p; in d_set_mounted()
1425 for (p = dentry->d_parent; !IS_ROOT(p); p = p->d_parent) { in d_set_mounted()
1434 spin_lock(&dentry->d_lock); in d_set_mounted()
1435 if (!d_unlinked(dentry)) { in d_set_mounted()
1437 if (!d_mountpoint(dentry)) { in d_set_mounted()
1438 dentry->d_flags |= DCACHE_MOUNTED; in d_set_mounted()
1442 spin_unlock(&dentry->d_lock); in d_set_mounted()
1464 struct dentry *start;
1467 struct dentry *victim;
1472 static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) in select_collect() argument
1477 if (data->start == dentry) in select_collect()
1480 if (dentry->d_flags & DCACHE_SHRINK_LIST) { in select_collect()
1483 if (dentry->d_flags & DCACHE_LRU_LIST) in select_collect()
1484 d_lru_del(dentry); in select_collect()
1485 if (!dentry->d_lockref.count) { in select_collect()
1486 d_shrink_add(dentry, &data->dispose); in select_collect()
1501 static enum d_walk_ret select_collect2(void *_data, struct dentry *dentry) in select_collect2() argument
1506 if (data->start == dentry) in select_collect2()
1509 if (dentry->d_flags & DCACHE_SHRINK_LIST) { in select_collect2()
1510 if (!dentry->d_lockref.count) { in select_collect2()
1512 data->victim = dentry; in select_collect2()
1516 if (dentry->d_flags & DCACHE_LRU_LIST) in select_collect2()
1517 d_lru_del(dentry); in select_collect2()
1518 if (!dentry->d_lockref.count) in select_collect2()
1519 d_shrink_add(dentry, &data->dispose); in select_collect2()
1538 void shrink_dcache_parent(struct dentry *parent) in shrink_dcache_parent()
1557 struct dentry *parent; in shrink_dcache_parent()
1576 static enum d_walk_ret umount_check(void *_data, struct dentry *dentry) in umount_check() argument
1579 if (!list_empty(&dentry->d_subdirs)) in umount_check()
1583 if (dentry == _data && dentry->d_lockref.count == 1) in umount_check()
1588 dentry, in umount_check()
1589 dentry->d_inode ? in umount_check()
1590 dentry->d_inode->i_ino : 0UL, in umount_check()
1591 dentry, in umount_check()
1592 dentry->d_lockref.count, in umount_check()
1593 dentry->d_sb->s_type->name, in umount_check()
1594 dentry->d_sb->s_id); in umount_check()
1599 static void do_one_tree(struct dentry *dentry) in do_one_tree() argument
1601 shrink_dcache_parent(dentry); in do_one_tree()
1602 d_walk(dentry, dentry, umount_check); in do_one_tree()
1603 d_drop(dentry); in do_one_tree()
1604 dput(dentry); in do_one_tree()
1612 struct dentry *dentry; in shrink_dcache_for_umount() local
1616 dentry = sb->s_root; in shrink_dcache_for_umount()
1618 do_one_tree(dentry); in shrink_dcache_for_umount()
1621 dentry = dget(hlist_bl_entry(hlist_bl_first(&sb->s_roots), struct dentry, d_hash)); in shrink_dcache_for_umount()
1622 do_one_tree(dentry); in shrink_dcache_for_umount()
1626 static enum d_walk_ret find_submount(void *_data, struct dentry *dentry) in find_submount() argument
1628 struct dentry **victim = _data; in find_submount()
1629 if (d_mountpoint(dentry)) { in find_submount()
1630 __dget_dlock(dentry); in find_submount()
1631 *victim = dentry; in find_submount()
1641 void d_invalidate(struct dentry *dentry) in d_invalidate() argument
1644 spin_lock(&dentry->d_lock); in d_invalidate()
1645 if (d_unhashed(dentry)) { in d_invalidate()
1646 spin_unlock(&dentry->d_lock); in d_invalidate()
1649 __d_drop(dentry); in d_invalidate()
1650 spin_unlock(&dentry->d_lock); in d_invalidate()
1653 if (!dentry->d_inode) in d_invalidate()
1656 shrink_dcache_parent(dentry); in d_invalidate()
1658 struct dentry *victim = NULL; in d_invalidate()
1659 d_walk(dentry, &victim, find_submount); in d_invalidate()
1662 shrink_dcache_parent(dentry); in d_invalidate()
1682 struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name) in __d_alloc()
1684 struct dentry *dentry; in __d_alloc() local
1688 dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); in __d_alloc()
1689 if (!dentry) in __d_alloc()
1698 dentry->d_iname[DNAME_INLINE_LEN-1] = 0; in __d_alloc()
1701 dname = dentry->d_iname; in __d_alloc()
1708 kmem_cache_free(dentry_cache, dentry); in __d_alloc()
1714 dname = dentry->d_iname; in __d_alloc()
1717 dentry->d_name.len = name->len; in __d_alloc()
1718 dentry->d_name.hash = name->hash; in __d_alloc()
1723 smp_store_release(&dentry->d_name.name, dname); /* ^^^ */ in __d_alloc()
1725 dentry->d_lockref.count = 1; in __d_alloc()
1726 dentry->d_flags = 0; in __d_alloc()
1727 spin_lock_init(&dentry->d_lock); in __d_alloc()
1728 seqcount_init(&dentry->d_seq); in __d_alloc()
1729 dentry->d_inode = NULL; in __d_alloc()
1730 dentry->d_parent = dentry; in __d_alloc()
1731 dentry->d_sb = sb; in __d_alloc()
1732 dentry->d_op = NULL; in __d_alloc()
1733 dentry->d_fsdata = NULL; in __d_alloc()
1734 INIT_HLIST_BL_NODE(&dentry->d_hash); in __d_alloc()
1735 INIT_LIST_HEAD(&dentry->d_lru); in __d_alloc()
1736 INIT_LIST_HEAD(&dentry->d_subdirs); in __d_alloc()
1737 INIT_HLIST_NODE(&dentry->d_u.d_alias); in __d_alloc()
1738 INIT_LIST_HEAD(&dentry->d_child); in __d_alloc()
1739 d_set_d_op(dentry, dentry->d_sb->s_d_op); in __d_alloc()
1741 if (dentry->d_op && dentry->d_op->d_init) { in __d_alloc()
1742 err = dentry->d_op->d_init(dentry); in __d_alloc()
1744 if (dname_external(dentry)) in __d_alloc()
1745 kfree(external_name(dentry)); in __d_alloc()
1746 kmem_cache_free(dentry_cache, dentry); in __d_alloc()
1753 return dentry; in __d_alloc()
1765 struct dentry *d_alloc(struct dentry * parent, const struct qstr *name) in d_alloc()
1767 struct dentry *dentry = __d_alloc(parent->d_sb, name); in d_alloc() local
1768 if (!dentry) in d_alloc()
1776 dentry->d_parent = parent; in d_alloc()
1777 list_add(&dentry->d_child, &parent->d_subdirs); in d_alloc()
1780 return dentry; in d_alloc()
1784 struct dentry *d_alloc_anon(struct super_block *sb) in d_alloc_anon()
1790 struct dentry *d_alloc_cursor(struct dentry * parent) in d_alloc_cursor()
1792 struct dentry *dentry = d_alloc_anon(parent->d_sb); in d_alloc_cursor() local
1793 if (dentry) { in d_alloc_cursor()
1794 dentry->d_flags |= DCACHE_DENTRY_CURSOR; in d_alloc_cursor()
1795 dentry->d_parent = dget(parent); in d_alloc_cursor()
1797 return dentry; in d_alloc_cursor()
1815 struct dentry *d_alloc_pseudo(struct super_block *sb, const struct qstr *name) in d_alloc_pseudo()
1817 struct dentry *dentry = __d_alloc(sb, name); in d_alloc_pseudo() local
1818 if (likely(dentry)) in d_alloc_pseudo()
1819 dentry->d_flags |= DCACHE_NORCU; in d_alloc_pseudo()
1820 return dentry; in d_alloc_pseudo()
1823 struct dentry *d_alloc_name(struct dentry *parent, const char *name) in d_alloc_name()
1833 void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op) in d_set_d_op() argument
1835 WARN_ON_ONCE(dentry->d_op); in d_set_d_op()
1836 WARN_ON_ONCE(dentry->d_flags & (DCACHE_OP_HASH | in d_set_d_op()
1842 dentry->d_op = op; in d_set_d_op()
1846 dentry->d_flags |= DCACHE_OP_HASH; in d_set_d_op()
1848 dentry->d_flags |= DCACHE_OP_COMPARE; in d_set_d_op()
1850 dentry->d_flags |= DCACHE_OP_REVALIDATE; in d_set_d_op()
1852 dentry->d_flags |= DCACHE_OP_WEAK_REVALIDATE; in d_set_d_op()
1854 dentry->d_flags |= DCACHE_OP_DELETE; in d_set_d_op()
1856 dentry->d_flags |= DCACHE_OP_PRUNE; in d_set_d_op()
1858 dentry->d_flags |= DCACHE_OP_REAL; in d_set_d_op()
1871 void d_set_fallthru(struct dentry *dentry) in d_set_fallthru() argument
1873 spin_lock(&dentry->d_lock); in d_set_fallthru()
1874 dentry->d_flags |= DCACHE_FALLTHRU; in d_set_fallthru()
1875 spin_unlock(&dentry->d_lock); in d_set_fallthru()
1914 static void __d_instantiate(struct dentry *dentry, struct inode *inode) in __d_instantiate() argument
1917 WARN_ON(d_in_lookup(dentry)); in __d_instantiate()
1919 spin_lock(&dentry->d_lock); in __d_instantiate()
1923 if (dentry->d_flags & DCACHE_LRU_LIST) in __d_instantiate()
1925 hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); in __d_instantiate()
1926 raw_write_seqcount_begin(&dentry->d_seq); in __d_instantiate()
1927 __d_set_inode_and_type(dentry, inode, add_flags); in __d_instantiate()
1928 raw_write_seqcount_end(&dentry->d_seq); in __d_instantiate()
1929 fsnotify_update_flags(dentry); in __d_instantiate()
1930 spin_unlock(&dentry->d_lock); in __d_instantiate()
1948 void d_instantiate(struct dentry *entry, struct inode * inode) in d_instantiate()
1966 void d_instantiate_new(struct dentry *entry, struct inode *inode) in d_instantiate_new()
1982 struct dentry *d_make_root(struct inode *root_inode) in d_make_root()
1984 struct dentry *res = NULL; in d_make_root()
1997 static struct dentry *__d_instantiate_anon(struct dentry *dentry, in __d_instantiate_anon() argument
2001 struct dentry *res; in __d_instantiate_anon()
2004 security_d_instantiate(dentry, inode); in __d_instantiate_anon()
2009 dput(dentry); in __d_instantiate_anon()
2019 spin_lock(&dentry->d_lock); in __d_instantiate_anon()
2020 __d_set_inode_and_type(dentry, inode, add_flags); in __d_instantiate_anon()
2021 hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); in __d_instantiate_anon()
2023 hlist_bl_lock(&dentry->d_sb->s_roots); in __d_instantiate_anon()
2024 hlist_bl_add_head(&dentry->d_hash, &dentry->d_sb->s_roots); in __d_instantiate_anon()
2025 hlist_bl_unlock(&dentry->d_sb->s_roots); in __d_instantiate_anon()
2027 spin_unlock(&dentry->d_lock); in __d_instantiate_anon()
2030 return dentry; in __d_instantiate_anon()
2037 struct dentry *d_instantiate_anon(struct dentry *dentry, struct inode *inode) in d_instantiate_anon() argument
2039 return __d_instantiate_anon(dentry, inode, true); in d_instantiate_anon()
2043 static struct dentry *__d_obtain_alias(struct inode *inode, bool disconnected) in __d_obtain_alias()
2045 struct dentry *tmp; in __d_obtain_alias()
2046 struct dentry *res; in __d_obtain_alias()
2088 struct dentry *d_obtain_alias(struct inode *inode) in d_obtain_alias()
2109 struct dentry *d_obtain_root(struct inode *inode) in d_obtain_root()
2131 struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode, in d_add_ci() argument
2134 struct dentry *found, *res; in d_add_ci()
2140 found = d_hash_and_lookup(dentry->d_parent, name); in d_add_ci()
2145 if (d_in_lookup(dentry)) { in d_add_ci()
2146 found = d_alloc_parallel(dentry->d_parent, name, in d_add_ci()
2147 dentry->d_wait); in d_add_ci()
2153 found = d_alloc(dentry->d_parent, name); in d_add_ci()
2169 static inline bool d_same_name(const struct dentry *dentry, in d_same_name() argument
2170 const struct dentry *parent, in d_same_name()
2174 if (dentry->d_name.len != name->len) in d_same_name()
2176 return dentry_cmp(dentry, name->name, name->len) == 0; in d_same_name()
2178 return parent->d_op->d_compare(dentry, in d_same_name()
2179 dentry->d_name.len, dentry->d_name.name, in d_same_name()
2212 struct dentry *__d_lookup_rcu(const struct dentry *parent, in __d_lookup_rcu()
2220 struct dentry *dentry; in __d_lookup_rcu() local
2242 hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { in __d_lookup_rcu()
2263 seq = raw_seqcount_begin(&dentry->d_seq); in __d_lookup_rcu()
2264 if (dentry->d_parent != parent) in __d_lookup_rcu()
2266 if (d_unhashed(dentry)) in __d_lookup_rcu()
2272 if (dentry->d_name.hash != hashlen_hash(hashlen)) in __d_lookup_rcu()
2274 tlen = dentry->d_name.len; in __d_lookup_rcu()
2275 tname = dentry->d_name.name; in __d_lookup_rcu()
2277 if (read_seqcount_retry(&dentry->d_seq, seq)) { in __d_lookup_rcu()
2281 if (parent->d_op->d_compare(dentry, in __d_lookup_rcu()
2285 if (dentry->d_name.hash_len != hashlen) in __d_lookup_rcu()
2287 if (dentry_cmp(dentry, str, hashlen_len(hashlen)) != 0) in __d_lookup_rcu()
2291 return dentry; in __d_lookup_rcu()
2307 struct dentry *d_lookup(const struct dentry *parent, const struct qstr *name) in d_lookup()
2309 struct dentry *dentry; in d_lookup() local
2314 dentry = __d_lookup(parent, name); in d_lookup()
2315 if (dentry) in d_lookup()
2318 return dentry; in d_lookup()
2337 struct dentry *__d_lookup(const struct dentry *parent, const struct qstr *name) in __d_lookup()
2342 struct dentry *found = NULL; in __d_lookup()
2343 struct dentry *dentry; in __d_lookup() local
2367 hlist_bl_for_each_entry_rcu(dentry, node, b, d_hash) { in __d_lookup()
2369 if (dentry->d_name.hash != hash) in __d_lookup()
2372 spin_lock(&dentry->d_lock); in __d_lookup()
2373 if (dentry->d_parent != parent) in __d_lookup()
2375 if (d_unhashed(dentry)) in __d_lookup()
2378 if (!d_same_name(dentry, parent, name)) in __d_lookup()
2381 dentry->d_lockref.count++; in __d_lookup()
2382 found = dentry; in __d_lookup()
2383 spin_unlock(&dentry->d_lock); in __d_lookup()
2386 spin_unlock(&dentry->d_lock); in __d_lookup()
2400 struct dentry *d_hash_and_lookup(struct dentry *dir, struct qstr *name) in d_hash_and_lookup()
2438 void d_delete(struct dentry * dentry) in d_delete() argument
2440 struct inode *inode = dentry->d_inode; in d_delete()
2443 spin_lock(&dentry->d_lock); in d_delete()
2447 if (dentry->d_lockref.count == 1) { in d_delete()
2448 dentry->d_flags &= ~DCACHE_CANT_MOUNT; in d_delete()
2449 dentry_unlink_inode(dentry); in d_delete()
2451 __d_drop(dentry); in d_delete()
2452 spin_unlock(&dentry->d_lock); in d_delete()
2458 static void __d_rehash(struct dentry *entry) in __d_rehash()
2474 void d_rehash(struct dentry * entry) in d_rehash()
2498 static void d_wait_lookup(struct dentry *dentry) in d_wait_lookup() argument
2500 if (d_in_lookup(dentry)) { in d_wait_lookup()
2502 add_wait_queue(dentry->d_wait, &wait); in d_wait_lookup()
2505 spin_unlock(&dentry->d_lock); in d_wait_lookup()
2507 spin_lock(&dentry->d_lock); in d_wait_lookup()
2508 } while (d_in_lookup(dentry)); in d_wait_lookup()
2512 struct dentry *d_alloc_parallel(struct dentry *parent, in d_alloc_parallel()
2519 struct dentry *new = d_alloc(parent, name); in d_alloc_parallel()
2520 struct dentry *dentry; in d_alloc_parallel() local
2530 dentry = __d_lookup_rcu(parent, name, &d_seq); in d_alloc_parallel()
2531 if (unlikely(dentry)) { in d_alloc_parallel()
2532 if (!lockref_get_not_dead(&dentry->d_lockref)) { in d_alloc_parallel()
2536 if (read_seqcount_retry(&dentry->d_seq, d_seq)) { in d_alloc_parallel()
2538 dput(dentry); in d_alloc_parallel()
2543 return dentry; in d_alloc_parallel()
2568 hlist_bl_for_each_entry(dentry, node, b, d_u.d_in_lookup_hash) { in d_alloc_parallel()
2569 if (dentry->d_name.hash != hash) in d_alloc_parallel()
2571 if (dentry->d_parent != parent) in d_alloc_parallel()
2573 if (!d_same_name(dentry, parent, name)) in d_alloc_parallel()
2577 if (!lockref_get_not_dead(&dentry->d_lockref)) { in d_alloc_parallel()
2587 spin_lock(&dentry->d_lock); in d_alloc_parallel()
2588 d_wait_lookup(dentry); in d_alloc_parallel()
2595 if (unlikely(dentry->d_name.hash != hash)) in d_alloc_parallel()
2597 if (unlikely(dentry->d_parent != parent)) in d_alloc_parallel()
2599 if (unlikely(d_unhashed(dentry))) in d_alloc_parallel()
2601 if (unlikely(!d_same_name(dentry, parent, name))) in d_alloc_parallel()
2604 spin_unlock(&dentry->d_lock); in d_alloc_parallel()
2606 return dentry; in d_alloc_parallel()
2616 spin_unlock(&dentry->d_lock); in d_alloc_parallel()
2617 dput(dentry); in d_alloc_parallel()
2622 void __d_lookup_done(struct dentry *dentry) in __d_lookup_done() argument
2624 struct hlist_bl_head *b = in_lookup_hash(dentry->d_parent, in __d_lookup_done()
2625 dentry->d_name.hash); in __d_lookup_done()
2627 dentry->d_flags &= ~DCACHE_PAR_LOOKUP; in __d_lookup_done()
2628 __hlist_bl_del(&dentry->d_u.d_in_lookup_hash); in __d_lookup_done()
2629 wake_up_all(dentry->d_wait); in __d_lookup_done()
2630 dentry->d_wait = NULL; in __d_lookup_done()
2632 INIT_HLIST_NODE(&dentry->d_u.d_alias); in __d_lookup_done()
2633 INIT_LIST_HEAD(&dentry->d_lru); in __d_lookup_done()
2639 static inline void __d_add(struct dentry *dentry, struct inode *inode) in __d_add() argument
2643 spin_lock(&dentry->d_lock); in __d_add()
2644 if (unlikely(d_in_lookup(dentry))) { in __d_add()
2645 dir = dentry->d_parent->d_inode; in __d_add()
2647 __d_lookup_done(dentry); in __d_add()
2651 hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry); in __d_add()
2652 raw_write_seqcount_begin(&dentry->d_seq); in __d_add()
2653 __d_set_inode_and_type(dentry, inode, add_flags); in __d_add()
2654 raw_write_seqcount_end(&dentry->d_seq); in __d_add()
2655 fsnotify_update_flags(dentry); in __d_add()
2657 __d_rehash(dentry); in __d_add()
2660 spin_unlock(&dentry->d_lock); in __d_add()
2674 void d_add(struct dentry *entry, struct inode *inode) in d_add()
2695 struct dentry *d_exact_alias(struct dentry *entry, struct inode *inode) in d_exact_alias()
2697 struct dentry *alias; in d_exact_alias()
2730 static void swap_names(struct dentry *dentry, struct dentry *target) in swap_names() argument
2733 if (unlikely(dname_external(dentry))) { in swap_names()
2737 swap(target->d_name.name, dentry->d_name.name); in swap_names()
2743 memcpy(target->d_iname, dentry->d_name.name, in swap_names()
2744 dentry->d_name.len + 1); in swap_names()
2745 dentry->d_name.name = target->d_name.name; in swap_names()
2749 if (unlikely(dname_external(dentry))) { in swap_names()
2754 memcpy(dentry->d_iname, target->d_name.name, in swap_names()
2756 target->d_name.name = dentry->d_name.name; in swap_names()
2757 dentry->d_name.name = dentry->d_iname; in swap_names()
2765 swap(((long *) &dentry->d_iname)[i], in swap_names()
2770 swap(dentry->d_name.hash_len, target->d_name.hash_len); in swap_names()
2773 static void copy_name(struct dentry *dentry, struct dentry *target) in copy_name() argument
2776 if (unlikely(dname_external(dentry))) in copy_name()
2777 old_name = external_name(dentry); in copy_name()
2780 dentry->d_name = target->d_name; in copy_name()
2782 memcpy(dentry->d_iname, target->d_name.name, in copy_name()
2784 dentry->d_name.name = dentry->d_iname; in copy_name()
2785 dentry->d_name.hash_len = target->d_name.hash_len; in copy_name()
2802 static void __d_move(struct dentry *dentry, struct dentry *target, in __d_move() argument
2805 struct dentry *old_parent, *p; in __d_move()
2809 WARN_ON(!dentry->d_inode); in __d_move()
2810 if (WARN_ON(dentry == target)) in __d_move()
2813 BUG_ON(d_ancestor(target, dentry)); in __d_move()
2814 old_parent = dentry->d_parent; in __d_move()
2816 if (IS_ROOT(dentry)) { in __d_move()
2824 BUG_ON(p == dentry); in __d_move()
2830 spin_lock_nested(&dentry->d_lock, 2); in __d_move()
2839 write_seqcount_begin(&dentry->d_seq); in __d_move()
2843 if (!d_unhashed(dentry)) in __d_move()
2844 ___d_drop(dentry); in __d_move()
2849 dentry->d_parent = target->d_parent; in __d_move()
2851 copy_name(dentry, target); in __d_move()
2853 dentry->d_parent->d_lockref.count++; in __d_move()
2854 if (dentry != old_parent) /* wasn't IS_ROOT */ in __d_move()
2858 swap_names(dentry, target); in __d_move()
2863 list_move(&dentry->d_child, &dentry->d_parent->d_subdirs); in __d_move()
2864 __d_rehash(dentry); in __d_move()
2865 fsnotify_update_flags(dentry); in __d_move()
2866 fscrypt_handle_d_move(dentry); in __d_move()
2869 write_seqcount_end(&dentry->d_seq); in __d_move()
2874 if (dentry->d_parent != old_parent) in __d_move()
2875 spin_unlock(&dentry->d_parent->d_lock); in __d_move()
2876 if (dentry != old_parent) in __d_move()
2879 spin_unlock(&dentry->d_lock); in __d_move()
2891 void d_move(struct dentry *dentry, struct dentry *target) in d_move() argument
2894 __d_move(dentry, target, false); in d_move()
2904 void d_exchange(struct dentry *dentry1, struct dentry *dentry2) in d_exchange()
2926 struct dentry *d_ancestor(struct dentry *p1, struct dentry *p2) in d_ancestor()
2928 struct dentry *p; in d_ancestor()
2947 struct dentry *dentry, struct dentry *alias) in __d_unalias() argument
2954 if (alias->d_parent == dentry->d_parent) in __d_unalias()
2958 if (!mutex_trylock(&dentry->d_sb->s_vfs_rename_mutex)) in __d_unalias()
2960 m1 = &dentry->d_sb->s_vfs_rename_mutex; in __d_unalias()
2965 __d_move(alias, dentry, false); in __d_unalias()
2998 struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) in d_splice_alias() argument
3003 BUG_ON(!d_unhashed(dentry)); in d_splice_alias()
3008 security_d_instantiate(dentry, inode); in d_splice_alias()
3011 struct dentry *new = __d_find_any_alias(inode); in d_splice_alias()
3016 if (unlikely(d_ancestor(new, dentry))) { in d_splice_alias()
3023 dentry->d_name.name, in d_splice_alias()
3027 struct dentry *old_parent = dget(new->d_parent); in d_splice_alias()
3028 int err = __d_unalias(inode, dentry, new); in d_splice_alias()
3036 __d_move(new, dentry, false); in d_splice_alias()
3044 __d_add(dentry, inode); in d_splice_alias()
3065 bool is_subdir(struct dentry *new_dentry, struct dentry *old_dentry) in is_subdir()
3092 static enum d_walk_ret d_genocide_kill(void *data, struct dentry *dentry) in d_genocide_kill() argument
3094 struct dentry *root = data; in d_genocide_kill()
3095 if (dentry != root) { in d_genocide_kill()
3096 if (d_unhashed(dentry) || !dentry->d_inode) in d_genocide_kill()
3099 if (!(dentry->d_flags & DCACHE_GENOCIDE)) { in d_genocide_kill()
3100 dentry->d_flags |= DCACHE_GENOCIDE; in d_genocide_kill()
3101 dentry->d_lockref.count--; in d_genocide_kill()
3107 void d_genocide(struct dentry *parent) in d_genocide()
3114 void d_tmpfile(struct dentry *dentry, struct inode *inode) in d_tmpfile() argument
3117 BUG_ON(dentry->d_name.name != dentry->d_iname || in d_tmpfile()
3118 !hlist_unhashed(&dentry->d_u.d_alias) || in d_tmpfile()
3119 !d_unlinked(dentry)); in d_tmpfile()
3120 spin_lock(&dentry->d_parent->d_lock); in d_tmpfile()
3121 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); in d_tmpfile()
3122 dentry->d_name.len = sprintf(dentry->d_iname, "#%llu", in d_tmpfile()
3124 spin_unlock(&dentry->d_lock); in d_tmpfile()
3125 spin_unlock(&dentry->d_parent->d_lock); in d_tmpfile()
3126 d_instantiate(dentry, inode); in d_tmpfile()
3168 dentry_cache = KMEM_CACHE_USERCOPY(dentry, in dcache_init()