summaryrefslogtreecommitdiff
path: root/include/uapi/linux/ublk_cmd.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2022-07-22 13:38:17 +0300
committerJens Axboe <axboe@kernel.dk>2022-07-22 18:22:53 +0300
commit6d8c5afc9ab14595707ff25d971dde45728eba3e (patch)
treea92d1aaca0444fde9446fb4b2316b2301c861726 /include/uapi/linux/ublk_cmd.h
parentfa9482e0b23d9abe7034becff59daeaba09146ff (diff)
downloadlinux-6d8c5afc9ab14595707ff25d971dde45728eba3e.tar.xz
ublk_drv: make sure that correct flags(features) returned to userspace
Userspace may support more features or new added flags, but the driver side can be old, so make sure correct flags(features) returned to userpsace, then userspace can work as expected. Also mark the 2nd flags as reversed, just use the 1st one. When we run out of flags, the reserved one can be handled at that time. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/20220722103817.631258-3-ming.lei@redhat.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/uapi/linux/ublk_cmd.h')
-rw-r--r--include/uapi/linux/ublk_cmd.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/uapi/linux/ublk_cmd.h b/include/uapi/linux/ublk_cmd.h
index 917580b34198..ca33092354ab 100644
--- a/include/uapi/linux/ublk_cmd.h
+++ b/include/uapi/linux/ublk_cmd.h
@@ -46,13 +46,13 @@
* zero copy requires 4k block size, and can remap ublk driver's io
* request into ublksrv's vm space
*/
-#define UBLK_F_SUPPORT_ZERO_COPY (1UL << 0)
+#define UBLK_F_SUPPORT_ZERO_COPY (1ULL << 0)
/*
* Force to complete io cmd via io_uring_cmd_complete_in_task so that
* performance comparison is done easily with using task_work_add
*/
-#define UBLK_F_URING_CMD_COMP_IN_TASK (1UL << 1)
+#define UBLK_F_URING_CMD_COMP_IN_TASK (1ULL << 1)
/* device state */
#define UBLK_S_DEV_DEAD 0
@@ -88,7 +88,8 @@ struct ublksrv_ctrl_dev_info {
__s32 ublksrv_pid;
__s32 reserved0;
- __u64 flags[2];
+ __u64 flags;
+ __u64 flags_reserved;
/* For ublksrv internal use, invisible to ublk driver */
__u64 ublksrv_flags;