]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm mpath: eliminate pg_ready() wrapper
authorMike Snitzer <snitzer@redhat.com>
Tue, 8 Jul 2014 15:55:09 +0000 (11:55 -0400)
committerMike Snitzer <snitzer@redhat.com>
Fri, 1 Aug 2014 16:30:31 +0000 (12:30 -0400)
pg_ready() is not comprehensive in its logic and only serves to
obfuscate code.  Replace pg_ready() with the appropriate logic in
multipath_map().

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c

index f4167b013d990c3fc25f185ee467952824f0ae5d..833d7e752f0633a1586fcefb613e501d777efb30 100644 (file)
@@ -373,8 +373,6 @@ static int __must_push_back(struct multipath *m)
                 dm_noflush_suspending(m->ti)));
 }
 
-#define pg_ready(m) (!(m)->queue_io && !(m)->pg_init_required)
-
 /*
  * Map cloned requests
  */
@@ -402,11 +400,11 @@ static int multipath_map(struct dm_target *ti, struct request *clone,
                if (!__must_push_back(m))
                        r = -EIO;       /* Failed */
                goto out_unlock;
-       }
-       if (!pg_ready(m)) {
+       } else if (m->queue_io || m->pg_init_required) {
                __pg_init_all_paths(m);
                goto out_unlock;
        }
+
        if (set_mapinfo(m, map_context) < 0)
                /* ENOMEM, requeue */
                goto out_unlock;