Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1119052rwd; Wed, 7 Jun 2023 11:13:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4J3KK9NTTz0SBSy1x5knUM3aLbEr8ae+HP3cBzMKziLWaKy2MyXbWL9YmZMeJZMyunBg2O X-Received: by 2002:a05:6a20:1608:b0:fa:1f3a:8f56 with SMTP id l8-20020a056a20160800b000fa1f3a8f56mr4657010pzj.12.1686161629228; Wed, 07 Jun 2023 11:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686161629; cv=none; d=google.com; s=arc-20160816; b=V/9Yert/A0KUUf5xQfdcmcAadJnF6UtS7XkvJ5uD6mRaf4K1WhHtThSGttvcLM/tQQ gUYUV2PzLohPpA+IkbfPryAQaujH0TDqm6tRGhP0qIc0pVH5SySBdKA4+DREWxjsC8lR CZ/5BD8sTtJMJAXAikrnoN//EEwGqEJDcYDYsMcmVCJJ6fDvY5eVjl8CoEQjTAbMbtJQ gLGJrHytQmnVCK7WJDsVU2W3Wca6mWuSpBVNV8WIZ3h1rMlCt0zKAJtb8cs7aiPnf8pw dzkZVT+BLi8XGWd/1V5OOgHobqJC8KHfXsq8jwbysudwY6Had6ywc5u5IOwGQK6U4uXX /t2Q== 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=mxmMG9Qn0JrabsbFlMFoeb4hRYjPAVWEFW12e8px/Y1jxRuwLZWoSJ+8EgkbJR9xRG LsZ96JDEpt1sxFW+L18wTP2JzHzLoEQbOcj4Bo/xcZKqb6T9WMK25lH68RZVTTZB7MXv PnJOvR7c2r30QI1v/xKIDpHu+cgO0G5cwMfywr4AM0Fd96D6oyPl3CneomD3k5RUUF26 nJa9HR19KHWqoT955DyOa2l5uxchp37X+jS59HJjFG7wWDyjDf7ATORnhfRMwnpW1p+V G8rrFQ1E5nqc5g7ZoxD2FpO/zEeVWshd7sRfg+aLRXnNOsTeeoeVWTq6BaDhiQKzEMV4 ftWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=QZsZNJMf; 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 k191-20020a636fc8000000b0053439ea59fdsi9432347pgc.19.2023.06.07.11.13.36; Wed, 07 Jun 2023 11:13:49 -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=QZsZNJMf; 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 S230169AbjFGSKn (ORCPT + 99 others); Wed, 7 Jun 2023 14:10:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232478AbjFGSKf (ORCPT ); Wed, 7 Jun 2023 14:10:35 -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 D93E41FE6 for ; Wed, 7 Jun 2023 11:10:33 -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 735D63F194 for ; Wed, 7 Jun 2023 18:10:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1686161432; bh=GFNwWvhavDkNrI4eqwez7OWrv+w+Iw1WNhnwQW/Fw7E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=QZsZNJMfAW/P0rvAl7554+mCWRe3HjI9fYa+LijJD7nGGZb9sYswTh5zXkIjAIbMT AzYuwc3CbUtCYIpONBHfVhVx4qbskX3udQu5S+lKQpqMzP8Us8mi6rcKR/NGJiJQFq 5UlSoroSqp6IfHEKoMRcgWALR+BBa8eF7zX9HNc9ZpJPKIye8XPlytfu+QYj+Pv5bx jzraMcNShJDbhCDisJJizXhn8HBidRyb4RVx9QdrSzOvZKStqxabHz3rlQeqQ5jSdI eplW8FiCA/i+ED3op46k5vvL7ngurizEndnHV0ZRWdmIhjprAbsz5N+i2iuLe1h7AE fKVmgSZXI0IPg== Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a34d3e5ebso572050166b.3 for ; Wed, 07 Jun 2023 11:10:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686161432; x=1688753432; 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=QH44jUSNMgZgvBzPkTW7ep2bPsiJztxSb34/lQst7RcULy7ER9R0x8VJbKtAjLkqCe jbke3O+sAj5Chiy4eDU9hX0hs+1nQkspO0z1MO9HE4/NZQON1a8hLKOmSH3ZjU3XIaO0 U38DuByZd/9Yh9rwWuTa3vn/tvuC87zfM+s/LCRJN6lRSZ4d9hL+GxTcgKYRs41VoUtY fvHYzwuaVV8O4D+Ine+it6bElGpppdhlzpKIQW2ixSFCO/iAllXCpuFZYeE9JM/8npgM jzjCXKPlOmBWwRTTlANgO7iDCxILQ3IGo/DXcKdXGgVR8/iqiQyWKfDvHZbCs3ujA4Od PLqA== X-Gm-Message-State: AC+VfDwUiV66t2tfzE1dkGKFy2N1UzfzBSKgi6plEdqZQ7MK7FwdbxFW RtDHITND3j3vtyfrnSerMNmRCEcJCKpvzs5AL1qE/tESeyRz+LAk7ySu4JaNztoWlcR77IKw+w/ V+VCpV44XcMBHOYp8BWPoVmFN5bVXEKGmmSrTUU3JbA== X-Received: by 2002:a17:907:7288:b0:978:780e:4520 with SMTP id dt8-20020a170907728800b00978780e4520mr4046879ejc.20.1686161432029; Wed, 07 Jun 2023 11:10:32 -0700 (PDT) X-Received: by 2002:a17:907:7288:b0:978:780e:4520 with SMTP id dt8-20020a170907728800b00978780e4520mr4046862ejc.20.1686161431822; Wed, 07 Jun 2023 11:10:31 -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 oz17-20020a170906cd1100b009745edfb7cbsm7170494ejb.45.2023.06.07.11.10.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jun 2023 11:10:31 -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 v4 01/14] fs: export mnt_idmap_get/mnt_idmap_put Date: Wed, 7 Jun 2023 20:09:44 +0200 Message-Id: <20230607180958.645115-2-aleksandr.mikhalitsyn@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230607180958.645115-1-aleksandr.mikhalitsyn@canonical.com> References: <20230607180958.645115-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=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 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