]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.30/dm-mpath-split-and-rename-activate_path-to-prepare-for-its-expanded-use.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.30 / dm-mpath-split-and-rename-activate_path-to-prepare-for-its-expanded-use.patch
CommitLineData
208fc782
GKH
1From 89bfce763e43fa4897e0d3af6b29ed909df64cfd Mon Sep 17 00:00:00 2001
2From: Bart Van Assche <bart.vanassche@sandisk.com>
3Date: Thu, 27 Apr 2017 10:11:14 -0700
4Subject: dm mpath: split and rename activate_path() to prepare for its expanded use
5
6From: Bart Van Assche <bart.vanassche@sandisk.com>
7
8commit 89bfce763e43fa4897e0d3af6b29ed909df64cfd upstream.
9
10activate_path() is renamed to activate_path_work() which now calls
11activate_or_offline_path(). activate_or_offline_path() will be used
12by the next commit.
13
14Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
15Cc: Hannes Reinecke <hare@suse.com>
16Cc: Christoph Hellwig <hch@lst.de>
17Signed-off-by: Mike Snitzer <snitzer@redhat.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19
20---
21 drivers/md/dm-mpath.c | 17 ++++++++++++-----
22 1 file changed, 12 insertions(+), 5 deletions(-)
23
24--- a/drivers/md/dm-mpath.c
25+++ b/drivers/md/dm-mpath.c
26@@ -119,7 +119,8 @@ static struct kmem_cache *_mpio_cache;
27
28 static struct workqueue_struct *kmultipathd, *kmpath_handlerd;
29 static void trigger_event(struct work_struct *work);
30-static void activate_path(struct work_struct *work);
31+static void activate_or_offline_path(struct pgpath *pgpath);
32+static void activate_path_work(struct work_struct *work);
33 static void process_queued_bios(struct work_struct *work);
34
35 /*-----------------------------------------------
36@@ -144,7 +145,7 @@ static struct pgpath *alloc_pgpath(void)
37
38 if (pgpath) {
39 pgpath->is_active = true;
40- INIT_DELAYED_WORK(&pgpath->activate_path, activate_path);
41+ INIT_DELAYED_WORK(&pgpath->activate_path, activate_path_work);
42 }
43
44 return pgpath;
45@@ -1515,10 +1516,8 @@ out:
46 spin_unlock_irqrestore(&m->lock, flags);
47 }
48
49-static void activate_path(struct work_struct *work)
50+static void activate_or_offline_path(struct pgpath *pgpath)
51 {
52- struct pgpath *pgpath =
53- container_of(work, struct pgpath, activate_path.work);
54 struct request_queue *q = bdev_get_queue(pgpath->path.dev->bdev);
55
56 if (pgpath->is_active && !blk_queue_dying(q))
57@@ -1527,6 +1526,14 @@ static void activate_path(struct work_st
58 pg_init_done(pgpath, SCSI_DH_DEV_OFFLINED);
59 }
60
61+static void activate_path_work(struct work_struct *work)
62+{
63+ struct pgpath *pgpath =
64+ container_of(work, struct pgpath, activate_path.work);
65+
66+ activate_or_offline_path(pgpath);
67+}
68+
69 static int noretry_error(int error)
70 {
71 switch (error) {