Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:And here is where the userspace process can look up the cookie value* to retrieve the path.

Proto:static int do_lookup_dcookie(u64 cookie64, char __user *buf, size_t len)

Type:int

Parameter:

TypeParameterName
u64cookie64
char __user *buf
size_tlen
152  cookie = cookie64
153  err = -EINVAL
162  If Not Check operation authority Then Return -EPERM
165  mutex_lock( & dcookie_mutex)
167  If Not is_live() Then
168  err = -EINVAL
169  Go to out
172  If Not (dcs = find_dcookie(cookie)) Then Go to out
175  err = -ENOMEM
176  kbuf = Allocation memory
177  If Not kbuf Then Go to out
181  path = d_path - return the path of a dentry*@path: path to report*@buf: buffer to return value in*@buflen: buffer length* Convert a dentry into an ASCII path name
183  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
185  If IS_ERR(path) Then
186  err = PTR_ERR(path)
187  Go to out_free
190  err = -ERANGE
192  pathlen = kbuf + PAGE_SIZE - path
193  If pathlen <= len Then
194  err = pathlen
195  If copy_to_user(buf, path, pathlen) Then err = -EFAULT
199  out_free :
200  kfree(kbuf)
201  Return err
202  out :
203  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
204  Return err
Caller
NameDescribe
SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE4