Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Name resolution.* This is the basic name resolution function, turning a pathname into* the final dentry. We expect 'base' to be positive and a directory.* Returns 0 and nd will have valid dentry and mnt on success.

Proto:static int link_path_walk(const char *name, struct nameidata *nd)

Type:int

Parameter:

TypeParameterName
const char *name
struct nameidata *nd
2059  If IS_ERR(name) Then Return PTR_ERR(name)
2061  When name == '/' cycle
2062  name++
2063  If Not name Then Return 0
2067  cycle
2071  err = may_lookup(nd)
2072  If err Then Return err
2075  hash_len = We know there's a real path component here of at least* one character.
2077  type = LAST_NORM
2078  If name[0] == '.' Then switch hashlen_len(hash_len)
2079  Case hashlen_len(hash_len) == 2
2080  If name[1] == '.' Then
2081  type = LAST_DOTDOT
2082  flags |= LOOKUP_JUMPED
2084  Break
2085  Case hashlen_len(hash_len) == 1
2086  type = LAST_DOT
2089  parent = dentry
2090  flags &= ~LOOKUP_JUMPED
2092  struct qstr this = {{hash_len = hash_len}, name = name}
2093  err = d_hash(parent, & this)
2094  If err < 0 Then Return err
2096  hash_len = hash_len
2097  name = name
2101  hash_len = hash_len
2102  name = name
2103  last_type = type
2105  name += hashlen_len(hash_len)
2106  If Not name Then Go to OK
2112  Do
2113  name++
2114  When Value for the false possibility is greater at compile time( * name == '/') cycle
2116  OK :
2118  If Not depth Then Return 0
2120  name = name
2122  If Not name Then Return 0
2126  Else
2130  If err < 0 Then Return err
2133  If err Then
2134  s = get_link(nd)
2136  If IS_ERR(s) Then Return PTR_ERR(s)
2138  err = 0
2141  put_link(nd)
2142  Else
2143  name = name
2144  name = s
2145  Continue
2153  Return -ENOTDIR
Caller
NameDescribe
path_lookupatReturns 0 and nd will be valid on success; Retuns error, otherwise.
path_parentatReturns 0 and nd will be valid on success; Retuns error, otherwise.
path_mountpointpath_mountpoint - look up a path to be umounted*@nd: lookup context*@flags: lookup flags*@path: pointer to container for result* Look up the given name, but don't attempt to revalidate the last component.
path_openat