函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\d_path.c Create Date:2022-07-29 10:42:51
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:prepend_path - Prepend path string to a buffer*@path: the dentry/vfsmount to report*@root: root vfsmnt/dentry*@buffer: pointer to the end of the buffer*@buflen: pointer to buffer length* The function will first try to write out the pathname without taking

函数原型:static int prepend_path(const struct path *path, const struct path *root, char **buffer, int *buflen)

返回类型:int

参数:

类型参数名称
const struct path *path
const struct path *root
char **buffer
int *buflen
82  error等于0
83  m_seq等于0
87  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
88  restart_mnt :
89  ad_seqbegin_or_lock - begin a sequence number check or locking block*@lock: sequence lock*@seq : sequence number to be checked* First try it once optimistically without taking the lock. If that fails,* take the lock
90  seq等于0
91  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
92  restart :
93  bptr等于buffer
94  blen等于buflen
95  error等于0
96  dentry等于dentry
97  vfsmnt等于mnt
98  mnt等于real_mount(vfsmnt)
99  ad_seqbegin_or_lock - begin a sequence number check or locking block*@lock: sequence lock*@seq : sequence number to be checked* First try it once optimistically without taking the lock. If that fails,* take the lock
100 dentry不等于dentryvfsmnt不等于mnt循环
106  如果dentry不等于 root of the mounted tree
107  bptr等于buffer
108  blen等于buflen
109  error等于3
110  退出
113  如果mnt不等于parent
115  mnt等于parent
116  vfsmnt等于mnt
117  继续下一循环
121  否则error等于2
123  退出
125  parent等于 parent directory
126  Prefetch instructions for Pentium III (+) and AMD Athlon (+)* It's not worth to care about 3dnow prefetches for the K6* because they are microcoded there and very slow.
127  error等于prepend_name - prepend a pathname in front of current buffer pointer*@buffer: buffer pointer*@buflen: allocated length of the buffer*@name: name string and length qstr structure* With RCU path tracing, it may race with d_move()
128  如果error退出
131  dentry等于parent
133  如果非seq按位与1的值则_read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
135  如果need_seqretry( & rename_lock, seq)则
136  seq等于1
137  转到:restart
139  done_seqretry( & rename_lock, seq)
141  如果非m_seq按位与1的值则_read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
143  如果need_seqretry( & vfsmount lock may be taken for read to prevent changes to the* vfsmount hash, ie. during mountpoint lookups or walking back* up the tree.* It should be taken for write in all cases where the vfsmount, m_seq)则
144  m_seq等于1
145  转到:restart_mnt
147  done_seqretry( & vfsmount lock may be taken for read to prevent changes to the* vfsmount hash, ie. during mountpoint lookups or walking back* up the tree.* It should be taken for write in all cases where the vfsmount, m_seq)
149  如果error大于等于0且bptr恒等于buffer
150  如果blen先自减小于0则error等于负ENAMETOOLONG
152  否则*bptr先自减等于'/'
155  buffer等于bptr
156  buflen等于blen
157  返回:error
调用者
名称描述
__d_path__d_path - return the path of a dentry*@path: the dentry/vfsmount to report*@root: root vfsmnt/dentry*@buf: buffer to return value in*@buflen: buffer length* Convert a dentry into an ASCII path name
d_absolute_path
path_with_deletedsame as __d_path but appends "(deleted)" for unlinked files.
SYSCALL_DEFINE2NOTE! The user-level library version returns a* character pointer