mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
ublk: move ublk_req_build_flags() earlier
Move ublk_req_build_flags() above its callers so it doesn't need to be forward-declared. Signed-off-by: Caleb Sander Mateos <csander@purestorage.com> Reviewed-by: Ming Lei <tom.leiming@gmail.com> Link: https://patch.msgid.link/20260520203654.1413640-2-csander@purestorage.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
5995e751d2
commit
eee9224aff
|
|
@ -359,7 +359,6 @@ static void ublk_buf_cleanup(struct ublk_device *ub);
|
|||
static void ublk_abort_queue(struct ublk_device *ub, struct ublk_queue *ubq);
|
||||
static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub,
|
||||
u16 q_id, u16 tag, struct ublk_io *io);
|
||||
static inline unsigned int ublk_req_build_flags(struct request *req);
|
||||
static void ublk_batch_dispatch(struct ublk_queue *ubq,
|
||||
const struct ublk_batch_io_data *data,
|
||||
struct ublk_batch_fetch_cmd *fcmd);
|
||||
|
|
@ -471,6 +470,37 @@ static inline bool ublk_dev_support_integrity(const struct ublk_device *ub)
|
|||
return ub->dev_info.flags & UBLK_F_INTEGRITY;
|
||||
}
|
||||
|
||||
static inline unsigned int ublk_req_build_flags(struct request *req)
|
||||
{
|
||||
unsigned flags = 0;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_DEV)
|
||||
flags |= UBLK_IO_F_FAILFAST_DEV;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_TRANSPORT)
|
||||
flags |= UBLK_IO_F_FAILFAST_TRANSPORT;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_DRIVER)
|
||||
flags |= UBLK_IO_F_FAILFAST_DRIVER;
|
||||
|
||||
if (req->cmd_flags & REQ_META)
|
||||
flags |= UBLK_IO_F_META;
|
||||
|
||||
if (req->cmd_flags & REQ_FUA)
|
||||
flags |= UBLK_IO_F_FUA;
|
||||
|
||||
if (req->cmd_flags & REQ_NOUNMAP)
|
||||
flags |= UBLK_IO_F_NOUNMAP;
|
||||
|
||||
if (req->cmd_flags & REQ_SWAP)
|
||||
flags |= UBLK_IO_F_SWAP;
|
||||
|
||||
if (blk_integrity_rq(req))
|
||||
flags |= UBLK_IO_F_INTEGRITY;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BLK_DEV_ZONED
|
||||
|
||||
struct ublk_zoned_report_desc {
|
||||
|
|
@ -1438,37 +1468,6 @@ static unsigned int ublk_unmap_io(bool need_map,
|
|||
return rq_bytes;
|
||||
}
|
||||
|
||||
static inline unsigned int ublk_req_build_flags(struct request *req)
|
||||
{
|
||||
unsigned flags = 0;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_DEV)
|
||||
flags |= UBLK_IO_F_FAILFAST_DEV;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_TRANSPORT)
|
||||
flags |= UBLK_IO_F_FAILFAST_TRANSPORT;
|
||||
|
||||
if (req->cmd_flags & REQ_FAILFAST_DRIVER)
|
||||
flags |= UBLK_IO_F_FAILFAST_DRIVER;
|
||||
|
||||
if (req->cmd_flags & REQ_META)
|
||||
flags |= UBLK_IO_F_META;
|
||||
|
||||
if (req->cmd_flags & REQ_FUA)
|
||||
flags |= UBLK_IO_F_FUA;
|
||||
|
||||
if (req->cmd_flags & REQ_NOUNMAP)
|
||||
flags |= UBLK_IO_F_NOUNMAP;
|
||||
|
||||
if (req->cmd_flags & REQ_SWAP)
|
||||
flags |= UBLK_IO_F_SWAP;
|
||||
|
||||
if (blk_integrity_rq(req))
|
||||
flags |= UBLK_IO_F_INTEGRITY;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
static blk_status_t ublk_setup_iod(struct ublk_queue *ubq, struct request *req)
|
||||
{
|
||||
struct ublksrv_io_desc *iod = ublk_get_iod(ubq, req->tag);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user