函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static int link_path_walk(const char *name, struct nameidata *nd)

返回类型:int

参数:

类型参数名称
const char *name
struct nameidata *nd
2059  如果是错误则返回:错误
2061 name恒等于'/'循环
2062  name自加
2063  如果非name则返回:0
2067  循环
2071  err等于may_lookup(nd)
2072  如果err则返回:err
2075  hash_len等于We know there's a real path component here of at least* one character.
2077  type等于LAST_NORM
2078  如果name[0]恒等于'.'则switch hashlen_len(hash_len)
2079  :hashlen_len(hash_len)恒等于2
2080  如果name[1]恒等于'.'则
2081  type等于LAST_DOTDOT
2082  flags或等于LOOKUP_JUMPED
2084  退出
2085  :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  如果err小于0则返回: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  如果非name则转到:OK
2112  循环
2113  name自加
2114 此条件成立可能性小(为编译器优化)( * name == '/')循环
2116  OK :
2118  如果非depth则返回:0
2120  name等于name
2122  如果非name则返回:0
2126  否则
2130  如果err小于0则返回:err
2133  如果err
2134  s等于get_link(nd)
2136  如果是错误则返回:错误
2138  err等于0
2141  put_link(nd)
2142  否则
2143  name等于name
2144  name等于s
2145  继续下一循环
2149  如果flags按位与RCU pathwalk mode; semi-internal
2153  返回:负ENOTDIR
调用者
名称描述
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