aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index b0ce2ce82278..bbf861e4fed1 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -868,7 +868,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
868{ 868{
869 struct exception *e; 869 struct exception *e;
870 struct dm_snapshot *s = (struct dm_snapshot *) ti->private; 870 struct dm_snapshot *s = (struct dm_snapshot *) ti->private;
871 int r = 1; 871 int r = DM_MAPIO_REMAPPED;
872 chunk_t chunk; 872 chunk_t chunk;
873 struct pending_exception *pe = NULL; 873 struct pending_exception *pe = NULL;
874 874
@@ -914,7 +914,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio,
914 remap_exception(s, &pe->e, bio); 914 remap_exception(s, &pe->e, bio);
915 bio_list_add(&pe->snapshot_bios, bio); 915 bio_list_add(&pe->snapshot_bios, bio);
916 916
917 r = 0; 917 r = DM_MAPIO_SUBMITTED;
918 918
919 if (!pe->started) { 919 if (!pe->started) {
920 /* this is protected by snap->lock */ 920 /* this is protected by snap->lock */
@@ -992,7 +992,7 @@ static int snapshot_status(struct dm_target *ti, status_type_t type,
992 *---------------------------------------------------------------*/ 992 *---------------------------------------------------------------*/
993static int __origin_write(struct list_head *snapshots, struct bio *bio) 993static int __origin_write(struct list_head *snapshots, struct bio *bio)
994{ 994{
995 int r = 1, first = 0; 995 int r = DM_MAPIO_REMAPPED, first = 0;
996 struct dm_snapshot *snap; 996 struct dm_snapshot *snap;
997 struct exception *e; 997 struct exception *e;
998 struct pending_exception *pe, *next_pe, *primary_pe = NULL; 998 struct pending_exception *pe, *next_pe, *primary_pe = NULL;
@@ -1050,7 +1050,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
1050 1050
1051 bio_list_add(&primary_pe->origin_bios, bio); 1051 bio_list_add(&primary_pe->origin_bios, bio);
1052 1052
1053 r = 0; 1053 r = DM_MAPIO_SUBMITTED;
1054 } 1054 }
1055 1055
1056 if (!pe->primary_pe) { 1056 if (!pe->primary_pe) {
@@ -1099,7 +1099,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
1099static int do_origin(struct dm_dev *origin, struct bio *bio) 1099static int do_origin(struct dm_dev *origin, struct bio *bio)
1100{ 1100{
1101 struct origin *o; 1101 struct origin *o;
1102 int r = 1; 1102 int r = DM_MAPIO_REMAPPED;
1103 1103
1104 down_read(&_origins_lock); 1104 down_read(&_origins_lock);
1105 o = __lookup_origin(origin->bdev); 1105 o = __lookup_origin(origin->bdev);
@@ -1156,7 +1156,7 @@ static int origin_map(struct dm_target *ti, struct bio *bio,
1156 return -EOPNOTSUPP; 1156 return -EOPNOTSUPP;
1157 1157
1158 /* Only tell snapshots if this is a write */ 1158 /* Only tell snapshots if this is a write */
1159 return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : 1; 1159 return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : DM_MAPIO_REMAPPED;
1160} 1160}
1161 1161
1162#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r)) 1162#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))