On Mon, Apr 12, 2021 at 11:29:47AM +0100, Christoph Hellwig wrote: > On Mon, Apr 12, 2021 at 06:20:55PM +0800, Ming Lei wrote: > > > > +static inline void *bio_grp_data(struct bio *bio) > > > > +{ > > > > + return bio->bi_poll; > > > > +} > > > > > > What is the purpose of this helper? And why does it have to lose the > > > type information? > > > > This patch stores bio->bi_end_io(shared with ->bi_poll) into one per-task > > data structure, and links all bios sharing same .bi_end_io into one list > > via ->bi_end_io. And their ->bi_end_io is recovered before calling > > bio_endio(). > > > > The helper is used for checking if one bio can be added to bio group, > > and storing the data. The helper just serves for document purpose. > > > > And the type info doesn't matter. > > So why is bi_poll typed to start with then just to need a accessor > to remove the typer information? It should be a bug from the beginning, either .bi_poll can be dropped or it should be 'void *'. Just find it, thanks for pointing it out. Thanks, Ming -- dm-devel mailing list dm-devel@xxxxxxxxxx https://listman.redhat.com/mailman/listinfo/dm-devel