[PATCH] selinuxfs cleanups: use sel_make_dir()
authorJames Morris <jmorris@namei.org>
Wed, 22 Mar 2006 08:09:17 +0000 (00:09 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 22 Mar 2006 15:54:07 +0000 (07:54 -0800)
Use existing sel_make_dir() helper to create booleans directory rather than
duplicating the logic.

Signed-off-by: James Morris <jmorris@namei.org>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
security/selinux/selinuxfs.c

index 4f7cda67ac0a6ee81e59c3c64df1931852162095..f898080b9493b5e60a7cc9e4badaa427662eddf6 100644 (file)
@@ -1219,14 +1219,10 @@ static int sel_fill_super(struct super_block * sb, void * data, int silent)
        if (!dentry)
                return -ENOMEM;
 
-       inode = sel_make_inode(sb, S_IFDIR | S_IRUGO | S_IXUGO);
-       if (!inode)
-               goto out;
-       inode->i_op = &simple_dir_inode_operations;
-       inode->i_fop = &simple_dir_operations;
-       /* directory inodes start off with i_nlink == 2 (for "." entry) */
-       inode->i_nlink++;
-       d_add(dentry, inode);
+       ret = sel_make_dir(sb, dentry);
+       if (ret)
+               return ret;
+
        bool_dir = dentry;
        ret = sel_make_bools();
        if (ret)