Re: fspacectl meets DIOCGDELETEE

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Wed, 19 Jan 2022 05:04:59 UTC
Hi Alan,

On 17.01.2022 23:52, Alan Somers wrote:
> fspacectl(2) does for regular files the same thing that DIOCGDELETE
> does for GEOM devices.  The only differences are that DIOCGDELETE
> requires the operation to be block-aligned, and if interrupted
> DIOCGDELETE doesn't give feedback about partial progress.  Can we
> connect the two?  That would allow a user to free space with a single
> API for both files and devices.  It would require:
> 
> * Adding a d_fspacectl_t member to struct cdevsw
> * Implementing d_fspacectl_t for g_dev_cdevsw by using DIOCGDELETE
> * Implementing .fo_fspacectl for devfs
> * Optionally implementing d_fspacectl on other device types, like zvols.

This reminded me that we also have the same problem with DIOCGFLUSH. 
Unlike regular files cache flush can be sent through devfs only with 
ioctl(), not fsync()/fdatasync().

-- 
Alexander Motin