On Tue, Jul 02, 2024 at 09:55:39PM -0700, Darrick J. Wong wrote: > > Good question. As far as I can tell there is no simply ioctl for it. > > I really wonder if we need an extensible block topology ioctl that we > > can keep adding files for new queue limits, to make it easy to query > > them from userspace without all that sysfs mess.. > > Yeah. Or implement FS_IOC_GETSYSFSPATH for block devices? :P I know people like to fetishize file access (and to be honest from a shell it is really nice), but from a C program would you rather do one ioctl to find a sysfs base path, then do string manipulation to find the actual attribute, then open + read + close it, or do a single ioctl and read a bunch of values from a struct? > > > That's going to take a day or so, I suspect. :/ > > > > No rush, just noticed it. Note that for the discard granularity > > we should also look at the alignment and not just the size. > > <nod> AFAICT the xfs discard code doesn't check the alignment. Maybe > the block layer does, but .. The block layer checks the alignment and silently skips anything not matching it. So not adhering it isn't an error, it might just cause pointless work.