Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jan 2022 00:04:59 -0500
From:      Alexander Motin <mav@FreeBSD.org>
To:        Alan Somers <asomers@freebsd.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Subject:   Re: fspacectl meets DIOCGDELETEE
Message-ID:  <9a8bb084-394c-6948-1e57-ff9732b93532@FreeBSD.org>
In-Reply-To: <CAOtMX2hjiP-0pVB7E-D0DXfzgw66hVZ0NF_qm2a9DLfrNPFppw@mail.gmail.com>
References:  <CAOtMX2hjiP-0pVB7E-D0DXfzgw66hVZ0NF_qm2a9DLfrNPFppw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9a8bb084-394c-6948-1e57-ff9732b93532>