Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp918950rwd; Wed, 7 Jun 2023 08:32:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7C5FEk/IdOETc0qSbHtkFooGKPgdO3FPqP/itHhASYK3e/mHrv9wePgMxS7WRdnacwbauW X-Received: by 2002:a17:90a:de14:b0:256:2056:ee52 with SMTP id m20-20020a17090ade1400b002562056ee52mr6676569pjv.17.1686151966707; Wed, 07 Jun 2023 08:32:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686151966; cv=none; d=google.com; s=arc-20160816; b=aaJk6EUkPgm4Xmz+AA8ShVknlcslcdHKe5ANDHCicP1UGVYo8i9kYtUR6Megejx9ob Bt/Y8giwi6Cb/WHMGpawp1gH8raobiX2i0b+GO4ovltHlGimZZa7OBWtRhzu5vXbppmc 0deC6adrNuZWcPkIxVm3RBlczezCbSxVywtz+lh7vW25ZPqU8n8QFU49B1/R7JL94vai sYBbrT5aU/lLy+09Ln650pd+kxSDbaVsJPf6SzG+SNbCU0eakPHDN4RsxB1MGtkx9ZXt qr2B4dJVXxC0ZRLD1JsI64IoVRsY7k+X2q9Xyc5AasH/5PjtKdBh5I7c6ErVG2553oKL rxVA== 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=GFNwWvhavDkNrI4eqwez7OWrv+w+Iw1WNhnwQW/Fw7E=; b=aPCFVd++N8bptmBwdR3N7ZrSJBaag6bDU9+cDogZG4WrYJL7lJDrebLXcKYaw+AGkH E7txctYXuQSMCzWr+ULcikne/F9E2BoHmYKGhbtJD2PBiGKu746ufp0SXeSbTQogF0ZP FgBkfFzPcY0MtMU/e5WvM0QLISkh0K88udzPHQcMXpuEsQ21V405E4kSs/QcGS3GVh30 X1ESeKGdEFV8O5ogL+d8Wrt8pYXezt2yS75t/EeOoJEIUEb+SFML6Hk9tSMiIuelikgS LjhG1kyRlJXChpxb3mPimrNNlGWfPDKNgmfzSYqZRjk54aRS2rtMsEXX5s4PekHpIutt 4Tew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=pJT5VSzQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f6-20020a17090ab94600b002536b553afdsi1228640pjw.98.2023.06.07.08.32.31; Wed, 07 Jun 2023 08:32:46 -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=pJT5VSzQ; 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 S241308AbjFGPVX (ORCPT + 99 others); Wed, 7 Jun 2023 11:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241307AbjFGPVR (ORCPT ); Wed, 7 Jun 2023 11:21:17 -0400 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5052A1BE2 for ; Wed, 7 Jun 2023 08:21:16 -0700 (PDT) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (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-0.canonical.com (Postfix) with ESMTPS id 1C07B3F15A for ; Wed, 7 Jun 2023 15:21:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686151273; bh=GFNwWvhavDkNrI4eqwez7OWrv+w+Iw1WNhnwQW/Fw7E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pJT5VSzQ4Jc8ISxu9rRfZUr2TH9gC3qGbNGviNkm3IYTUg3WY4rifXg0xDnHGyp91 /d8zeFr9rb5P0tnIKOThMvlus0dIeLzQm46Pwl4a/Uc9BmDqorw00U9Sto29CPLs9E kwht5ZOTocrpQXeh5/Mt91sJoV4ysaBu4c4OTMoiSTZxxcpmSHujmBALbEeib+KJK9 cDJRrBsTCiQIQlVg2n1qbFtWhlJwLE1T362Z4v82hryTUCpSr7UHnKXb/woBikd7ii gsot7ALTVlR25/6QBmkJoA3wLMsVWwv+CuyfIA3ovtLTEssbl5nRHBsJkhx0ZoaB7a JGI0EShK+fmCw== Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-514b3b99882so910852a12.2 for ; Wed, 07 Jun 2023 08:21:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686151272; x=1688743272; 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=GFNwWvhavDkNrI4eqwez7OWrv+w+Iw1WNhnwQW/Fw7E=; b=L356YG7fkhuw/HSn8bbFMnrU3o6P9VNl8/TJmYDv/ZgLAn3oupeqaLnCiElrFR+0OD s8j9zF9S9lG8SWzq0s+mhb3/l58cGFhmahmOc0VpeKBpsKfN++uTyfvC2oSDrok5EnYT t0WjS2qu8lxT5pjfZK4S95aeUHELNpzV1tasvCN7EFsHDVn7I/hbCFaWO8Ak4sh5NKka uSoLE67gb1IWx8RQr++7qUhYh5LVj/Vh4L8hMnH9yYduZMDQO123m7bVNsVWYTqq9NW3 qbU7vgMEhUjSrFF28R88xPB+y4knyErRib9lVmLPpYxUYu9u16k9GbRMKdq5Z4RW/x9O aueg== X-Gm-Message-State: AC+VfDykAm8Q41IujKugleuR6z5c/Ty7uW4ZWJ0RS/UEISGd1mwbuBk7 nQePVT97FIERDu6qyBGvmo7AZX7C7jNErNVwZ5Teh06IRjfTErsL4SQ511KJVg7fGg79buyIq9L uXNFufvw+pwHbZWEkoTNKul54Zaiw+ymSL7kBn92O2g== X-Received: by 2002:aa7:cd7c:0:b0:516:6779:263e with SMTP id ca28-20020aa7cd7c000000b005166779263emr4537597edb.22.1686151272831; Wed, 07 Jun 2023 08:21:12 -0700 (PDT) X-Received: by 2002:aa7:cd7c:0:b0:516:6779:263e with SMTP id ca28-20020aa7cd7c000000b005166779263emr4537575edb.22.1686151272576; Wed, 07 Jun 2023 08:21:12 -0700 (PDT) Received: from amikhalitsyn.local (dslb-002-205-064-187.002.205.pools.vodafone-ip.de. [2.205.64.187]) by smtp.gmail.com with ESMTPSA id w17-20020a056402129100b005147503a238sm6263441edv.17.2023.06.07.08.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 08:21:12 -0700 (PDT) From: Alexander Mikhalitsyn To: xiubli@redhat.com Cc: brauner@kernel.org, stgraber@ubuntu.com, linux-fsdevel@vger.kernel.org, Alexander Mikhalitsyn , Jeff Layton , Ilya Dryomov , ceph-devel@vger.kernel.org, Alexander Viro , Seth Forshee , linux-kernel@vger.kernel.org Subject: [PATCH v3 01/14] fs: export mnt_idmap_get/mnt_idmap_put Date: Wed, 7 Jun 2023 17:20:25 +0200 Message-Id: <20230607152038.469739-2-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607152038.469739-1-aleksandr.mikhalitsyn@canonical.com> References: <20230607152038.469739-1-aleksandr.mikhalitsyn@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED autolearn=unavailable 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 These helpers are required to support idmapped mounts in the Cephfs. Cc: Christian Brauner Cc: Xiubo Li Cc: Jeff Layton Cc: Ilya Dryomov Cc: ceph-devel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Alexander Mikhalitsyn Reviewed-by: Christian Brauner --- v3: - EXPORT_SYMBOL -> EXPORT_SYMBOL_GPL as Christoph Hellwig suggested --- 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..57d1dedf3f8f 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_GPL(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_GPL(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); -- 2.34.1