Re: [PATCH for-next v3 2/2] fs: add ioctl to query metadata and protection info capabilities

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 11, 2025 at 12:23:00PM +0200, Christian Brauner wrote:
> > +struct logical_block_metadata_cap {
> > +	__u32	lbmd_flags;
> > +	__u16	lbmd_interval;
> > +	__u8	lbmd_size;
> > +	__u8	lbmd_opaque_size;
> > +	__u8	lbmd_opaque_offset;
> > +	__u8	lbmd_pi_size;
> > +	__u8	lbmd_pi_offset;
> > +	__u8	lbmd_guard_tag_type;
> > +	__u8	lbmd_app_tag_size;
> > +	__u8	lbmd_ref_tag_size;
> > +	__u8	lbmd_storage_tag_size;
> > +	__u8	lbmd_rsvd[17];
> 
> Don't do this hard-coded form of extensiblity. ioctl()s are inherently
> extensible because they encode the size. Instead of switching on the
> full ioctl, switch on the ioctl number. See for example fs/pidfs:

Umm, yes and no.  The size encoding in the ioctl is great.  But having
a few fields in a structure that already has flags allows for much
easier extensions for small amounts of data.  Without the reserved
fields, this structure is 15 bytes long.  So we'll need at least 1
do pad to a natural alignment.  I think adding another 16 (aka
two u64s) seems pretty reasonable for painless extensions.

---end quoted text---




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux