Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\d_path.c Create Date:2022-07-28 20:12:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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

Proto:static int prepend_path(const struct path *path, const struct path *root, char **buffer, int *buflen)

Type:int

Parameter:

TypeParameterName
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  When dentry != dentry || vfsmnt != mnt cycle
107  bptr = buffer
108  blen = buflen
109  error = 3
110  Break
113  If mnt != parent Then
115  mnt = parent
116  vfsmnt = mnt
117  Continue
121  Else error = 2
123  Break
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  If error Then Break
131  dentry = parent
133  If Not (seq & 1) Then _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  If need_seqretry( & rename_lock, seq) Then
136  seq = 1
137  Go to restart
139  done_seqretry( & rename_lock, seq)
141  If Not (m_seq & 1) Then _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  If 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) Then
144  m_seq = 1
145  Go to 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  If error >= 0 && bptr == buffer Then
150  If --blen < 0 Then error = -ENAMETOOLONG
152  Else *--bptr = '/'
155  buffer = bptr
156  buflen = blen
157  Return error
Caller
NameDescribe
__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