dm vdo: fix various blk_opf_t sparse warnings

Use proper blk_opf_t type rather than unsigned int.

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
This commit is contained in:
Mike Snitzer 2024-02-05 21:04:18 -05:00
parent ff91994648
commit a6c05c981e
6 changed files with 10 additions and 10 deletions

View file

@ -1620,7 +1620,7 @@ static void write_initialized_page(struct vdo_completion *completion)
struct block_map_zone *zone = pooled->context;
struct tree_page *tree_page = completion->parent;
struct block_map_page *page = (struct block_map_page *) vio->data;
unsigned int operation = REQ_OP_WRITE | REQ_PRIO;
blk_opf_t operation = REQ_OP_WRITE | REQ_PRIO;
/*
* Now that we know the page has been written at least once, mark the copy we are writing

View file

@ -69,7 +69,7 @@
* ASAP to service heavy load, which is the only place where REQ_BACKGROUND might aid in load
* prioritization.
*/
static unsigned int PASSTHROUGH_FLAGS = (REQ_PRIO | REQ_META | REQ_SYNC | REQ_RAHEAD);
static blk_opf_t PASSTHROUGH_FLAGS = (REQ_PRIO | REQ_META | REQ_SYNC | REQ_RAHEAD);
/**
* DOC:
@ -1570,7 +1570,7 @@ static void read_block(struct vdo_completion *completion)
result = vio_reset_bio(vio, (char *) data_vio->compression.block,
read_endio, REQ_OP_READ, data_vio->mapped.pbn);
} else {
int opf = ((data_vio->user_bio->bi_opf & PASSTHROUGH_FLAGS) | REQ_OP_READ);
blk_opf_t opf = ((data_vio->user_bio->bi_opf & PASSTHROUGH_FLAGS) | REQ_OP_READ);
if (data_vio->is_partial) {
result = vio_reset_bio(vio, vio->data, read_endio, opf,

View file

@ -338,7 +338,7 @@ void vdo_submit_data_vio(struct data_vio *data_vio)
*/
void __submit_metadata_vio(struct vio *vio, physical_block_number_t physical,
bio_end_io_t callback, vdo_action_fn error_handler,
unsigned int operation, char *data)
blk_opf_t operation, char *data)
{
int result;
struct vdo_completion *completion = &vio->completion;

View file

@ -26,11 +26,11 @@ void vdo_submit_data_vio(struct data_vio *data_vio);
void __submit_metadata_vio(struct vio *vio, physical_block_number_t physical,
bio_end_io_t callback, vdo_action_fn error_handler,
unsigned int operation, char *data);
blk_opf_t operation, char *data);
static inline void vdo_submit_metadata_vio(struct vio *vio, physical_block_number_t physical,
bio_end_io_t callback, vdo_action_fn error_handler,
unsigned int operation)
blk_opf_t operation)
{
__submit_metadata_vio(vio, physical, callback, error_handler,
operation, vio->data);

View file

@ -172,7 +172,7 @@ void free_vio(struct vio *vio)
/* Set bio properties for a VDO read or write. */
void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callback,
unsigned int bi_opf, physical_block_number_t pbn)
blk_opf_t bi_opf, physical_block_number_t pbn)
{
struct vdo *vdo = vio->completion.vdo;
struct device_config *config = vdo->device_config;
@ -193,7 +193,7 @@ void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callb
* vio associated with the bio.
*/
int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback,
unsigned int bi_opf, physical_block_number_t pbn)
blk_opf_t bi_opf, physical_block_number_t pbn)
{
int bvec_count, offset, len, i;
struct bio *bio = vio->bio;

View file

@ -119,10 +119,10 @@ static inline void initialize_vio(struct vio *vio, struct bio *bio,
}
void vdo_set_bio_properties(struct bio *bio, struct vio *vio, bio_end_io_t callback,
unsigned int bi_opf, physical_block_number_t pbn);
blk_opf_t bi_opf, physical_block_number_t pbn);
int vio_reset_bio(struct vio *vio, char *data, bio_end_io_t callback,
unsigned int bi_opf, physical_block_number_t pbn);
blk_opf_t bi_opf, physical_block_number_t pbn);
void update_vio_error_stats(struct vio *vio, const char *format, ...)
__printf(2, 3);