Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dcache.c Create Date:2022-07-28 20:07:30
Last Modify:2020-03-18 10:27:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:__d_move - move a dentry*@dentry: entry to move*@target: new dentry*@exchange: exchange the two dentries* Update the dcache to reflect the move of a file name

Proto:static void __d_move(struct dentry *dentry, struct dentry *target, bool exchange)

Type:void

Parameter:

TypeParameterName
struct dentry *dentry
struct dentry *target
boolexchange
2808  struct inode * dir = NULL
2811  WARN_ON(! Where the name belongs to - NULL is * negative )
2812  If WARN_ON(dentry == target) Then Return
2815  BUG_ON(d_ancestor - search for an ancestor*@p1: ancestor dentry*@p2: child dentry* Returns the ancestor dentry of p2 which is a child of p1, if p1 is* an ancestor of p2, else NULL.)
2816  old_parent = parent directory
2817  p = d_ancestor - search for an ancestor*@p1: ancestor dentry*@p2: child dentry* Returns the ancestor dentry of p2 which is a child of p1, if p1 is* an ancestor of p2, else NULL.
2818  If linux/include/linux/dcache.h* Dirent cache data structures* (C) Copyright 1997 Thomas Schoebel-Theuer,* with heavy changes by Linus Torvalds(dentry) Then
2819  BUG_ON(p)
2820  spin_lock( & d_lock)
2821  Else if Not p Then
2823  spin_lock( & d_lock)
2824  spin_lock_nested( & d_lock, DENTRY_D_LOCK_NESTED)
2825  Else
2826  BUG_ON(p == dentry)
2827  spin_lock( & d_lock)
2828  If p != target Then spin_lock_nested( & d_lock, DENTRY_D_LOCK_NESTED)
2832  spin_lock_nested( & d_lock, 2)
2833  spin_lock_nested( & d_lock, 3)
2835  If Value for the false possibility is greater at compile time(d_in_lookup(target)) Then
2836  dir = Where the name belongs to - NULL is * negative
2837  n = start_dir_add(dir)
2838  __d_lookup_done(target)
2841  write_seqcount_begin( & per dentry seqlock )
2842  Sequence counter only version assumes that callers are using their* own mutexing.
2845  If Not d_unhashed - is dentry hashed*@dentry: entry to check* Returns true if the dentry passed is not currently hashed. Then d_drop - drop a dentry*@dentry: dentry to drop* d_drop() unhashes the entry from the parent dentry hashes, so that it won't* be found through a VFS lookup any more
2847  If Not d_unhashed - is dentry hashed*@dentry: entry to check* Returns true if the dentry passed is not currently hashed. Then d_drop - drop a dentry*@dentry: dentry to drop* d_drop() unhashes the entry from the parent dentry hashes, so that it won't* be found through a VFS lookup any more
2851  parent directory = parent directory
2852  If Not exchange Then
2853  copy_name(dentry, target)
2854  pprev = NULL
2855  count++
2856  If dentry != old_parent Then WARN_ON(!--count)
2858  Else
2859  parent directory = old_parent
2860  swap_names(dentry, target)
2861  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
2862  __d_rehash(target)
2863  fsnotify_update_flags(target)
2865  list_move - delete from one list and add as another's head*@list: the entry to move*@head: the head that will precede our entry
2866  __d_rehash(dentry)
2867  fsnotify_update_flags(dentry)
2868  fscrypt_handle_d_move(dentry)
2870  write_seqcount_end( & per dentry seqlock )
2871  write_seqcount_end( & per dentry seqlock )
2873  If dir Then end_dir_add(dir, n)
2876  If parent directory != old_parent Then spin_unlock( & d_lock)
2878  If dentry != old_parent Then spin_unlock( & d_lock)
2880  spin_unlock( & d_lock)
2881  spin_unlock( & d_lock)
Caller
NameDescribe
d_movemove a dentry
d_exchanged_exchange - exchange two dentries*@dentry1: first dentry*@dentry2: second dentry
__d_unaliasThis helper attempts to cope with remotely renamed directories* It assumes that the caller is already holding* Note: If ever the locking in lock_rename() changes, then please* remember to update this too...
d_splice_aliassplice a disconnected dentry into the tree if one exists