[PATCH 02/12] HPPFS: don't check sb->s_op in is_pid()

From: Paolo 'Blaisorblade' Giarrusso
Date: Sun Sep 18 2005 - 09:26:27 EST


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>, Al Viro

To check whether a directory in /proc is a "pid" directory, we also check
(uselessly) whether the super_operations match the HPPFS ones. Drop that,
as suggested by Al Viro. Cleanup codingstyle in nearby code, btw.

Actually, we don't know why we used to do this. Just guessing.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@xxxxxxxx>
---

fs/hppfs/hppfs_kern.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c
--- a/fs/hppfs/hppfs_kern.c
+++ b/fs/hppfs/hppfs_kern.c
@@ -49,18 +49,16 @@ static struct vfsmount * proc_submnt;

static int is_pid(struct dentry *dentry)
{
- struct super_block *sb;
int i;

- sb = dentry->d_sb;
- if((sb->s_op != &hppfs_sbops) || (dentry->d_parent != sb->s_root))
- return(0);
+ if (dentry->d_parent != dentry->d_sb->s_root)
+ return 0;

- for(i = 0; i < dentry->d_name.len; i++){
- if(!isdigit(dentry->d_name.name[i]))
- return(0);
+ for (i = 0; i < dentry->d_name.len; i++) {
+ if (!isdigit(dentry->d_name.name[i]))
+ return 0;
}
- return(1);
+ return 1;
}

static char *dentry_name(struct dentry *dentry, int extra)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/