lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  4 Aug 2023 13:46:08 +0200
From:   "Andreas Hindborg (Samsung)" <nmi@...aspace.dk>
To:     Ming Lei <ming.lei@...hat.com>
Cc:     Aravind Ramesh <Aravind.Ramesh@....com>,
        Christoph Hellwig <hch@...radead.org>, gost.dev@...sung.com,
        Minwoo Im <minwoo.im.dev@...il.com>,
        Hans Holmberg <Hans.Holmberg@....com>,
        Matias Bjorling <Matias.Bjorling@....com>,
        Damien Le Moal <dlemoal@...nel.org>,
        Andreas Hindborg <a.hindborg@...sung.com>,
        Johannes Thumshirn <jth@...nel.org>,
        linux-kernel@...r.kernel.org (open list),
        Jens Axboe <axboe@...nel.dk>,
        linux-block@...r.kernel.org (open list:BLOCK LAYER),
        Johannes Thumshirn <johannes.thumshirn@....com>
Subject: [PATCH v11 1/3] ublk: add helper to check if device supports user copy

From: Andreas Hindborg <a.hindborg@...sung.com>

This will be used by ublk zoned storage support.

Signed-off-by: Andreas Hindborg <a.hindborg@...sung.com>
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Reviewed-by: Damien Le Moal <dlemoal@...nel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@....com>
---
 drivers/block/ublk_drv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ublk_drv.c b/drivers/block/ublk_drv.c
index 21d2e71c5514..db3523e281a6 100644
--- a/drivers/block/ublk_drv.c
+++ b/drivers/block/ublk_drv.c
@@ -185,6 +185,11 @@ struct ublk_params_header {
 	__u32	types;
 };
 
+static inline bool ublk_dev_is_user_copy(const struct ublk_device *ub)
+{
+	return ub->dev_info.flags & UBLK_F_USER_COPY;
+}
+
 static inline void __ublk_complete_rq(struct request *req);
 static void ublk_complete_rq(struct kref *ref);
 
@@ -2038,7 +2043,7 @@ static int ublk_ctrl_add_dev(struct io_uring_cmd *cmd)
 		UBLK_F_URING_CMD_COMP_IN_TASK;
 
 	/* GET_DATA isn't needed any more with USER_COPY */
-	if (ub->dev_info.flags & UBLK_F_USER_COPY)
+	if (ublk_dev_is_user_copy(ub))
 		ub->dev_info.flags &= ~UBLK_F_NEED_GET_DATA;
 
 	/* We are not ready to support zero copy */
-- 
2.41.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ