On Thu, Mar 01, 2012 at 10:22:45PM -0500, Martin K. Petersen wrote:
> From: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>
>
> Discards were globally marked as mergeable and as a result we had
> several code paths that explicitly disabled merging when discard was
> set. Mark discard requests as unmergable and remove special-casing of
> REQ_DISCARD. The relevant nomerge flags are consolidated in blk_types.h,
> and rq_mergeable() and bio_mergeable() have been modified to use them.
>
> bio_is_rw() is used in place of bio_has_data() a few places. This is
> done to to distinguish true reads and writes from other fs type requests
> that carry a payload (e.g. WRITE SAME).
>
> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
> Acked-by: Mike Snitzer <snitzer@xxxxxxxxxx>
> ---
> block/blk-core.c | 10 +++++-----
> block/blk-merge.c | 22 +---------------------
> block/elevator.c | 6 ++----
> include/linux/bio.h | 23 +++++++++++++++++++++--
> include/linux/blk_types.h | 4 ++++
> include/linux/blkdev.h | 23 +++++++++++------------
> 6 files changed, 44 insertions(+), 44 deletions(-)
While you are removing special casing of REQ_DISCARD, may be following is
also a good candidate.
static inline int blk_do_io_stat(struct request *rq)
{
return rq->rq_disk &&
(rq->cmd_flags & REQ_IO_STAT) &&
(rq->cmd_type == REQ_TYPE_FS ||
(rq->cmd_flags & REQ_DISCARD));
}
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
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]