dm-mpath.c (7e48c768f44056a06bca596577c37f7721b53f0c) dm-mpath.c (b88efd43f900d608560211a18a38d450f8192948)
1/*
2 * Copyright (C) 2003 Sistina Software Limited.
3 * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include <linux/device-mapper.h>

--- 536 unchanged lines hidden (view full) ---

545 struct dm_mpath_io *mpio;
546
547 /* Do we need to select a new pgpath? */
548 pgpath = lockless_dereference(m->current_pgpath);
549 if (!pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags))
550 pgpath = choose_pgpath(m, nr_bytes);
551
552 if (!pgpath) {
1/*
2 * Copyright (C) 2003 Sistina Software Limited.
3 * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
4 *
5 * This file is released under the GPL.
6 */
7
8#include <linux/device-mapper.h>

--- 536 unchanged lines hidden (view full) ---

545 struct dm_mpath_io *mpio;
546
547 /* Do we need to select a new pgpath? */
548 pgpath = lockless_dereference(m->current_pgpath);
549 if (!pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags))
550 pgpath = choose_pgpath(m, nr_bytes);
551
552 if (!pgpath) {
553 if (!must_push_back_rq(m))
554 r = -EIO; /* Failed */
555 return r;
553 if (must_push_back_rq(m))
554 return DM_MAPIO_DELAY_REQUEUE;
555 return -EIO; /* Failed */
556 } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) ||
557 test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) {
558 pg_init_all_paths(m);
559 return r;
560 }
561
562 mpio = set_mpio(m, map_context);
563 if (!mpio)

--- 1423 unchanged lines hidden (view full) ---

1987 */
1988static int multipath_busy(struct dm_target *ti)
1989{
1990 bool busy = false, has_active = false;
1991 struct multipath *m = ti->private;
1992 struct priority_group *pg, *next_pg;
1993 struct pgpath *pgpath;
1994
556 } else if (test_bit(MPATHF_QUEUE_IO, &m->flags) ||
557 test_bit(MPATHF_PG_INIT_REQUIRED, &m->flags)) {
558 pg_init_all_paths(m);
559 return r;
560 }
561
562 mpio = set_mpio(m, map_context);
563 if (!mpio)

--- 1423 unchanged lines hidden (view full) ---

1987 */
1988static int multipath_busy(struct dm_target *ti)
1989{
1990 bool busy = false, has_active = false;
1991 struct multipath *m = ti->private;
1992 struct priority_group *pg, *next_pg;
1993 struct pgpath *pgpath;
1994
1995 /* pg_init in progress or no paths available */
1996 if (atomic_read(&m->pg_init_in_progress) ||
1997 (!atomic_read(&m->nr_valid_paths) && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags)))
1995 /* pg_init in progress */
1996 if (atomic_read(&m->pg_init_in_progress))
1998 return true;
1999
1997 return true;
1998
1999 /* no paths available, for blk-mq: rely on IO mapping to delay requeue */
2000 if (!atomic_read(&m->nr_valid_paths) && test_bit(MPATHF_QUEUE_IF_NO_PATH, &m->flags))
2001 return (m->queue_mode != DM_TYPE_MQ_REQUEST_BASED);
2002
2000 /* Guess which priority_group will be used at next mapping time */
2001 pg = lockless_dereference(m->current_pg);
2002 next_pg = lockless_dereference(m->next_pg);
2003 if (unlikely(!lockless_dereference(m->current_pgpath) && next_pg))
2004 pg = next_pg;
2005
2006 if (!pg) {
2007 /*

--- 126 unchanged lines hidden ---
2003 /* Guess which priority_group will be used at next mapping time */
2004 pg = lockless_dereference(m->current_pg);
2005 next_pg = lockless_dereference(m->next_pg);
2006 if (unlikely(!lockless_dereference(m->current_pgpath) && next_pg))
2007 pg = next_pg;
2008
2009 if (!pg) {
2010 /*

--- 126 unchanged lines hidden ---