From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>,
David Sterba <dsterba@suse.com>,
Rasmus Villemoes <linux@rasmusvillemoes.dk>
Subject: [PATCH] fs/pipe: stop duplicating union pipe_index declaration
Date: Thu, 23 Oct 2025 10:21:42 +0200 [thread overview]
Message-ID: <20251023082142.2104456-1-linux@rasmusvillemoes.dk> (raw)
Now that we build with -fms-extensions, union pipe_index can be
included as an anonymous member in struct pipe_inode_info, avoiding
the duplication.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
Do we want to do this as well? At the very least it would give some
more test coverage if this could be in -next for most of a cycle.
Context for new people:
https://lore.kernel.org/lkml/CAHk-=wjeZwww6Zswn6F_iZTpUihTSNKYppLqj36iQDDhfntuEw@mail.gmail.com/
https://lore.kernel.org/linux-kbuild/20251020142228.1819871-1-linux@rasmusvillemoes.dk/
include/linux/pipe_fs_i.h | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 9d42d473d201..80539972e569 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -44,12 +44,6 @@ typedef unsigned int pipe_index_t;
typedef unsigned short pipe_index_t;
#endif
-/*
- * We have to declare this outside 'struct pipe_inode_info',
- * but then we can't use 'union pipe_index' for an anonymous
- * union, so we end up having to duplicate this declaration
- * below. Annoying.
- */
union pipe_index {
unsigned long head_tail;
struct {
@@ -87,14 +81,7 @@ struct pipe_inode_info {
struct mutex mutex;
wait_queue_head_t rd_wait, wr_wait;
- /* This has to match the 'union pipe_index' above */
- union {
- unsigned long head_tail;
- struct {
- pipe_index_t head;
- pipe_index_t tail;
- };
- };
+ union pipe_index;
unsigned int max_usage;
unsigned int ring_size;
base-commit: 778740ee2d00e5c04d0c8ffd9c3beea89b1ec554
--
2.51.0
next reply other threads:[~2025-10-23 8:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 8:21 Rasmus Villemoes [this message]
2025-10-23 16:44 ` Nathan Chancellor
2025-10-23 16:48 ` Linus Torvalds
2025-10-29 13:42 ` Christian Brauner
2025-10-29 13:41 ` Christian Brauner
2025-10-29 17:38 ` Nathan Chancellor
2025-10-29 22:25 ` Christian Brauner
2025-10-29 22:53 ` Linus Torvalds
2025-10-29 23:13 ` Christian Brauner
2025-10-29 23:30 ` Nathan Chancellor
2025-10-30 13:23 ` fms extension (Was: [PATCH] fs/pipe: stop duplicating union pipe_index declaration) Christian Brauner
2025-10-30 13:38 ` Ard Biesheuvel
2025-10-30 17:29 ` Nathan Chancellor
2025-10-30 20:16 ` Christian Brauner
2025-10-31 1:34 ` Nathan Chancellor
2025-11-01 13:10 ` Christian Brauner
2025-11-01 16:38 ` Nathan Chancellor
2025-11-06 22:09 ` Christian Brauner
2025-11-06 23:20 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251023082142.2104456-1-linux@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=brauner@kernel.org \
--cc=dsterba@suse.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®