mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 12:44:11 +08:00
fsnotify: replace igrab() with ihold() on attach connector
We must have a reference on inode, so ihold is cheaper. Link: https://lore.kernel.org/r/20210810151220.285179-2-amir73il@gmail.com Reviewed-by: Matthew Bobrowski <repnop@google.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
af579beb66
commit
09ddbe69c9
@ -493,8 +493,11 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
|
||||
conn->fsid.val[0] = conn->fsid.val[1] = 0;
|
||||
conn->flags = 0;
|
||||
}
|
||||
if (conn->type == FSNOTIFY_OBJ_TYPE_INODE)
|
||||
inode = igrab(fsnotify_conn_inode(conn));
|
||||
if (conn->type == FSNOTIFY_OBJ_TYPE_INODE) {
|
||||
inode = fsnotify_conn_inode(conn);
|
||||
ihold(inode);
|
||||
}
|
||||
|
||||
/*
|
||||
* cmpxchg() provides the barrier so that readers of *connp can see
|
||||
* only initialized structure
|
||||
|
Loading…
Reference in New Issue
Block a user