[PATCH] ecryptfs: use special_file()
authorPekka Enberg <penberg@cs.helsinki.fi>
Fri, 20 Oct 2006 06:28:14 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 20 Oct 2006 17:26:35 +0000 (10:26 -0700)
Use the special_file() macro to check whether an inode is special instead of
open-coding it.

Acked-by: Mike Halcrow <mhalcrow@us.ibm.com>
Cc: Phillip Hellewell <phillip@hellewell.homeip.net>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ecryptfs/main.c

index 7a11b8ae66443ce6b094bc25ef381258a6af63f9..5938a232d11bd3e3feed0ed01ae3ba5a04918c7f 100644 (file)
@@ -104,10 +104,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
                inode->i_op = &ecryptfs_dir_iops;
        if (S_ISDIR(lower_inode->i_mode))
                inode->i_fop = &ecryptfs_dir_fops;
-       /* TODO: Is there a better way to identify if the inode is
-        * special? */
-       if (S_ISBLK(lower_inode->i_mode) || S_ISCHR(lower_inode->i_mode) ||
-           S_ISFIFO(lower_inode->i_mode) || S_ISSOCK(lower_inode->i_mode))
+       if (special_file(lower_inode->i_mode))
                init_special_inode(inode, lower_inode->i_mode,
                                   lower_inode->i_rdev);
        dentry->d_op = &ecryptfs_dops;