From: James Morris Date: Wed, 22 Mar 2006 08:09:17 +0000 (-0800) Subject: [PATCH] selinuxfs cleanups: use sel_make_dir() X-Git-Tag: v2.6.17-rc1~1129^2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cde174a885821b5eee7e00c8a9a426c9c8186a29;hp=40e906f8224966ef65756cc75f9999ea2de0523d;p=linux-2.6 [PATCH] selinuxfs cleanups: use sel_make_dir() Use existing sel_make_dir() helper to create booleans directory rather than duplicating the logic. Signed-off-by: James Morris Acked-by: Stephen Smalley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c index 4f7cda67ac..f898080b94 100644 --- a/security/selinux/selinuxfs.c +++ b/security/selinux/selinuxfs.c @@ -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)