Function report |
Source Code:fs\namei.c |
Create Date:2022-07-28 20:05:20 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:do_renameat2
Proto:static int do_renameat2(int olddfd, const char __user *oldname, int newdfd, const char __user *newname, unsigned int flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
int | olddfd | |
const char __user * | oldname | |
int | newdfd | |
const char __user * | newname | |
unsigned int | flags |
4467 | struct inode * delegated_inode = NULL |
4470 | lookup_flags = 0 , target_flags = ... in destination of rename() |
4471 | bool should_retry = false |
4474 | If flags & ~( Don't overwrite target | Exchange source and dest | Whiteout source ) Then Return -EINVAL |
4477 | If flags & (Don't overwrite target | Whiteout source ) && flags & Exchange source and dest Then Return -EINVAL |
4481 | If flags & Whiteout source && Not Check operation authority Then Return -EPERM |
4484 | If flags & Exchange source and dest Then target_flags = 0 |
4487 | retry : |
4488 | from = filename_parentat(olddfd, getname(oldname), lookup_flags, & old_path, & old_last, & old_type) |
4495 | to = filename_parentat(newdfd, getname(newname), lookup_flags, & new_path, & new_last, & new_type) |
4510 | If flags & Don't overwrite target Then error = -EEXIST |
4515 | error = mnt_want_write(mnt) |
4519 | retry_deleg : |
4523 | error = PTR_ERR(old_dentry) |
4524 | If IS_ERR(old_dentry) Then Go to exit3 |
4528 | If d_is_negative(old_dentry) Then Go to exit4 |
4531 | error = PTR_ERR(new_dentry) |
4532 | If IS_ERR(new_dentry) Then Go to exit4 |
4535 | If flags & Don't overwrite target && d_is_positive(new_dentry) Then Go to exit5 |
4537 | If flags & Exchange source and dest Then |
4539 | If d_is_negative(new_dentry) Then Go to exit5 |
4542 | If Not d_is_dir(new_dentry) Then |
4549 | If Not d_is_dir(old_dentry) Then |
4553 | If Not (flags & Exchange source and dest ) && name[len] Then Go to exit5 |
4558 | If old_dentry == trap Then Go to exit5 |
4561 | If Not (flags & Exchange source and dest ) Then error = -ENOTEMPTY |
4563 | If new_dentry == trap Then Go to exit5 |
4566 | error = security_path_rename( & old_path, old_dentry, & new_path, new_dentry, flags) |
4573 | exit5 : |
4574 | dput(new_dentry) |
4575 | exit4 : |
4576 | dput(old_dentry) |
4577 | exit3 : |
4578 | unlock_rename(dentry, dentry) |
4579 | If delegated_inode Then |
4580 | error = break_deleg_wait( & delegated_inode) |
4581 | If Not error Then Go to retry_deleg |
4584 | mnt_drop_write(mnt) |
4585 | exit2 : |
4590 | exit1 : |
4593 | If should_retry Then |
4594 | should_retry = false |
4596 | Go to retry |
4598 | exit : |
4599 | Return error |
Name | Describe |
---|---|
SYSCALL_DEFINE5 | |
SYSCALL_DEFINE4 | |
SYSCALL_DEFINE2 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |