aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoecmd.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-12-06 17:00:33 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-12-06 17:00:33 +0000
commit3d14b5beba35250c548d3851a2b84fce742d8311 (patch)
tree065e3d93c3fcbc5ee4c44fa78662393cddbdf6de /drivers/block/aoe/aoecmd.c
parentMerge branch 'devel-stable' into devel (diff)
parentFix soc_common PCMCIA configuration (diff)
downloadlinux-dev-3d14b5beba35250c548d3851a2b84fce742d8311.tar.xz
linux-dev-3d14b5beba35250c548d3851a2b84fce742d8311.zip
Merge branch 'sa1100' into devel
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r--drivers/block/aoe/aoecmd.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 965ece2c7e4d..13bb69d2abb3 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -735,6 +735,21 @@ diskstats(struct gendisk *disk, struct bio *bio, ulong duration, sector_t sector
part_stat_unlock();
}
+/*
+ * Ensure we don't create aliases in VI caches
+ */
+static inline void
+killalias(struct bio *bio)
+{
+ struct bio_vec *bv;
+ int i;
+
+ if (bio_data_dir(bio) == READ)
+ __bio_for_each_segment(bv, bio, i, 0) {
+ flush_dcache_page(bv->bv_page);
+ }
+}
+
void
aoecmd_ata_rsp(struct sk_buff *skb)
{
@@ -853,8 +868,12 @@ aoecmd_ata_rsp(struct sk_buff *skb)
if (buf && --buf->nframesout == 0 && buf->resid == 0) {
diskstats(d->gd, buf->bio, jiffies - buf->stime, buf->sector);
- n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
- bio_endio(buf->bio, n);
+ if (buf->flags & BUFFL_FAIL)
+ bio_endio(buf->bio, -EIO);
+ else {
+ killalias(buf->bio);
+ bio_endio(buf->bio, 0);
+ }
mempool_free(buf, d->bufpool);
}