Re: [PATCH RFC v2 02/14] md/md-bitmap: pass discard information to bitmap_{start, end}write

From: Christoph Hellwig
Date: Fri Apr 04 2025 - 05:30:07 EST


> int (*startwrite)(struct mddev *mddev, sector_t offset,
> - unsigned long sectors);
> + unsigned long sectors, bool is_discard);
> void (*endwrite)(struct mddev *mddev, sector_t offset,
> - unsigned long sectors);
> + unsigned long sectors, bool is_discard);

a bool discard is not a very good interface. I'd expect an op enum or a set
of flag to properly describe it.

But is start/end write really the right interface for discard or should it
have it's own set of ops?