Re: [PATCH] Add IORING_FEAT_FILES_SKIP feature flag

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

 



On 5/18/21 10:12 AM, Drew DeVault wrote:
> This is aliased to IORING_FEAT_NATIVE_WORKERS, which was shipped in the
> same kernel release. A separate flag is useful because the features are
> unrelated, so user code testing for IORING_FEAT_NATIVE_WORKERS before
> using FILES_SKIP is not very obvious in intent.
> 
> Signed-off-by: Drew DeVault <sir@xxxxxxxxx>
> ---
>  man/io_uring_register.2         | 10 ++++++++--
>  src/include/liburing/io_uring.h |  1 +
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/man/io_uring_register.2 b/man/io_uring_register.2
> index 5326a87..c71ce40 100644
> --- a/man/io_uring_register.2
> +++ b/man/io_uring_register.2
> @@ -156,8 +156,14 @@ since 5.5.
>  File descriptors can be skipped if they are set to
>  .B IORING_REGISTER_FILES_SKIP.
>  Skipping an fd will not touch the file associated with the previous
> -fd at that index. Available since 5.12.
> -
> +fd at that index. Available since 5.12. Availability of this feature is
> +indicated by the presence of the
> +.B IORING_FEAT_FILES_SKIP
> +bit in the
> +.I features
> +field of the
> +.I io_uring_params
> +structure.
>  
>  .TP
>  .B IORING_UNREGISTER_FILES
> diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
> index 5a3cb90..091dcf7 100644
> --- a/src/include/liburing/io_uring.h
> +++ b/src/include/liburing/io_uring.h
> @@ -285,6 +285,7 @@ struct io_uring_params {
>  #define IORING_FEAT_SQPOLL_NONFIXED	(1U << 7)
>  #define IORING_FEAT_EXT_ARG		(1U << 8)
>  #define IORING_FEAT_NATIVE_WORKERS	(1U << 9)
> +#define IORING_FEAT_FILES_SKIP		IORING_FEAT_NATIVE_WORKERS

I don't think this is a great idea. It can be used as a "probably we have
this feature" in userspace, but I don't like aliasing on the kernel side.


-- 
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