dm: change ->end_io calling convention
Turn the error paramter into a pointer so that target drivers can change the value, and make sure only DM_ENDIO_* values are returned from the methods. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:

committed by
Jens Axboe

parent
846785e6a5
commit
1be5690984
@@ -375,20 +375,20 @@ static void stripe_status(struct dm_target *ti, status_type_t type,
|
||||
}
|
||||
}
|
||||
|
||||
static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
|
||||
static int stripe_end_io(struct dm_target *ti, struct bio *bio, int *error)
|
||||
{
|
||||
unsigned i;
|
||||
char major_minor[16];
|
||||
struct stripe_c *sc = ti->private;
|
||||
|
||||
if (!error)
|
||||
return 0; /* I/O complete */
|
||||
if (!*error)
|
||||
return DM_ENDIO_DONE; /* I/O complete */
|
||||
|
||||
if (bio->bi_opf & REQ_RAHEAD)
|
||||
return error;
|
||||
return DM_ENDIO_DONE;
|
||||
|
||||
if (error == -EOPNOTSUPP)
|
||||
return error;
|
||||
if (*error == -EOPNOTSUPP)
|
||||
return DM_ENDIO_DONE;
|
||||
|
||||
memset(major_minor, 0, sizeof(major_minor));
|
||||
sprintf(major_minor, "%d:%d",
|
||||
@@ -409,7 +409,7 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio, int error)
|
||||
schedule_work(&sc->trigger_event);
|
||||
}
|
||||
|
||||
return error;
|
||||
return DM_ENDIO_DONE;
|
||||
}
|
||||
|
||||
static int stripe_iterate_devices(struct dm_target *ti,
|
||||
|
Reference in New Issue
Block a user