From patchwork Thu Sep 20 15:12:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10607939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6E421390 for ; Thu, 20 Sep 2018 15:12:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6EF42DC00 for ; Thu, 20 Sep 2018 15:12:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C51D22DC69; Thu, 20 Sep 2018 15:12:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 704D62DC00 for ; Thu, 20 Sep 2018 15:12:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733195AbeITU4S (ORCPT ); Thu, 20 Sep 2018 16:56:18 -0400 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WtmReosd4GA07GtJdxNb9bOVWt1Zeu6Sxj30CYjenFo=; b=GWHda+W4U9lNJ6+tNakb97i04x8TWt8ofAW/HyTnn1jesJwv09yQmNfE1M0eI9Gd8s 9ov7lNLHm+bfMatBL6+ofvFk/LWVfYdycGBYFz+T8yP6vClS1T1lAGM4G5VE2lff1vu0 xmRqXa8FdV2pdJ+8X53UnajVJLD3brLmjkvXpH3xYvBFzSIaAWgYdCeuK6NaS3l+OV0E ek+4G4CGf76B8xavOMbdGzVEENYRlVmC+fo+fRyRMYQY39MqMsUQsEe4P8T8vAheONIS FBJOnrJuExUqhYIVrXBffZh6PqxPKX9wkigSF9AeBfzeVyhbZcg+gMknJKc4pSdSkb4b /E+w== X-Gm-Message-State: APzg51DC4qQFXHKI8r+8xjz87/9az4Hwd4o0BVj3T3iTiqGD9AsEQ0zf K5RIxL3Qt0aSq0+wT6YnexiKFA== X-Google-Smtp-Source: ANB0VdbOQNl4gXK+wKNb02yVlcxj9w8JLKEhPgrcq/K7pk1MYzv++Cx+ILmegRfdCJ+matlCv9HOgA== X-Received: by 2002:adf:8385:: with SMTP id 5-v6mr20455436wre.13.1537456341176; Thu, 20 Sep 2018 08:12:21 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id p89-v6sm55286201wrc.97.2018.09.20.08.12.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 08:12:20 -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> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180920151214.15484-1-mszeredi@redhat.com> References: <20180920151214.15484-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ...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)