On 6/30/22 08:31, Bart Van Assche wrote: > Improve static type checking by using the enum req_op type for arguments > that represent a request operation. > > Cc: Alasdair Kergon <agk@xxxxxxxxxx> > Cc: Mike Snitzer <snitzer@xxxxxxxxxx> > Cc: Damien Le Moal <damien.lemoal@xxxxxxx> > Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> > --- > drivers/md/dm-zoned-metadata.c | 5 +++-- > drivers/md/dm-zoned.h | 2 +- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c > index d1ea66114d14..34db364c23a8 100644 > --- a/drivers/md/dm-zoned-metadata.c > +++ b/drivers/md/dm-zoned-metadata.c > @@ -737,7 +737,7 @@ static int dmz_write_mblock(struct dmz_metadata *zmd, struct dmz_mblock *mblk, > /* > * Read/write a metadata block. > */ > -static int dmz_rdwr_block(struct dmz_dev *dev, int op, > +static int dmz_rdwr_block(struct dmz_dev *dev, enum req_op op, > sector_t block, struct page *page) > { > struct bio *bio; > @@ -2045,7 +2045,8 @@ struct dm_zone *dmz_get_zone_for_reclaim(struct dmz_metadata *zmd, > * allocated and used to map the chunk. > * The zone returned will be set to the active state. > */ > -struct dm_zone *dmz_get_chunk_mapping(struct dmz_metadata *zmd, unsigned int chunk, int op) > +struct dm_zone *dmz_get_chunk_mapping(struct dmz_metadata *zmd, > + unsigned int chunk, enum req_op op) > { > struct dmz_mblock *dmap_mblk = zmd->map_mblk[chunk >> DMZ_MAP_ENTRIES_SHIFT]; > struct dmz_map *dmap = (struct dmz_map *) dmap_mblk->data; > diff --git a/drivers/md/dm-zoned.h b/drivers/md/dm-zoned.h > index a02744a0846c..265494d3f711 100644 > --- a/drivers/md/dm-zoned.h > +++ b/drivers/md/dm-zoned.h > @@ -248,7 +248,7 @@ struct dm_zone *dmz_get_zone_for_reclaim(struct dmz_metadata *zmd, > unsigned int dev_idx, bool idle); > > struct dm_zone *dmz_get_chunk_mapping(struct dmz_metadata *zmd, > - unsigned int chunk, int op); > + unsigned int chunk, enum req_op op); > void dmz_put_chunk_mapping(struct dmz_metadata *zmd, struct dm_zone *zone); > struct dm_zone *dmz_get_chunk_buffer(struct dmz_metadata *zmd, > struct dm_zone *dzone); Looks good. Reviewed-by: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> -- Damien Le Moal Western Digital Research