Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2133255imm; Thu, 20 Sep 2018 08:15:38 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda8jE74J2BYu1TYQLF2a01GgkaKB9ME1rXgFm0euuaW3zjx/Q5ESHsh0rwRLaR4d/6Diawk X-Received: by 2002:a63:a112:: with SMTP id b18-v6mr35017191pgf.384.1537456538493; Thu, 20 Sep 2018 08:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537456538; cv=none; d=google.com; s=arc-20160816; b=Mrga2FUUN7/lGq8Z8GTDLp4xI04NiOqGgMdddOYlMs2X8ul6otvCdgQXggVUOiL0l4 UTJQkvES0FQm6XJ6u3qx60nSnYWXzKFdVegqju5TpHFwdLrr/QaB9TX5u7eWKfiqdg+K K6Lm4bAa/koQozKWOo9/fLIJreE0ERdkMi5eGlF5N8pEPYPpN/DPoJkz++QQv297TP97 lP6kGxpsTUTbIS4jcxeVj+F1pRQPBgyEvChL+0Vjli6iUA/5nAdkco3LGcPaSOM4ud1h YosZWQiiehbe1zquK2qQqjUIvJebdTJKh26XUBFL+JxlYchYv1CSrwCuDkJcWE4c91BI Ofpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=WtmReosd4GA07GtJdxNb9bOVWt1Zeu6Sxj30CYjenFo=; b=JaElZrZrK/Ziun0fPwO+NzxJ01VnPVd/6CtGZWe7X1AcJEXI32TbpO7M+5tLCfOeOs VaqYO5Rj6j9Kbz84ybjOEdLICFfEd0rFQTpHe17vnTNWq3bMCHA4nMcGqd2C9n3S/P2Z /JeuMEqu6oX6YwqNwafiGlCi5v73cduyMF/PcgYdaaTb4Yc9MaZc8rw5u9drVJdwM5O7 gb3eaJwJFtGAAu/D6REq0rbd0N3Gpg0ET1CfgHo/OzKGDANYNVE50DkojYgzF8ZiTS+/ 4yJqbpGvLnaqXv97xA69iLu+ObDoKMwqjB+G5iKv1g7ESoF56bw3pUsmpeKU1ok1cFZe RG0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q20-v6si24934998pgb.596.2018.09.20.08.15.13; Thu, 20 Sep 2018 08:15:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387525AbeITU4S (ORCPT + 99 others); Thu, 20 Sep 2018 16:56:18 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34742 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732302AbeITU4R (ORCPT ); Thu, 20 Sep 2018 16:56:17 -0400 Received: by mail-wr1-f68.google.com with SMTP id t15so1872952wrx.1 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=emw9GWLiW5/MPz6VewRMvvuUiK8IC/gGQGe831jHfs9HUPbmd1jidnFAvnLA+fecKd R8i1gsIhU5FL9ZcRZMD4mihLm5D0i15K6423e6nou9LzASffr5R0aTw9bTLqpy5PB1LR a3rfHhYRwP/Dj2pundNDmMRTYDmwlg+opt4QdvRM/J/PEm3AHsC2uURdxIUvn3DML/rq novBSnWYMnS9NRqO4QhLsRXDhLRskbje+4SU1+lyvRpEa1Ta0/gfCbiR19aTOmW98OK/ Qrg4JcEKAs+rADJP7Ft6UqqpPcTIhv1hVsnQGvzuH1M/zVzGDd/AQzHoReotPYSeHDj9 kdag== X-Gm-Message-State: APzg51CBuCYQQvo2t0sAEudi+9eCb5AaQz6sLYVkL3nn8c7VMIpIXzLQ yNVC2LCwmXUCcQkERYjPWxOtoA== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ...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