Commit 6036c5f
fs: simplify misleading code to remove ambiguity regarding ihold()/iput()
Because 'inode' is being initialised before checking if 'dentry' is negative
it looks like an extra iput() on 'inode' may happen since the ihold() is
done only if the dentry is *not* negative. In reality this doesn't happen
because d_is_negative() is never true if ->d_inode is NULL. This patch only
makes the code easier to understand, as I was initially mislead by it.
Signed-off-by: Luís Henriques <lhenriques@suse.de>
Link: https://lore.kernel.org/r/20230928152341.303-1-lhenriques@suse.de
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent 85fadf8 commit 6036c5f
1 file changed
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4367 | 4367 | | |
4368 | 4368 | | |
4369 | 4369 | | |
4370 | | - | |
| 4370 | + | |
4371 | 4371 | | |
4372 | 4372 | | |
4373 | | - | |
4374 | | - | |
4375 | 4373 | | |
4376 | 4374 | | |
4377 | 4375 | | |
| |||
0 commit comments