From patchwork Fri Jun 9 09:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandr Mikhalitsyn X-Patchwork-Id: 105488 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp823795vqr; Fri, 9 Jun 2023 02:41:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7+FksAorjDELpmU7QkRADXImQQIAYEuGWT6k9OKftAlUqdKdy6X6E2TvOAEq/yoXbZUkqr X-Received: by 2002:a05:6359:a8a:b0:129:bed5:f63f with SMTP id em10-20020a0563590a8a00b00129bed5f63fmr925750rwb.12.1686303701663; Fri, 09 Jun 2023 02:41:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686303701; cv=none; d=google.com; s=arc-20160816; b=fEOy0y+rFyybgQ06qvJNgSCwBHV6or65z2dvOdk/4cKMJgQqHyM0eD/6kAtxP1vKEp 5DlOmMSWXOQEbO+kCIGEviQmf+Js4Clmj/esaQoHEPs3vS6NWbdR1qh/IAyeBDtIC2ZH G2jPQ12CN4XgRosnfpxbMqspD5jLdxg+7qCqS3tj3enNvaLKw4qfoE6OHT9BIwQYMM0z J83pCCHnqnoC/FTki3GHkmjJpSSS4zUnP6Gx4XAkBFNAVfvpSreGyinxIH3qChdjpbT1 4rm8L2qFMqpcMRVqECFLvwlWc7GKh1n0tW+DLu31Y28sHDLgH8o+2ePbthV6oT6eySJM wx9Q== 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=W0wHeL1DHstpZ8uY3bqOkJ6469fyDdrtiAQ6lsu9TvnYoawPPJGPo3iz+LHEX7S+ox dWB82W9JWd+iz9xNs1KcTgr3HELqZd4kr0J3tELr0t3ojzBJgeWY4ZfwXor2lVMltMDG 1CeEmAq3dWGd3JbrfxxPxP8bhX0D4Zj3RMXu4RG4QJu4cfzQ4kOAanKiZM0HIBd8pW9N tAKVif/AcPtnquKmdd0nMsw9sl3ZvJy4KUY/1wxIlxC71XUQrnmqh8WC0jLl8LbhVoIf W7IZvvCp+n0bI8iOD3yCgcJ/8j9LzBEkGg9uYOh2MaiH0JUuRNn71czH4vODBKjhkujv QY3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=bDs0oUKY; 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 j63-20020a638b42000000b005411b0f5ad2si2469372pge.892.2023.06.09.02.41.22; Fri, 09 Jun 2023 02:41:41 -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=bDs0oUKY; 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 S241658AbjFIJi2 (ORCPT + 99 others); Fri, 9 Jun 2023 05:38:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241591AbjFIJhl (ORCPT ); Fri, 9 Jun 2023 05:37:41 -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 C914E7AAD for ; Fri, 9 Jun 2023 02:32:47 -0700 (PDT) Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (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 A9C753F462 for ; Fri, 9 Jun 2023 09:31:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686303119; bh=GFNwWvhavDkNrI4eqwez7OWrv+w+Iw1WNhnwQW/Fw7E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bDs0oUKY7vUzjUomCHbVjx3YR+ivI5FZooz/1y3g/Jsg2y0lHGRi/pJCaAyt3kJyb eFW6A3UBmCIMG6MHZIryRDrIpnkODkhoxliwA0NMUpuJD9HTmyXtxG5tHWC+LH7VMi gwdkDS1ui28+A4GMZ/louD90qi8IbRCoCZSxI+mCX0chhPXx90M5oxPRCWQfA5WLUi H3tPvXkvwM1oTpMvUfnT6W6QuiOtldfQ9En1MyRLEchivDW0Gaj7s7peSM0B4TXmt2 L2KLY5S8C6SLoUgwbPlr/J5EfU1zGE9x48tWh+T8YuYC8V/5FQG8hoMoZEfU+QrseI +99te75F6OXSQ== Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-970e0152da7so181876666b.2 for ; Fri, 09 Jun 2023 02:31:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686303119; x=1688895119; 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=eHjfOmTI3tpkiXYR4TaqbKAvwHNHTghYybjl+HNcbTblO3QHbmVjlTyqFv8b3Db8dd cr1iOR5h8GnA+/+rpFxpmt1sJtoyAf0buXK3D1b7bSAwXagdxMyMEM6urGwzqKybKreY +cOWO2TVPUUFHTGFzQBAu2XX3Hf1MhFmkb3QggmlONB4XzWHbzSj3p2sv5aJR5x62pmH 7RP5ND+8BtWGboKFiIwN0PI/dJRLdzjG2HLd40eI882wcO0yxbPlhQHMP+5/yTOPk89y e7nn+ihp8cVjTEPccmGhA/rLv5m4ZGFYci7r1MA0HrS47n+y/TSvSj1jrQM7COSQxDz1 zfOg== X-Gm-Message-State: AC+VfDzHzIvtD32uIFHLHqk//4D3ae6rgqkcVhgKb4k9kIbDlEi+nnjH Hg0vWgkFC0KK6ucpJW0uG+USiFdRvHr7CkPK3uox1uI/yQlzwHrl/jUna5QWl8m20PzwW2Li/rZ wLimfpnhVjquqgDSQyuwYLz7ZTa6BMv48xcQn9Mkm/g== X-Received: by 2002:a17:907:70a:b0:96f:a935:8997 with SMTP id xb10-20020a170907070a00b0096fa9358997mr1328427ejb.12.1686303119330; Fri, 09 Jun 2023 02:31:59 -0700 (PDT) X-Received: by 2002:a17:907:70a:b0:96f:a935:8997 with SMTP id xb10-20020a170907070a00b0096fa9358997mr1328411ejb.12.1686303119167; Fri, 09 Jun 2023 02:31:59 -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 e25-20020a170906081900b0094ee3e4c934sm1031248ejd.221.2023.06.09.02.31.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 02:31:58 -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 v6 01/15] fs: export mnt_idmap_get/mnt_idmap_put Date: Fri, 9 Jun 2023 11:31:11 +0200 Message-Id: <20230609093125.252186-2-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230609093125.252186-1-aleksandr.mikhalitsyn@canonical.com> References: <20230609093125.252186-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,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768217590427218369?= X-GMAIL-MSGID: =?utf-8?q?1768217590427218369?= 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);