Re: [PATCH 1/7] block: Clean up merge logic

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

 



On Thu, Mar 01, 2012 at 10:22:45PM -0500, Martin K. Petersen wrote:

[..]
> -static inline int bio_has_data(struct bio *bio)
> +static inline bool bio_has_data(struct bio *bio)
>  {
> -	return bio && bio->bi_io_vec != NULL;
> +	if (bio && bio->bi_io_vec)
> +		return true;
> +
> +	return false;
> +}
> +
> +static inline bool bio_is_rw(struct bio *bio)
> +{
> +	if (!bio_has_data(bio))
> +		return false;
> +
> +	return true;
> +}
> +

Hi Martin,

So in this patch bio_is_rw() == bio_is_data(). Do they diverge in later
patches?

> +static inline bool bio_mergeable(struct bio *bio)
> +{
> +	if (bio->bi_rw & REQ_NOMERGE_FLAGS)
> +		return false;
> +
> +	return true;
>  }

Some of the flags in REQ_NOMERGE_FLAGS are rq only and should not be used on
bio. For example REQ_NOMERGE and REQ_STARTED.

Will it be better to define BIO_NOMERGE_FLAGS separately?

Thanks
Vivek
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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