RE: [PATCH v4 2/2] io_uring: add support for IORING_OP_GETDENTS

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

 



> IORING_OP_GETDENTS behaves much like getdents64(2) and takes the same
> arguments, but with a small twist: it takes an additional offset
> argument, and reading from the specified directory starts at the given
> offset.
>
> For the first IORING_OP_GETDENTS call on a directory, the offset
> parameter can be set to zero, and for subsequent calls, it can be
> set to the ->d_off field of the last struct linux_dirent64 returned
> by the previous IORING_OP_GETDENTS call.
>
> Internally, if necessary, IORING_OP_GETDENTS will vfs_llseek() to
> the right directory position before calling vfs_getdents().

For my envisioned use case it would be important to support reading from
the current file position when offset == -1 (IORING_FEAT_RW_CUR_POS).
Among other things, this would let me fully read a directory with fewer
round-trips.  Normally after the first getdents(), another one must be
issued to distinguish between EOF and a short first read.  It would be
nice to do both calls with linked SQEs so I could immediately know that
I've reached the end of the directory.

> IORING_OP_GETDENTS may or may not update the specified directory's
> file offset, and the file offset should not be relied upon having
> any particular value during or after an IORING_OP_GETDENTS call.

Obviously for the above to work, we'd have to get rid of this limitation. Is that possible?



[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