Function report |
Source Code:fs\namei.c |
Create Date:2022-07-28 20:05:18 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:vfs_link - create a new link*@old_dentry: object to be linked*@dir: new parent*@new_dentry: where to create the new link*@delegated_inode: returns inode needing a delegation break* The caller must hold dir->i_mutex* If vfs_link discovers a delegation on
Proto:int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry, struct inode **delegated_inode)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct dentry * | old_dentry | |
| struct inode * | dir | |
| struct dentry * | new_dentry | |
| struct inode ** | delegated_inode |
| 4141 | max_links = s_max_links |
| 4157 | If IS_APPEND(inode) || IS_IMMUTABLE(inode) Then Return -EPERM |
| 4164 | If HAS_UNMAPPED_ID(inode) Then Return -EPERM |
| 4171 | error = security_inode_link(old_dentry, dir, new_dentry) |
| 4175 | inode_lock(inode) |
| 4177 | If i_nlink == 0 && Not (Misc & I_LINKABLE) Then error = -ENOENT |
| 4181 | Else |
| 4182 | error = try_break_deleg(inode, delegated_inode) |
| 4183 | If Not error Then error = link(old_dentry, dir, new_dentry) |
| 4187 | If Not error && Misc & I_LINKABLE Then |
| 4188 | spin_lock( & _blocks, i_bytes, maybe i_size ) |
| 4189 | Misc &= ~I_LINKABLE |
| 4190 | spin_unlock( & _blocks, i_bytes, maybe i_size ) |
| 4192 | inode_unlock(inode) |
| 4193 | If Not error Then snotify_link - new hardlink in 'inode' directory* Note: We have to pass also the linked inode ptr as some filesystems leave |
| 4195 | Return error |
| Name | Describe |
|---|---|
| do_linkat | Hardlinks are often used in delicate situations. We avoid* security-related surprises by not following symlinks on the* newname. --KAB* We don't follow them on the oldname either to be compatible* with linux 2.0, and to avoid hard-linking to directories |
| 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 |