Re: Hole-punching, TRIM, etc

From: Conrad Meyer <cem_at_freebsd.org>
Date: Tue, 13 Nov 2018 15:08:51 -0800
On Tue, Nov 13, 2018 at 2:59 PM Alan Somers <asomers_at_freebsd.org> wrote:
>
> On Tue, Nov 13, 2018 at 3:51 PM Conrad Meyer <cem_at_freebsd.org> wrote:
>>
>> On Tue, Nov 13, 2018 at 2:10 PM Alan Somers <asomers_at_freebsd.org> wrote:
>> > ...
>> > 8) Add aio_freesp(2), an asynchronous version of fcntl(F_FREESP).
>>
>> Why not just add DIOCGDELETE support to various VOP_IOCTL
>> implementations?  The file objects forward correctly through vn_ioctl
>> to VOP_IOCTL for both regular files and devfs VCHR nodes.
>>
>> We can emulate the Linux API if we want to be compatible there, but I
>> wouldn't bother with Solaris.
>
> The only reason that I prefer the Solaris API is because it doesn't require adding another syscall, and because Linux's fallocate(2) does a whole bunch of other things besides hole-punching.

I am imagining that if we went this route, we would implement Linux
fallocate as a library shim around the native FreeBSD ioctl (or
whatever) rather than an independent system call.  This would be for
API compatibility, not ABI compatibility.  But Linux compat can be set
aside for now, I think — it's a secondary concern.

> What about an asynchronous version?  ioctl(2) is still synchronous.  Do you see any better way to hole-punch/TRIM asynchronously than with aio?

Yeah, this is a good consideration.  No, I don't have any better
suggestion for an asynchronous API.  In general our VOPs tend to be
synchronous.  Aio does seem like the logical home for a new
asynchronous API.

Best regards,
Conrad
Received on Tue Nov 13 2018 - 22:09:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:19 UTC