函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_renameat2

函数原型:static int do_renameat2(int olddfd, const char __user *oldname, int newdfd, const char __user *newname, unsigned int flags)

返回类型:int

参数:

类型参数名称
intolddfd
const char __user *oldname
intnewdfd
const char __user *newname
unsigned intflags
4467  struct inode * delegated_inode = NULL
4470  lookup_flags等于0, target_flags等于... in destination of rename()
4471  bool should_retry = false
4474  如果flags按位与Don't overwrite target 按位或Exchange source and dest 按位或Whiteout source 的值的反则返回:负EINVAL
4477  如果flags按位与Don't overwrite target 按位或Whiteout source 的值且flags按位与Exchange source and dest 则返回:负EINVAL
4481  如果flags按位与Whiteout source 且非操作权限检查则返回:负EPERM
4484  如果flags按位与Exchange source and dest target_flags等于0
4487  retry :
4488  from等于filename_parentat(olddfd, getname(oldname), lookup_flags, & old_path, & old_last, & old_type)
4490  如果是错误
4491  error等于错误
4492  转到:exit
4495  to等于filename_parentat(newdfd, getname(newname), lookup_flags, & new_path, & new_last, & new_type)
4497  如果是错误
4498  error等于错误
4499  转到:exit1
4502  error等于负EXDEV
4503  如果mnt不等于mnt则转到:exit2
4506  error等于负EBUSY
4507  如果old_type不等于LAST_NORM则转到:exit2
4510  如果flags按位与Don't overwrite target error等于负EEXIST
4512  如果new_type不等于LAST_NORM则转到:exit2
4515  error等于mnt_want_write(mnt)
4516  如果error则转到:exit2
4519  retry_deleg :
4520  trap等于p1 and p2 should be directories on the same fs.
4522  old_dentry等于Parent directory has inode locked exclusive. This is one* and only case when ->lookup() gets called on non in-lookup* dentries - as the matter of fact, this only gets called* when directory is guaranteed to have no in-lookup children* at all.
4523  error等于错误
4524  如果是错误则转到:exit3
4527  error等于负ENOENT
4528  如果d_is_negative(old_dentry)则转到:exit4
4530  new_dentry等于Parent directory has inode locked exclusive. This is one* and only case when ->lookup() gets called on non in-lookup* dentries - as the matter of fact, this only gets called* when directory is guaranteed to have no in-lookup children* at all.
4531  error等于错误
4532  如果是错误则转到:exit4
4534  error等于负EEXIST
4535  如果flags按位与Don't overwrite target d_is_positive(new_dentry)则转到:exit5
4537  如果flags按位与Exchange source and dest
4538  error等于负ENOENT
4539  如果d_is_negative(new_dentry)则转到:exit5
4542  如果非d_is_dir(new_dentry)则
4543  error等于负ENOTDIR
4544  如果name[len]则转到:exit5
4549  如果非d_is_dir(old_dentry)则
4550  error等于负ENOTDIR
4551  如果name[len]则转到:exit5
4553  如果非flags按位与Exchange source and dest 的值且name[len]则转到:exit5
4557  error等于负EINVAL
4558  如果old_dentry恒等于trap则转到:exit5
4561  如果非flags按位与Exchange source and dest 的值则error等于负ENOTEMPTY
4563  如果new_dentry恒等于trap则转到:exit5
4566  error等于security_path_rename( & old_path, old_dentry, & new_path, new_dentry, flags)
4568  如果error则转到:exit5
4570  error等于vfs_rename - rename a filesystem object*@old_dir: parent of source*@old_dentry: source*@new_dir: parent of destination*@new_dentry: destination*@delegated_inode: returns an inode needing a delegation break*@flags: rename flags
4573  exit5 :
4574  dput(new_dentry)
4575  exit4 :
4576  dput(old_dentry)
4577  exit3 :
4578  unlock_rename(dentry, dentry)
4579  如果delegated_inode
4580  error等于break_deleg_wait( & delegated_inode)
4581  如果非error则转到:retry_deleg
4584  mnt_drop_write(mnt)
4585  exit2 :
4586  如果ry_estale - determine whether the caller should retry an operation*@error: the error that would currently be returned*@flags: flags being used for next lookup attempt* Check to see if the error code was -ESTALE, and then determine whethershould_retry = true
4588  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
4589  putname(to)
4590  exit1 :
4591  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
4592  putname(from)
4593  如果should_retry
4594  should_retry = false
4595  lookup_flags或等于ll ->d_revalidate() to trust no cache
4596  转到:retry
4598  exit :
4599  返回:error
调用者
名称描述
SYSCALL_DEFINE5
SYSCALL_DEFINE4
SYSCALL_DEFINE2