On Tue, Nov 15 2016 at 6:34pm -0500, Bart Van Assche <bart.vanass...@sandisk.com> wrote:
> Move common code out of if (clone) { ... } else { ... }. > > Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> > --- > drivers/md/dm-mpath.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c > index 5c73818..7559537 100644 > --- a/drivers/md/dm-mpath.c > +++ b/drivers/md/dm-mpath.c > @@ -574,8 +574,6 @@ static int __multipath_map(struct dm_target *ti, struct > request *clone, > * Used by: .request_fn stacked on .request_fn path(s). > */ > clone->q = bdev_get_queue(bdev); > - clone->rq_disk = bdev->bd_disk; > - clone->cmd_flags |= REQ_FAILFAST_TRANSPORT; > } else { > /* > * blk-mq request-based interface; used by both: > @@ -591,9 +589,9 @@ static int __multipath_map(struct dm_target *ti, struct > request *clone, > } > *__clone = clone; > clone->bio = clone->biotail = NULL; > - clone->rq_disk = bdev->bd_disk; > - clone->cmd_flags |= REQ_FAILFAST_TRANSPORT; > } > + clone->rq_disk = bdev->bd_disk; > + clone->cmd_flags |= REQ_FAILFAST_TRANSPORT; > > if (pgpath->pg->ps.type->start_io) > pgpath->pg->ps.type->start_io(&pgpath->pg->ps, > -- > 2.10.1 I conciously left this duplication to avoid sprawling setup of the clone request. This isn't a lot of duplication here... -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel