#ifndef _LINUX_BLK_INTEGRITY_H
#define _LINUX_BLK_INTEGRITY_H
#include <linux/blk-mq.h>
#include <linux/bio-integrity.h>
struct request;
enum blk_integrity_flags { … };
const char *blk_integrity_profile_name(struct blk_integrity *bi);
bool queue_limits_stack_integrity(struct queue_limits *t,
struct queue_limits *b);
static inline bool queue_limits_stack_integrity_bdev(struct queue_limits *t,
struct block_device *bdev)
{ … }
#ifdef CONFIG_BLK_DEV_INTEGRITY
int blk_rq_map_integrity_sg(struct request_queue *, struct bio *,
struct scatterlist *);
int blk_rq_count_integrity_sg(struct request_queue *, struct bio *);
static inline bool
blk_integrity_queue_supports_integrity(struct request_queue *q)
{ … }
static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
{ … }
static inline struct blk_integrity *
bdev_get_integrity(struct block_device *bdev)
{ … }
static inline unsigned short
queue_max_integrity_segments(const struct request_queue *q)
{ … }
static inline unsigned int bio_integrity_intervals(struct blk_integrity *bi,
unsigned int sectors)
{ … }
static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
unsigned int sectors)
{ … }
static inline bool blk_integrity_rq(struct request *rq)
{ … }
static inline struct bio_vec rq_integrity_vec(struct request *rq)
{ … }
#else
static inline int blk_rq_count_integrity_sg(struct request_queue *q,
struct bio *b)
{
return 0;
}
static inline int blk_rq_map_integrity_sg(struct request_queue *q,
struct bio *b,
struct scatterlist *s)
{
return 0;
}
static inline struct blk_integrity *bdev_get_integrity(struct block_device *b)
{
return NULL;
}
static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
{
return NULL;
}
static inline bool
blk_integrity_queue_supports_integrity(struct request_queue *q)
{
return false;
}
static inline unsigned short
queue_max_integrity_segments(const struct request_queue *q)
{
return 0;
}
static inline unsigned int bio_integrity_intervals(struct blk_integrity *bi,
unsigned int sectors)
{
return 0;
}
static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
unsigned int sectors)
{
return 0;
}
static inline int blk_integrity_rq(struct request *rq)
{
return 0;
}
static inline struct bio_vec rq_integrity_vec(struct request *rq)
{
return (struct bio_vec){ };
}
#endif
#endif