Received: by 2002:ab2:7104:0:b0:1f7:f6c3:9cb1 with SMTP id z4csp33348lql; Tue, 7 May 2024 09:04:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3DYkdhozN20KFNpFAiaOO6JVRQSKlfN96HihIGoUAKMRS0DOF+G7onnofFq5j1+dqoC1JBXZ2PMPj11aJhFhMkpjY1KUXZw0aoCx4FQ== X-Google-Smtp-Source: AGHT+IEUBJSERQIZMrlbUWxfxmJoXj1UgBzsmn/VUz/aFLzLO8RD02plYIm8wKUjluy2VoWT8hag X-Received: by 2002:a17:90a:468f:b0:2ac:f010:b1c0 with SMTP id z15-20020a17090a468f00b002acf010b1c0mr11748247pjf.22.1715097859679; Tue, 07 May 2024 09:04:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715097859; cv=pass; d=google.com; s=arc-20160816; b=O/kR0772103L9oXni6Q9CE/pH7SZruyZ+nRAQNgBVPmdqT0/LAeStT8HIkHaSuvtpV bW2qVR4UneOKaDShluh4Bk3c+c4O7MCTgpsR6xKPu+T7opL5AOrGSxn/GlmfDtIUEKKn 2TjlRomH4ey7P/+vd++BiUS7Bc4Wib6ke6mDELODn6l+BUc5dZc44xYUQNwlxO1uV8DR N2RUIGwepOgFgPoHagCkZNdNHn2VNQe6Oh2KBlDC/C8pEALEBbTjFfCaG2yeLCrt8dUa AuUqKV56YdVl8HhslefNBSZaOJ4MnQs/JXaVtGu+3hk4bR8KBU9WuM0/KMx35+ZDEp75 eM/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=s8tHyXfzGfTlsq3wnZwT9oRxMRdo1cSBYtbKiUtIQco=; fh=3+/T/v8jJutehielYWUTF5cROGsveUFuE03GLJUrW6I=; b=xmP1cJ2yqbc5g7s+IMnSybxnBEkg80yQsXYXJQUtiW4CigbL9ysxpfGxq43OtFbJ04 FgzYGkoLOJJVuOBLhec4YavXfzOCiSiEMqf4lfhSdLHUdy+luKMQ+14KtmYnw5lgZGsJ daqn3bcUvx34qxfxMJdPlo1ydOa+XM6JwFHN47ZXAsQbZ0fL0zGBY7XUTZDG1Mr18iWX KruJtZ+TunnTSZDMdALqqigvSEaKoRhk/wPAGKazxVSmdVBlo4lfpzg+VfZWpKfNzyNR k7fymtV8naBSQFZMmy1FTiJZsWY66/KnxKoRnDCvgDPtKp9w9DFnG3fiU0OJPv6ItYC/ QIMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aMZAFd2W; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aMZAFd2W; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-171705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171705-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b14-20020a63714e000000b0060473c6a90dsi10001320pgn.437.2024.05.07.09.04.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:04:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171705-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.cz header.s=susede2_rsa header.b=aMZAFd2W; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aMZAFd2W; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-kernel+bounces-171705-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171705-linux.lists.archive=gmail.com@vger.kernel.org" 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 2516DB22588 for ; Tue, 7 May 2024 15:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C38C31649BF; Tue, 7 May 2024 15:38:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="aMZAFd2W"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="UWoWzIcc"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="aMZAFd2W"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="UWoWzIcc" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 30A2F15E1E2; Tue, 7 May 2024 15:38:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715096293; cv=none; b=Otlo7vLhGy6jMa0/U6eK9J/lMjcaPZRsTpiGZI+OdLq144y5XVKWIA5oUH5RQz3o5/MtiCt71pUXRtS4WpDU0d3znj6RK0HbQQWkMfhiZsgKGp0Ukb630GXVquUdwD7MKzNcdKVK2ZwVLKTDOWCr8Kd9poe2vah0cbFoltywRjY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715096293; c=relaxed/simple; bh=xKF1H9j1MZHhQGjnP4Li4IMqEqKEwQtaBsnmRFKfjVA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=C7w9l3I2lcmPOiBolb/UBIXWBqQWizvseZj1b7j4ZQ1JMu/qUIPnpp1fAD4SCrPm5qXY3ayIJao/EYXBWtwOBzSf3UO4bxvQ1Ar1ipDLPeheGY6ytfUb9gD76h66v2XebQbEoKoaq0W54XUUGGGSVF1SYdjw9u1980AxmJkJs8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=aMZAFd2W; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=UWoWzIcc; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=aMZAFd2W; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=UWoWzIcc; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 84E5F20C58; Tue, 7 May 2024 15:38:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715096290; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s8tHyXfzGfTlsq3wnZwT9oRxMRdo1cSBYtbKiUtIQco=; b=aMZAFd2WDyOo3kNlkRIXgQyVXnNAfJqvvOWcSJLyMpKKneL1ttvioTqbihySrZ8/uzl1co U2s82NePu7LvkW/lZQvwdJPPFOk0YmX77qwhNYcrr9m1zCWJe08hDR/uERFKPo0t1jIeW3 jsk7abCMZh5im1q4Yizd4/YW571q33I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715096290; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s8tHyXfzGfTlsq3wnZwT9oRxMRdo1cSBYtbKiUtIQco=; b=UWoWzIcc3FV9goXAOBGFfxjWlWWh2/qs02leEd1u4ze2R6INRvtVZv0HFE3ugjv5dfJ5uG CZB7j9UJouyoI+Dg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1715096290; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s8tHyXfzGfTlsq3wnZwT9oRxMRdo1cSBYtbKiUtIQco=; b=aMZAFd2WDyOo3kNlkRIXgQyVXnNAfJqvvOWcSJLyMpKKneL1ttvioTqbihySrZ8/uzl1co U2s82NePu7LvkW/lZQvwdJPPFOk0YmX77qwhNYcrr9m1zCWJe08hDR/uERFKPo0t1jIeW3 jsk7abCMZh5im1q4Yizd4/YW571q33I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1715096290; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s8tHyXfzGfTlsq3wnZwT9oRxMRdo1cSBYtbKiUtIQco=; b=UWoWzIcc3FV9goXAOBGFfxjWlWWh2/qs02leEd1u4ze2R6INRvtVZv0HFE3ugjv5dfJ5uG CZB7j9UJouyoI+Dg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4EF78139CB; Tue, 7 May 2024 15:38:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id IAEpEeFKOmZ/VwAAD6G6ig (envelope-from ); Tue, 07 May 2024 15:38:09 +0000 From: Petr Vorel To: linux-bcachefs@vger.kernel.org Cc: Petr Vorel , Kent Overstreet , Su Yue , Brian Foster , Coly Li , linux-kernel@vger.kernel.org Subject: [PATCH v3 1/1] bcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h Date: Tue, 7 May 2024 17:37:57 +0200 Message-ID: <20240507153757.150891-1-pvorel@suse.cz> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Flag: NO X-Spam-Score: -2.80 X-Spam-Level: X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns] 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. 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(). Suggested-by: Su Yue Signed-off-by: Petr Vorel --- Changes v2->v3: * Align tab with other entries. 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. Kind regards, Petr fs/bcachefs/bcachefs_format.h | 3 ++- include/uapi/linux/magic.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) 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" #ifdef __KERNEL__ @@ -1275,7 +1276,7 @@ enum bch_compression_opts { UUID_INIT(0xc68573f6, 0x66ce, 0x90a9, \ 0xd9, 0x6a, 0x60, 0xcf, 0x80, 0x3d, 0xf7, 0xef) -#define BCACHEFS_STATFS_MAGIC 0xca451a4e +#define BCACHEFS_STATFS_MAGIC BCACHEFS_SUPER_MAGIC #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 #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ -- 2.43.0