You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
dm mpath: remove extra nesting in map function
Return early for case when no path exists, and when the pathgroup isn't ready. This eliminates the need for extra nesting for the the common case. Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Hannes Reinecke <hare@suse.de>
This commit is contained in:
@@ -398,8 +398,15 @@ static int multipath_map(struct dm_target *ti, struct request *clone,
|
||||
|
||||
pgpath = m->current_pgpath;
|
||||
|
||||
if (pgpath) {
|
||||
if (pg_ready(m)) {
|
||||
if (!pgpath) {
|
||||
if (!__must_push_back(m))
|
||||
r = -EIO; /* Failed */
|
||||
goto out_unlock;
|
||||
}
|
||||
if (!pg_ready(m)) {
|
||||
__pg_init_all_paths(m);
|
||||
goto out_unlock;
|
||||
}
|
||||
if (set_mapinfo(m, map_context) < 0)
|
||||
/* ENOMEM, requeue */
|
||||
goto out_unlock;
|
||||
@@ -416,11 +423,6 @@ static int multipath_map(struct dm_target *ti, struct request *clone,
|
||||
&pgpath->path,
|
||||
nr_bytes);
|
||||
r = DM_MAPIO_REMAPPED;
|
||||
goto out_unlock;
|
||||
}
|
||||
__pg_init_all_paths(m);
|
||||
} else if (!__must_push_back(m))
|
||||
r = -EIO; /* Failed */
|
||||
|
||||
out_unlock:
|
||||
spin_unlock_irqrestore(&m->lock, flags);
|
||||
|
||||
Reference in New Issue
Block a user