Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp226061lqo; Tue, 7 May 2024 19:08:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbaLJKNvFKJPCE/zHOMIuuoBFOfNfGoKDOBvQ61bPBbwKGbW10tTpGDmhOd7LQQ1pJ3E3PA0mnL0DFpYJ8ay28fiUCki6mPbLfdq0Ftw== X-Google-Smtp-Source: AGHT+IG+m/b0hNFrI4lvt0kHaGFjn8mw4sqpTvZaZkEAfLvEo7uX12CXb1A+sR6QbFw/+ah7c9IN X-Received: by 2002:a17:902:d58e:b0:1e5:9dff:a52c with SMTP id d9443c01a7336-1eeb03a5751mr17054755ad.10.1715134114815; Tue, 07 May 2024 19:08:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715134114; cv=pass; d=google.com; s=arc-20160816; b=h09APVUl16UoYl2i4VpCbX9FCeAjfFyzfgyJ4iWa1mlxamlMdampT1oPT4GsOZLnjA 0gVH7GoPMt4rAS9GcLvbK015AlNdTVzr27lku4+wuYi3WJ7jtqDn7GdZYR+CVkcXKs6l 0+gaeZNCXKhRuGNJDiFt54h9YwyxLEVrfuLCrj5WZvzJC/00eG0fzNBT9xp3aCsqffgQ WMN7cnEghKjHLVzJ9Vz+BH5bYwYe2kVhokJA2XCPQXz8UXrLQfBEqfS8+oYV4H+tsVrw D6YIAQtEnUst+WovzRYsZ7bW2Jop4JuOSihZT1DvNmtUu179M3Hd4D8P7oMHhrmj3mDF yLew== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=8RA5zO8osT581yFAhgKqZ9U4T2nN2QEoLCxUvIOmSqY=; fh=wafTox8scah8AwmJmEVBJm7Mwc4LGHlVRybvowBrqOU=; b=MfC01Sz4qHws+0O5IgOkZVC/CRP2O0mq0/dcIggwf4l7qhgQnSfh9Gf4P02Sef1pl6 5R+0RVDyHCYc5DLxs1Vy/VBLkF4mrU+oUsofM4fVDojaCQmUTU4e+Ox5htTH8XpX7o5u 2XtuaOkn8Z0Jo4khH95BI3AmwHU6Zc8n8SgYc0Ijdy4CLYMaPqjfPb7ESfwVH+Rqkmxy u90BU09IQ6B9wiTNWi2OsLlmnBqTSUYRVLZ/qcXQJDvBk5mhSaGTaVcFg/ZF6gFTVxhG R8I7any2f0xXwabvoQFPBD9vPdCcvoaoXrs0jYUNndV6b9j8QtoHm87v5CyVvOBU8CYH qD7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=EJQIVfmk; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-172620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e9-20020a170903240900b001e3c4b41b50si11925493plo.217.2024.05.07.19.08.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 19:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=EJQIVfmk; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-172620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF761B2227D for ; Wed, 8 May 2024 02:08:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC18B9454; Wed, 8 May 2024 02:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="EJQIVfmk" Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9D2B8F55 for ; Wed, 8 May 2024 02:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715134100; cv=none; b=nS5tY3xoqMfYEfHr3r+9kPjQvCp4thXKKrlF1ILErO9Mf/zRCRH5H6YDEGVGFcBF4YY1QqJ1FmsoRbb/ov1tmQ2QnrTrVofkgdJAnDj4ig8m1jTxPpXjOFEZT5NDIMIAItlkPrjbaVG/xm49DPbSr8U2W8jCRQjMaGXYtjR73KI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715134100; c=relaxed/simple; bh=agy9+JvSsjkh/8vuiZScDKeMv5BxMXimZr+iwOD9br0=; h=Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=WBtxiEpyu1JuI7ZYqhjNOKlEgTv8/ZPy/EgznJl5MapHAOcVcm3PvWv07BrQf9wkNUIQfrOblpUVcFBy+WiqbnNwO/LInv/OIrVDdB/zrvn3z+BvQ5kRfLwem1K8yolpdTZN3W4GV/7mFDiAK0K2sC4tkWvNfPF7Je8mqHygMcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=EJQIVfmk; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2df83058d48so46044061fa.1 for ; Tue, 07 May 2024 19:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1715134096; x=1715738896; darn=vger.kernel.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8RA5zO8osT581yFAhgKqZ9U4T2nN2QEoLCxUvIOmSqY=; b=EJQIVfmkZsTCAm8E4kDj+88nxmhpGc9rK1sBXSVsOl6SW6BYmrRX0vn/GPjGjr2vqJ l4OTyYrsKlM3svY0njbmWpBrU2wb/mAKTQreuq0/sK2tBOcruo65AVRaboQHh6ocamqN pK/boy0bupvFzAw3dWHz61fKvqeGQOMBeUexPChWm93uhXZWL0K16XvEav6jl8dTm1Nh z3YpC+vR/bKjm4qMRPbccfkeeZIh5RNa45Kl5e5bGDaBi5Rco2yXE9II4i4apG6/j5HH BdaNEMduq/0k4jtQANF7XZ1O4YA59iNsEz1bdJuXkycbwAJPT4WiBBpEez0vJMk1LAQc nVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715134096; x=1715738896; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8RA5zO8osT581yFAhgKqZ9U4T2nN2QEoLCxUvIOmSqY=; b=TJ6e/aDSdSsaKfow6NlzEvuDbKoom2BlM3eccOJxEwO5xz5EkQNT4Jumy/peD8FQhw kO3ShRNsR+BE8XJgPXulmTMGzYfkefeEJETNhckjaHSpQuTLiNSjZe1UZCH+znBQ9WDQ Y0u+Eo0sGllImWKvvt5wy/yyODjxhiMqBEWw2WkWflCRRYB1HZu2olIp1Dm/ACzg5fHe TQIN80V4ioRGTrwErJmkH+N+WA3JRXhQU3i6/mMampzPAt2nnDM4M3MiwIdTwixxt7bn M1xSoM1YRcE63swJ2Kgmu0aK1Wcqq1cnRUvuum/otMxw4J3ydwisF+NadpUvYMwsp9+f ovhA== X-Forwarded-Encrypted: i=1; AJvYcCXeXfYgDld5qfmX40gIccOu/IEqdMek3+KU6KRH4R2YL0J4b63i96WIiDhMK93wzP+M+XrvAo47jkxqXxdccaHMC3DLRHzpil55ExxL X-Gm-Message-State: AOJu0YziooWTU5g2L9XAwjOHWx94vWZ7/8HK392pmfswo3BNOKYFkVm1 M9f3I6xoSlrnRHquGEyTlK5YkPBIJ9JWkq5bS2GFLht55Pghih1QbmquutK7DY4= X-Received: by 2002:a2e:9cc2:0:b0:2d6:f69d:c74c with SMTP id 38308e7fff4ca-2e4476afb1dmr7263991fa.38.1715134095969; Tue, 07 May 2024 19:08:15 -0700 (PDT) Received: from smtpclient.apple ([23.247.139.60]) by smtp.gmail.com with ESMTPSA id d13-20020aa7868d000000b006f49c07f9dasm530017pfo.21.2024.05.07.19.08.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 May 2024 19:08:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.500.171.1.1\)) Subject: Re: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h From: Glass Su In-Reply-To: <20240507153757.150891-1-pvorel@suse.cz> Date: Wed, 8 May 2024 10:08:01 +0800 Cc: linux-bcachefs@vger.kernel.org, Kent Overstreet , Su Yue , Brian Foster , Coly Li , linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <6D9FCB08-480D-4CA0-82E2-284B1F2BF8FD@suse.com> References: <20240507153757.150891-1-pvorel@suse.cz> To: Petr Vorel X-Mailer: Apple Mail (2.3774.500.171.1.1) > On May 7, 2024, at 23:37, Petr Vorel wrote: >=20 > Move BCACHEFS_STATFS_MAGIC value to UAPI under > BCACHEFS_SUPER_MAGIC definition (use common approach for name) and = reuse the > definition in bcachefs_format.h BCACHEFS_STATFS_MAGIC. >=20 > There are other bcachefs magic definitions: BCACHE_MAGIC, BCHFS_MAGIC, > which use UUID_INIT() and are used only in libbcachefs. Therefore move > only BCACHEFS_STATFS_MAGIC value, which can be used outside of > libbcachefs for f_type field in struct statfs in statfs() or = fstatfs(). >=20 > Suggested-by: Su Yue Would you kindly amend it to Su Yue or Kent can help if the patch is going to be applied. > Signed-off-by: Petr Vorel > --- > Changes v2->v3: > * Align tab with other entries. >=20 > Changes v1->v2 (all suggested by Brian Foster - thanks!): > * rename constant to BCACHEFS_SUPER_MAGIC, > * keep BCACHEFS_STATFS_MAGIC in bcachefs_format.h, just include > and use BCACHEFS_SUPER_MAGIC definition, > * move the constant to the first chunk. >=20 > Kind regards, > Petr >=20 > fs/bcachefs/bcachefs_format.h | 3 ++- > include/uapi/linux/magic.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/fs/bcachefs/bcachefs_format.h = b/fs/bcachefs/bcachefs_format.h > index f7fbfccd2b1e..3b831415409b 100644 > --- a/fs/bcachefs/bcachefs_format.h > +++ b/fs/bcachefs/bcachefs_format.h > @@ -76,6 +76,7 @@ > #include > #include > #include > +#include > #include "vstructs.h" >=20 > #ifdef __KERNEL__ > @@ -1275,7 +1276,7 @@ enum bch_compression_opts { > UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \ > 0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef) >=20 > -#define BCACHEFS_STATFS_MAGIC 0xca451a4e > +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC >=20 > #define JSET_MAGIC __cpu_to_le64(0x245235c1a3625032ULL) > #define BSET_MAGIC __cpu_to_le64(0x90135c78b99e07f5ULL) > diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h > index 1b40a968ba91..bb575f3ab45e 100644 > --- a/include/uapi/linux/magic.h > +++ b/include/uapi/linux/magic.h > @@ -37,6 +37,7 @@ > #define HOSTFS_SUPER_MAGIC 0x00c0ffee > #define OVERLAYFS_SUPER_MAGIC 0x794c7630 > #define FUSE_SUPER_MAGIC 0x65735546 > +#define BCACHEFS_SUPER_MAGIC 0xca451a4e IIUC, due to some historical reasons bcachefs used to switched ondisk sb magic from BCACHE_MAGIC to BCHFS_MAGIC. Other major fses uses *_SUPER_MAGIC both for ondisk=20 sb magic, kstatfs::f_type and super_block::s_magic. However, for bcacehfs there are three magic numbers. Anyway, it looks good to me so far: Reviewed-by: Su Yue =20 =E2=80=94=20 Su > #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ > #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ > --=20 > 2.43.0 >=20 >=20