Martin K. Petersen wrote: > diff --git a/include/linux/bio.h b/include/linux/bio.h > index 129a9c0..b0d25ea 100644 > --- a/include/linux/bio.h > +++ b/include/linux/bio.h > @@ -358,9 +358,15 @@ static inline char *__bio_kmap_irq(struct bio *bio, > unsigned short idx, /* > * Check whether this bio carries any data or not. A NULL bio is allowed. > */ > -static inline int bio_has_data(struct bio *bio) > +static inline unsigned int bio_has_data(struct bio *bio) > { > - return bio && bio->bi_io_vec != NULL; > + if (!bio) > + return 0; > + > + if (bio->bi_rw & REQ_DISCARD) > + return 0; > + > + return bio->bi_io_vec != NULL; > } Shouldn't this be just "bool"? Eike
Attachment:
signature.asc
Description: This is a digitally signed message part.