Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4534747rwo; Tue, 25 Jul 2023 07:29:04 -0700 (PDT) X-Google-Smtp-Source: APBJJlFbNFFlRVkK6rd8g0TcPDj+q46uPv7lr3SETiYVL/TN077sF/MXR2kmw/YTU4aP3EwbOcNF X-Received: by 2002:a17:903:1106:b0:1b8:ae12:5610 with SMTP id n6-20020a170903110600b001b8ae125610mr19163804plh.7.1690295343323; Tue, 25 Jul 2023 07:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690295343; cv=none; d=google.com; s=arc-20160816; b=NC269z9UfieW8koeuLFoCyXpTnrvuJyFlvernLDmgJLU1k7cmKHkLF0kR1ADrGXnfn Kb5//7rsGNKMrliSOjqR9dZmlbysJ/Q6qpNVTaAZvzLDxK6iqHOrYFWycNl0XDOWrb/2 PWJNpPXrmHlfo59ze923R4oR0dAg8/9zxHkXkBcoygo8VWYRwPFUjel9MIMAX5NiWgWA j1SV2r7hayyxGJkJKE3ai5toAIls3vzCFdgvjoI24rtjt4KloQ97mjE5fKqEByXE8Toh aBokPjJMSAi4D2rbYQI39H8m6iu2C3BqLl4AiAw4xvcXnutpxUb7IeRxTkl8ZpxlQGc8 VcfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=+Y9vL8ht/Oz7l0PJpfgKRG6lPSM+EVt5LIRhjXjurRk=; fh=4Lm+ZetbdDi0tHZrYTTLmV0UQ0ef7S1J05CPUPIrExg=; b=oJ3xNfNJzwvZPnE5ENt2DcpXK47IXCV27/4ZUnEJBR6H9UpfJxmeKdW7/g5ASjNRS/ 72qfhKII+YrAIDbvxHB1BtKR0mq3TAvz71LWEwJrlqbX5yclBCoPFsS8V9O5DWlvgPke BcYDbeKs+4S2vRLr+WZKPG1pAIb48d9Q3KxVCSKpvnF7ykHRCQiJBriQOUVIiXGelsnw MC34aTRVNyT7AMEQEQ2wYxiEOiY2gInAu8yqMs4s7lzohBA1Dq3igOmDllVndYAolAnc 5NQb4ZwEtFQ9hbbelj/w+LSwoDEN3A8s8hEJ+9uDfAqgxXLnE/aKzHK+0Yuu5EZupHPx bpEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l19-20020a170902f69300b001b890b3a512si13050012plg.615.2023.07.25.07.28.49; Tue, 25 Jul 2023 07:29:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232433AbjGYOO0 (ORCPT + 99 others); Tue, 25 Jul 2023 10:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbjGYOOZ (ORCPT ); Tue, 25 Jul 2023 10:14:25 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38D6A1FCB; Tue, 25 Jul 2023 07:14:24 -0700 (PDT) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4R9Jsh0Gq7zrRx5; Tue, 25 Jul 2023 22:13:28 +0800 (CST) Received: from hulk-vt.huawei.com (10.67.174.26) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 25 Jul 2023 22:14:20 +0800 From: Xiu Jianfeng To: , , , , CC: , , Subject: [PATCH -next] apparmor: cleanup unused functions in file.h Date: Tue, 25 Jul 2023 14:12:59 +0000 Message-ID: <20230725141259.233391-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.26] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After changes in commit 33bf60cabcc7 ("LSM: Infrastructure management of the file security"), aa_alloc_file_ctx() and aa_free_file_ctx() are no longer used, so remove them, and also remove aa_get_file_label() because it seems that it's never been used before. Signed-off-by: Xiu Jianfeng --- security/apparmor/include/file.h | 37 -------------------------------- 1 file changed, 37 deletions(-) diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h index 5be620af33ba..23cb6f9dbe6e 100644 --- a/security/apparmor/include/file.h +++ b/security/apparmor/include/file.h @@ -45,43 +45,6 @@ struct aa_file_ctx { u32 allow; }; -/** - * aa_alloc_file_ctx - allocate file_ctx - * @label: initial label of task creating the file - * @gfp: gfp flags for allocation - * - * Returns: file_ctx or NULL on failure - */ -static inline struct aa_file_ctx *aa_alloc_file_ctx(struct aa_label *label, - gfp_t gfp) -{ - struct aa_file_ctx *ctx; - - ctx = kzalloc(sizeof(struct aa_file_ctx), gfp); - if (ctx) { - spin_lock_init(&ctx->lock); - rcu_assign_pointer(ctx->label, aa_get_label(label)); - } - return ctx; -} - -/** - * aa_free_file_ctx - free a file_ctx - * @ctx: file_ctx to free (MAYBE_NULL) - */ -static inline void aa_free_file_ctx(struct aa_file_ctx *ctx) -{ - if (ctx) { - aa_put_label(rcu_access_pointer(ctx->label)); - kfree_sensitive(ctx); - } -} - -static inline struct aa_label *aa_get_file_label(struct aa_file_ctx *ctx) -{ - return aa_get_label_rcu(&ctx->label); -} - /* * The xindex is broken into 3 parts * - index - an index into either the exec name table or the variable table -- 2.34.1