fs/kernfs: remove the double check of dentry->inode
PATCH 1/1 fs/kernfs: remove the double check of dentry->inode
In both kernfs_node_from_dentry() and in kernfs_dentry_node(), we will check the dentry->inode is NULL or not, which is superfluous.
So remove the check in kernfs_node_from_dentry().
Signed-off-by Hui Su <[email protected]>
--- fs/kernfs/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/kernfs/dir.c +1 -2
@@ -604,8 +604,7 @@ const struct dentry_operations kernfs_dops = {*/ struct kernfs_node *kernfs_node_from_dentry (struct dentry *dentry) { -if (dentry->d_sb->s_op == &kernfs_sops && - !d_really_is_negative (dentry)) +if (dentry->d_sb->s_op == &kernfs_sops)return kernfs_dentry_node (dentry);return NULL ; }
Signature · 1 line
2.29.0
Quoted 7 lines · Hui Su
In both
kernfs_node_from_dentry()and inkernfs_dentry_node(), we will check thedentry->inodeis NULL or not, which is superfluous.So remove the check in
kernfs_node_from_dentry().Signed-off-by Hui Su <[email protected]>
Acked-by Tejun Heo <[email protected]>
Thanks.
Signature · 1 line
tejun