Re: [PATCH v2 1/5] fs: add generic write-stream management ioctl
From: Kanchan Joshi <hidden>
Date: 2026-03-10 17:55:38
Also in:
linux-fsdevel, linux-xfs
From: Kanchan Joshi <hidden>
Date: 2026-03-10 17:55:38
Also in:
linux-fsdevel, linux-xfs
On 3/9/2026 10:03 PM, Darrick J. Wong wrote:
quoted
+struct fs_write_stream { + __u32 op_flags; /* IN: operation flags */ + __u32 stream_id; /* IN/OUT: stream value to assign/guery */ + __u32 max_streams; /* OUT: max streams values supported */ + __u32 rsvd; +};This isn't an very cohesive interface -- GET_MAX probably only needs op_flags and max_streams, right? And GET/SET only use op_flags and stream_id, right?
Yeah, right. That's the trade-off with swiss army knife type ioctl which uses op_flags to decide what it should do. Apart from keeping a single ioctl I was thinking a bit about extensibility (for anything new we may be able to do a new op_flags with some rsvd or union) too. But if you feel strong about this, I can take 3 ioctl route?
quoted
+#define FS_WRITE_STREAM_OP_GET_MAX (1 << 0) +#define FS_WRITE_STREAM_OP_GET (1 << 1) +#define FS_WRITE_STREAM_OP_SET (1 << 2) + +#define FS_IOC_WRITE_STREAM _IOWR('f', 43, struct fs_write_stream)EXT4_IOC_CHECKPOINT already took 'f' / 43. I/think/ there's no problem because its argument is a u32 and ioctl definitions incorporate the lower bits of of the argument size but you might want to be careful anyway.
Indeed, thanks!