From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f65.google.com ([209.85.221.65]:44140 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732393AbeITU4S (ORCPT ); Thu, 20 Sep 2018 16:56:18 -0400 Received: by mail-wr1-f65.google.com with SMTP id v16-v6so9773736wro.11 for ; Thu, 20 Sep 2018 08:12:21 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] selinux: fold superblock_doinit() into only caller Date: Thu, 20 Sep 2018 17:12:09 +0200 Message-Id: <20180920151214.15484-2-mszeredi@redhat.com> In-Reply-To: <20180920151214.15484-1-mszeredi@redhat.com> References: <20180920151214.15484-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: ...and remove the unused option parsing part as well. Signed-off-by: Miklos Szeredi --- security/selinux/hooks.c | 37 +++++++++---------------------------- 1 file changed, 9 insertions(+), 28 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 99c2c40c5d7a..1069acea2682 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -1199,33 +1199,6 @@ static int selinux_parse_opts_str(char *options, kfree(rootcontext); return rc; } -/* - * string mount options parsing and call set the sbsec - */ -static int superblock_doinit(struct super_block *sb, void *data) -{ - int rc = 0; - char *options = data; - struct security_mnt_opts opts; - - security_init_mnt_opts(&opts); - - if (!data) - goto out; - - BUG_ON(sb->s_type->fs_flags & FS_BINARY_MOUNTDATA); - - rc = selinux_parse_opts_str(options, &opts); - if (rc) - goto out_err; - -out: - rc = selinux_set_mnt_opts(sb, &opts, 0, NULL); - -out_err: - security_free_mnt_opts(&opts); - return rc; -} static void selinux_write_opts(struct seq_file *m, struct security_mnt_opts *opts) @@ -7370,7 +7343,15 @@ static __init int selinux_init(void) static void delayed_superblock_init(struct super_block *sb, void *unused) { - superblock_doinit(sb, NULL); +{ + int rc; + struct security_mnt_opts opts; + + security_init_mnt_opts(&opts); + rc = selinux_set_mnt_opts(sb, &opts, 0, NULL); + security_free_mnt_opts(&opts); + + return rc; } void selinux_complete_init(void) -- 2.14.3