Re: [PATCH 1/5] block: Implement support for WRITE SAME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux