From 21774fd81a51ec1eccd59caf922d387977acd2aa Mon Sep 17 00:00:00 2001 From: Willem de Bruijn Date: Thu, 15 Oct 2020 14:57:26 -0400 Subject: kernfs: bring names in comments in line with code Fix two stragglers in the comments of the below rename operation. Fixes: adc5e8b58f48 ("kernfs: drop s_ prefix from kernfs_node members") Acked-by: Tejun Heo Signed-off-by: Willem de Bruijn Link: https://lore.kernel.org/r/20201015185726.1386868-1-willemdebruijn.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- fs/kernfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/kernfs/dir.c') diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 9aec80b9d7c6..ea3c95125bf1 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -1599,7 +1599,7 @@ int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent, return error; } -/* Relationship between s_mode and the DT_xxx types */ +/* Relationship between mode and the DT_xxx types */ static inline unsigned char dt_type(struct kernfs_node *kn) { return (kn->mode >> 12) & 15; -- cgit v1.2.3-70-g09d2 From 0288e7fa35b37fc91c6afec8c420f71d0ade853f Mon Sep 17 00:00:00 2001 From: Hui Su Date: Fri, 13 Nov 2020 21:21:43 +0800 Subject: 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(). Acked-by: Tejun Heo Signed-off-by: Hui Su Link: https://lore.kernel.org/r/20201113132143.GA119541@rlk Signed-off-by: Greg Kroah-Hartman --- fs/kernfs/dir.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fs/kernfs/dir.c') diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index ea3c95125bf1..7a53eed69fef 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c @@ -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; } -- cgit v1.2.3-70-g09d2