mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
new helper: ihold()
Clones an existing reference to inode; caller must already hold one. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
646ec4615c
commit
7de9c6ee3e
40 changed files with 57 additions and 49 deletions
|
@ -111,10 +111,9 @@ struct file *anon_inode_getfile(const char *name,
|
|||
path.mnt = mntget(anon_inode_mnt);
|
||||
/*
|
||||
* We know the anon_inode inode count is always greater than zero,
|
||||
* so we can avoid doing an igrab() and we can use an open-coded
|
||||
* atomic_inc().
|
||||
* so ihold() is safe.
|
||||
*/
|
||||
atomic_inc(&anon_inode_inode->i_count);
|
||||
ihold(anon_inode_inode);
|
||||
|
||||
path.dentry->d_op = &anon_inodefs_dentry_operations;
|
||||
d_instantiate(path.dentry, anon_inode_inode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue