From patchwork Wed May 24 15:33:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Mikhalitsyn X-Patchwork-Id: 98557 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp2913826rwl; Wed, 24 May 2023 08:40:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7OnYqgFhRc2UMC+VpKPJAhyeBjOEHEF7eoB11xoJS519ao7gCmaA+FV8/lF8RU1AIveCKV X-Received: by 2002:a17:902:f7d6:b0:1aa:fec9:5219 with SMTP id h22-20020a170902f7d600b001aafec95219mr16826551plw.61.1684942843412; Wed, 24 May 2023 08:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684942843; cv=none; d=google.com; s=arc-20160816; b=JHVI8s6W5WvIPaJoJwJ0W204W37UEvs+A6iueKYcD3PzknUOUD1dH8x6mC03PvlOnN kuXBg1CwpjWffGZEMzqi0n2vWlGjEyfW+7RmwWDHOsBTt4JiMplM52kAg+1dE1tMRYe5 b8Z951kPvX1log/lAd/aX4HjP7RziDHIl247is5FSObtyKt3+prSwALoQhKxAZOb3fq4 zhOJGGPqNwBgcqYYRN08e2HEDqA7vaE2X/0nc46lz3nnsB/OUSNjasNBhERZF+9g/uiM 1CjrH33drci/h0HLCTYtxndxrUKRmLLsjXJ1ls5iCzi90KlvOjAWE2+5RJdF5lC3ucpw 2rZg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tSdP/T4XpDdXngtRP7H8sm4qPchKBIP/6AL5g4/r8eE=; b=R0iuoArHL6Awl7Zbicp7sibiS21G1CnU3Tx+N1FlwBaXFwd4UEk0HjXxoaVz3zwXjF Z/Nw/pKaxjM9e7qpa47wyFJghZVeFxJxJVaJxyuD4uzti+Bf3yPbQa2NKUv7BgoyqxUV DaUoEwdMsPniU1qr3yzyO5er5YWUrKDLdRAwnTACIJW0spwniH1pWCxTpliCFaFPq3De Y1F0kb/vR9Y+1a//jdYysdA6OVmgdez0M3X4NVUr2FKfR0N6pZ95NLEwgb17lt/ENN4s GmFN1Z83GqJO0IhiUZj/0HNKSeoy+DpBgjcAmwWZ8M0J92cbX7JVvY/Z29a3sdACGbvQ EtkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=ZFEibrrs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902d49100b001ae82f13a0fsi8898761plg.643.2023.05.24.08.40.28; Wed, 24 May 2023 08:40:43 -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; dkim=pass header.i=@canonical.com header.s=20210705 header.b=ZFEibrrs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236244AbjEXPen (ORCPT + 99 others); Wed, 24 May 2023 11:34:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbjEXPeh (ORCPT ); Wed, 24 May 2023 11:34:37 -0400 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9FFA132 for ; Wed, 24 May 2023 08:34:14 -0700 (PDT) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 791D341BEE for ; Wed, 24 May 2023 15:33:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1684942434; bh=tSdP/T4XpDdXngtRP7H8sm4qPchKBIP/6AL5g4/r8eE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZFEibrrs1Nnz5kOOIBZnvBF8KoK5LBTfbZsgtvKt4XoZSeOgyCkk9ycKpvBDGlY95 NFsB99I2LkS9cajNZkDI4peX7wk1aXWKsdqHZA2IsmYY4OAU1EkGGpfEmRUy7jne+Z US+tBeemyUK6DbJ7Sa8GLUYb0zRs4zOmYoU8aJ8htsgWXobnYsTkvOg2iJJdyOdkwM UsoRfiM/FzJLxNozdpH1T23PXIvVyoPOcB5vhBKEskbj1ZBRP1Bp4OtTOr26v+U/as UvBe9P09xeJHRj5/7fZ2zIIgkXscnGBryoj6WfqnvK+QIpj414GXdHS9HfYF1SYC7P BM+cN3duKVlDQ== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a355c9028so120251666b.3 for ; Wed, 24 May 2023 08:33:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684942431; x=1687534431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tSdP/T4XpDdXngtRP7H8sm4qPchKBIP/6AL5g4/r8eE=; b=fe8WTPNWtClmBJpW2dj5f6GwbWBYFvzZeqPiv8vbTf3drsIpfJSprRFHry/9VQt1Sh mdqzSgqhit7HrvG9F/s4SRuBhS6GjZEytaExp4QFwfV585P3ScPAQA9mfWdXuMz9WgLz u/0/FAQmGZHBjpWcw/Q3h2q/nfzwDuBSxfPZHPQNY70LTcowEWUTG+nUrCsFvBwgd14e XwMIi5YP888bpl/GFZ4niqgDGXzlSmc1zExwEjsho65SkxBm9pRb2/rRgK7slnKZ4Q38 IQ/+8w0N6NRuU4go7LhcLsgjo2Nn8e6Bbz5xvyZqV0FrQ1ebmlyzovYnVKb8bCAn/3Yd K8IA== X-Gm-Message-State: AC+VfDzds6kwACfWHD6sClOiCqGeF+gb7dFuKwLJi/D40Lva8mpNeep/ 5CK54OOFV/mZNZtzW+BIcLQ7/MJcArnkbgu/aQKECPkXunZURsPOEy8MmRQb5NRUX8/U4ZXKeVc /0sT2j+PQYQKYz02qHLU6d8y5K3cbZqIaj73MB4gO/9GU+x1G8A== X-Received: by 2002:a17:907:1606:b0:96f:d154:54f7 with SMTP id hb6-20020a170907160600b0096fd15454f7mr12266658ejc.42.1684942431690; Wed, 24 May 2023 08:33:51 -0700 (PDT) X-Received: by 2002:a17:907:1606:b0:96f:d154:54f7 with SMTP id hb6-20020a170907160600b0096fd15454f7mr12266633ejc.42.1684942431448; Wed, 24 May 2023 08:33:51 -0700 (PDT) Received: from amikhalitsyn.local (dslb-088-074-206-207.088.074.pools.vodafone-ip.de. [88.74.206.207]) by smtp.gmail.com with ESMTPSA id p26-20020a17090664da00b0096f7105b3a6sm5986979ejn.189.2023.05.24.08.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 08:33:50 -0700 (PDT) From: Alexander Mikhalitsyn To: xiubli@redhat.com Cc: brauner@kernel.org, stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Alexander Mikhalitsyn , Ilya Dryomov , Jeff Layton , Alexander Viro , Seth Forshee , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/13] fs: export mnt_idmap_get/mnt_idmap_put Date: Wed, 24 May 2023 17:33:03 +0200 Message-Id: <20230524153316.476973-2-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230524153316.476973-1-aleksandr.mikhalitsyn@canonical.com> References: <20230524153316.476973-1-aleksandr.mikhalitsyn@canonical.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766790626725388890?= X-GMAIL-MSGID: =?utf-8?q?1766790626725388890?= These helpers are required to support idmapped mounts in the Cephfs. Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Christian Brauner --- fs/mnt_idmapping.c | 2 ++ include/linux/mnt_idmapping.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/fs/mnt_idmapping.c b/fs/mnt_idmapping.c index 4905665c47d0..5a579e809bcf 100644 --- a/fs/mnt_idmapping.c +++ b/fs/mnt_idmapping.c @@ -256,6 +256,7 @@ struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap) return idmap; } +EXPORT_SYMBOL(mnt_idmap_get); /** * mnt_idmap_put - put a reference to an idmapping @@ -271,3 +272,4 @@ void mnt_idmap_put(struct mnt_idmap *idmap) kfree(idmap); } } +EXPORT_SYMBOL(mnt_idmap_put); diff --git a/include/linux/mnt_idmapping.h b/include/linux/mnt_idmapping.h index 057c89867aa2..b8da2db4ecd2 100644 --- a/include/linux/mnt_idmapping.h +++ b/include/linux/mnt_idmapping.h @@ -115,6 +115,9 @@ static inline bool vfsgid_eq_kgid(vfsgid_t vfsgid, kgid_t kgid) int vfsgid_in_group_p(vfsgid_t vfsgid); +struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap); +void mnt_idmap_put(struct mnt_idmap *idmap); + vfsuid_t make_vfsuid(struct mnt_idmap *idmap, struct user_namespace *fs_userns, kuid_t kuid);