函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\dcache.c Create Date:2022-07-29 10:37:36
Last Modify:2020-03-18 10:27:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__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

函数原型:static void __d_move(struct dentry *dentry, struct dentry *target, bool exchange)

返回类型:void

参数:

类型参数名称
struct dentry *dentry
struct dentry *target
boolexchange
2808  struct inode * dir = NULL
2811  WARN_ON(! Where the name belongs to - NULL is * negative )
2812  如果WARN_ON(dentry == target)则返回
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  如果linux/include/linux/dcache.h* Dirent cache data structures* (C) Copyright 1997 Thomas Schoebel-Theuer,* with heavy changes by Linus Torvalds(dentry)则
2819  BUG_ON(p)
2820  加自旋锁
2821  否则如果非p
2823  加自旋锁
2824  spin_lock_nested( & d_lock, DENTRY_D_LOCK_NESTED)
2825  否则
2826  BUG_ON(p == dentry)
2827  加自旋锁
2828  如果p不等于targetspin_lock_nested( & d_lock, DENTRY_D_LOCK_NESTED)
2832  spin_lock_nested( & d_lock, 2)
2833  spin_lock_nested( & d_lock, 3)
2835  如果此条件成立可能性小(为编译器优化)(d_in_lookup(target))则
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  如果非目录项存在于哈希中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  如果非目录项存在于哈希中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  如果非exchange
2853  copy_name(dentry, target)
2854  pprev = NULL
2855  count自加
2856  如果dentry不等于old_parentWARN_ON(!--count)
2858  否则
2859  parent directory 等于old_parent
2860  swap_names(dentry, target)
2861  链表项移动到头部
2862  __d_rehash(target)
2863  fsnotify_update_flags(target)
2865  链表项移动到头部
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  如果dirend_dir_add(dir, n)
2876  如果 parent directory 不等于old_parent自旋锁解锁
2878  如果dentry不等于old_parent自旋锁解锁
2880  自旋锁解锁
2881  自旋锁解锁
调用者
名称描述
d_move改变目录项
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_alias链接目录项