Re: [PATCH 1/2] io_uring: add support for truncate

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

 



On 1/22/24 1:12 PM, Gabriel Krisman Bertazi wrote:
> Tony Solomonik <tony.solomonik@xxxxxxxxx> writes:
> 
>> Libraries that are built on io_uring currently need to maintain a
>> separate thread pool implementation when they want to truncate a file.
> 
> I don't think it makes sense to have both ftruncate and truncate in
> io_uring.  One can just as easily link an open+ftruncate to have the
> same semantics in one go.

Yeah, see comment on the life time issue with this one as well, which
is avoided with the fd variant. So if just having the ftruncate variant
is good enough, that's solve that headache too. And if done like I
suggested where fd must be valid and we -EINVAL on sqe->addr being
set, you could always add truncate by path functionality later on top
without requiring a new opcode just for that.

-- 
Jens Axboe






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux