Function report |
Source Code:fs\namei.c |
Create Date:2022-07-28 20:05:19 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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
Proto:int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry, struct inode **delegated_inode, unsigned int flags)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct inode * | old_dir | |
struct dentry * | old_dentry | |
struct inode * | new_dir | |
struct dentry * | new_dentry | |
struct inode ** | delegated_inode | |
unsigned int | flags |
4339 | is_dir = d_is_dir(old_dentry) |
4342 | bool new_is_dir = false |
4343 | max_links = s_max_links |
4353 | If Not target Then |
4355 | Else |
4356 | new_is_dir = d_is_dir(new_dentry) |
4374 | If is_dir Then |
4379 | If flags & Exchange source and dest && new_is_dir Then |
4386 | error = security_inode_rename(old_dir, old_dentry, new_dir, new_dentry, flags) |
4391 | take_dentry_name_snapshot( & old_name, old_dentry) |
4393 | If Not is_dir || flags & Exchange source and dest Then lock_two_nondirectories(source, target) |
4395 | Else if target Then inode_lock(target) |
4399 | If is_local_mountpoint(old_dentry) || is_local_mountpoint(new_dentry) Then Go to out |
4404 | If is_dir && Not new_is_dir && i_nlink >= max_links Then Go to out |
4406 | If flags & Exchange source and dest && Not is_dir && new_is_dir && i_nlink >= max_links Then Go to out |
4410 | If Not is_dir Then |
4411 | error = try_break_deleg(source, delegated_inode) |
4415 | If target && Not new_is_dir Then |
4416 | error = try_break_deleg(target, delegated_inode) |
4420 | error = rename(old_dir, old_dentry, new_dir, new_dentry, flags) |
4425 | If Not (flags & Exchange source and dest ) && target Then |
4433 | If Not (fs_flags & FS will handle d_move() during rename() internally. ) Then |
4434 | If Not (flags & Exchange source and dest ) Then move a dentry |
4436 | Else d_exchange(old_dentry, new_dentry) |
4439 | out : |
4440 | If Not is_dir || flags & Exchange source and dest Then unlock_two_nondirectories(source, target) |
4442 | Else if target Then inode_unlock(target) |
4444 | dput(new_dentry) |
4445 | If Not error Then |
4448 | If flags & Exchange source and dest Then |
4453 | release_dentry_name_snapshot( & old_name) |
4455 | Return error |
Name | Describe |
---|---|
do_renameat2 |
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 |