Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This is the main kernel-side routine that retrieves the cookie* value for a dentry/vfsmnt pair.

Proto:int get_dcookie(const struct path *path, unsigned long *cookie)

Type:int

Parameter:

TypeParameterName
const struct path *path
unsigned long *cookie
119  err = 0
122  mutex_lock( & dcookie_mutex)
124  If Not is_live() Then
125  err = -EINVAL
126  Go to out
129  If protected by d_lock & For use by dcookie subsystem Then
130  dcs = find_dcookie((unsignedlong)dentry)
131  Else
132  dcs = alloc_dcookie(path)
133  If Not dcs Then
134  err = -ENOMEM
135  Go to out
139  cookie = The dentry is locked, its address will do for the cookie
141  out :
142  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.
143  Return err