mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user