Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154256
b: refs/heads/master
c: 494b3ee
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jun 22, 2009
1 parent fef4f98 commit fa67d8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8627921fa2ef6d40fd9b787e163ba3a9ff8f471d
refs/heads/master: 494b3ee7d4f69210def80aecce28d08c3f0755d5
11 changes: 11 additions & 0 deletions trunk/drivers/md/dm-snap.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv)

ti->private = s;
ti->split_io = s->store->chunk_size;
ti->num_flush_requests = 1;

return 0;

Expand Down Expand Up @@ -1030,6 +1031,11 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
chunk_t chunk;
struct dm_snap_pending_exception *pe = NULL;

if (unlikely(bio_empty_barrier(bio))) {
bio->bi_bdev = s->store->cow->bdev;
return DM_MAPIO_REMAPPED;
}

chunk = sector_to_chunk(s->store, bio->bi_sector);

/* Full snapshots are not usable */
Expand Down Expand Up @@ -1338,6 +1344,8 @@ static int origin_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}

ti->private = dev;
ti->num_flush_requests = 1;

return 0;
}

Expand All @@ -1353,6 +1361,9 @@ static int origin_map(struct dm_target *ti, struct bio *bio,
struct dm_dev *dev = ti->private;
bio->bi_bdev = dev->bdev;

if (unlikely(bio_empty_barrier(bio)))
return DM_MAPIO_REMAPPED;

/* Only tell snapshots if this is a write */
return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : DM_MAPIO_REMAPPED;
}
Expand Down

0 comments on commit fa67d8f

Please sign in to comment.