mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
config: remove HAVE_BLK_MQ
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
committed by
Brian Behlendorf
parent
1bf93713d8
commit
dcb8e5ec7c
@@ -35,11 +35,7 @@
|
||||
#include <linux/major.h>
|
||||
#include <linux/msdos_fs.h> /* for SECTOR_* */
|
||||
#include <linux/bio.h>
|
||||
|
||||
#ifdef HAVE_BLK_MQ
|
||||
#include <linux/blk-mq.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* 6.11 API
|
||||
@@ -558,7 +554,6 @@ blk_generic_alloc_queue(make_request_fn make_request, int node_id)
|
||||
static inline int
|
||||
io_data_dir(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL) {
|
||||
if (op_is_write(req_op(rq))) {
|
||||
return (WRITE);
|
||||
@@ -566,57 +561,38 @@ io_data_dir(struct bio *bio, struct request *rq)
|
||||
return (READ);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_data_dir(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_flush(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_FLUSH);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_flush(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_discard(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_DISCARD);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_discard(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_secure_erase(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (req_op(rq) == REQ_OP_SECURE_ERASE);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_secure_erase(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_is_fua(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (rq->cmd_flags & REQ_FUA);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_is_fua(bio));
|
||||
}
|
||||
|
||||
@@ -624,36 +600,24 @@ io_is_fua(struct bio *bio, struct request *rq)
|
||||
static inline uint64_t
|
||||
io_offset(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (blk_rq_pos(rq) << 9);
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (BIO_BI_SECTOR(bio) << 9);
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
io_size(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (blk_rq_bytes(rq));
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (BIO_BI_SIZE(bio));
|
||||
}
|
||||
|
||||
static inline int
|
||||
io_has_data(struct bio *bio, struct request *rq)
|
||||
{
|
||||
#ifdef HAVE_BLK_MQ
|
||||
if (rq != NULL)
|
||||
return (bio_has_data(rq->bio));
|
||||
#else
|
||||
ASSERT3P(rq, ==, NULL);
|
||||
#endif
|
||||
return (bio_has_data(bio));
|
||||
}
|
||||
#endif /* _ZFS_BLKDEV_H */
|
||||
|
||||
Reference in New Issue
Block a user