@@ -617,20 +617,19 @@ static void multipath_queue_bio(struct multipath *m, struct bio *bio)
617
617
static struct pgpath * __map_bio (struct multipath * m , struct bio * bio )
618
618
{
619
619
struct pgpath * pgpath ;
620
- unsigned long flags ;
621
620
622
621
/* Do we need to select a new pgpath? */
623
622
pgpath = READ_ONCE (m -> current_pgpath );
624
623
if (!pgpath || !mpath_double_check_test_bit (MPATHF_QUEUE_IO , m ))
625
624
pgpath = choose_pgpath (m , bio -> bi_iter .bi_size );
626
625
627
626
if (!pgpath ) {
628
- spin_lock_irqsave (& m -> lock , flags );
627
+ spin_lock_irq (& m -> lock );
629
628
if (test_bit (MPATHF_QUEUE_IF_NO_PATH , & m -> flags )) {
630
629
__multipath_queue_bio (m , bio );
631
630
pgpath = ERR_PTR (- EAGAIN );
632
631
}
633
- spin_unlock_irqrestore (& m -> lock , flags );
632
+ spin_unlock_irq (& m -> lock );
634
633
635
634
} else if (mpath_double_check_test_bit (MPATHF_QUEUE_IO , m ) ||
636
635
mpath_double_check_test_bit (MPATHF_PG_INIT_REQUIRED , m )) {
@@ -693,7 +692,6 @@ static void process_queued_io_list(struct multipath *m)
693
692
static void process_queued_bios (struct work_struct * work )
694
693
{
695
694
int r ;
696
- unsigned long flags ;
697
695
struct bio * bio ;
698
696
struct bio_list bios ;
699
697
struct blk_plug plug ;
@@ -702,16 +700,16 @@ static void process_queued_bios(struct work_struct *work)
702
700
703
701
bio_list_init (& bios );
704
702
705
- spin_lock_irqsave (& m -> lock , flags );
703
+ spin_lock_irq (& m -> lock );
706
704
707
705
if (bio_list_empty (& m -> queued_bios )) {
708
- spin_unlock_irqrestore (& m -> lock , flags );
706
+ spin_unlock_irq (& m -> lock );
709
707
return ;
710
708
}
711
709
712
710
bio_list_merge_init (& bios , & m -> queued_bios );
713
711
714
- spin_unlock_irqrestore (& m -> lock , flags );
712
+ spin_unlock_irq (& m -> lock );
715
713
716
714
blk_start_plug (& plug );
717
715
while ((bio = bio_list_pop (& bios ))) {
@@ -1195,7 +1193,6 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1195
1193
struct dm_arg_set as ;
1196
1194
unsigned int pg_count = 0 ;
1197
1195
unsigned int next_pg_num ;
1198
- unsigned long flags ;
1199
1196
1200
1197
as .argc = argc ;
1201
1198
as .argv = argv ;
@@ -1260,9 +1257,9 @@ static int multipath_ctr(struct dm_target *ti, unsigned int argc, char **argv)
1260
1257
goto bad ;
1261
1258
}
1262
1259
1263
- spin_lock_irqsave (& m -> lock , flags );
1260
+ spin_lock_irq (& m -> lock );
1264
1261
enable_nopath_timeout (m );
1265
- spin_unlock_irqrestore (& m -> lock , flags );
1262
+ spin_unlock_irq (& m -> lock );
1266
1263
1267
1264
ti -> num_flush_bios = 1 ;
1268
1265
ti -> num_discard_bios = 1 ;
@@ -1297,23 +1294,21 @@ static void multipath_wait_for_pg_init_completion(struct multipath *m)
1297
1294
static void flush_multipath_work (struct multipath * m )
1298
1295
{
1299
1296
if (m -> hw_handler_name ) {
1300
- unsigned long flags ;
1301
-
1302
1297
if (!atomic_read (& m -> pg_init_in_progress ))
1303
1298
goto skip ;
1304
1299
1305
- spin_lock_irqsave (& m -> lock , flags );
1300
+ spin_lock_irq (& m -> lock );
1306
1301
if (atomic_read (& m -> pg_init_in_progress ) &&
1307
1302
!test_and_set_bit (MPATHF_PG_INIT_DISABLED , & m -> flags )) {
1308
- spin_unlock_irqrestore (& m -> lock , flags );
1303
+ spin_unlock_irq (& m -> lock );
1309
1304
1310
1305
flush_workqueue (kmpath_handlerd );
1311
1306
multipath_wait_for_pg_init_completion (m );
1312
1307
1313
- spin_lock_irqsave (& m -> lock , flags );
1308
+ spin_lock_irq (& m -> lock );
1314
1309
clear_bit (MPATHF_PG_INIT_DISABLED , & m -> flags );
1315
1310
}
1316
- spin_unlock_irqrestore (& m -> lock , flags );
1311
+ spin_unlock_irq (& m -> lock );
1317
1312
}
1318
1313
skip :
1319
1314
if (m -> queue_mode == DM_TYPE_BIO_BASED )
@@ -1375,11 +1370,10 @@ static int fail_path(struct pgpath *pgpath)
1375
1370
static int reinstate_path (struct pgpath * pgpath )
1376
1371
{
1377
1372
int r = 0 , run_queue = 0 ;
1378
- unsigned long flags ;
1379
1373
struct multipath * m = pgpath -> pg -> m ;
1380
1374
unsigned int nr_valid_paths ;
1381
1375
1382
- spin_lock_irqsave (& m -> lock , flags );
1376
+ spin_lock_irq (& m -> lock );
1383
1377
1384
1378
if (pgpath -> is_active )
1385
1379
goto out ;
@@ -1409,7 +1403,7 @@ static int reinstate_path(struct pgpath *pgpath)
1409
1403
schedule_work (& m -> trigger_event );
1410
1404
1411
1405
out :
1412
- spin_unlock_irqrestore (& m -> lock , flags );
1406
+ spin_unlock_irq (& m -> lock );
1413
1407
if (run_queue ) {
1414
1408
dm_table_run_md_queue_async (m -> ti -> table );
1415
1409
process_queued_io_list (m );
@@ -1470,7 +1464,6 @@ static int switch_pg_num(struct multipath *m, const char *pgstr)
1470
1464
{
1471
1465
struct priority_group * pg ;
1472
1466
unsigned int pgnum ;
1473
- unsigned long flags ;
1474
1467
char dummy ;
1475
1468
1476
1469
if (!pgstr || (sscanf (pgstr , "%u%c" , & pgnum , & dummy ) != 1 ) || !pgnum ||
@@ -1479,7 +1472,7 @@ static int switch_pg_num(struct multipath *m, const char *pgstr)
1479
1472
return - EINVAL ;
1480
1473
}
1481
1474
1482
- spin_lock_irqsave (& m -> lock , flags );
1475
+ spin_lock_irq (& m -> lock );
1483
1476
list_for_each_entry (pg , & m -> priority_groups , list ) {
1484
1477
pg -> bypassed = false;
1485
1478
if (-- pgnum )
@@ -1493,7 +1486,7 @@ static int switch_pg_num(struct multipath *m, const char *pgstr)
1493
1486
}
1494
1487
m -> next_pg = pg ;
1495
1488
}
1496
- spin_unlock_irqrestore (& m -> lock , flags );
1489
+ spin_unlock_irq (& m -> lock );
1497
1490
1498
1491
schedule_work (& m -> trigger_event );
1499
1492
return 0 ;
@@ -1754,11 +1747,10 @@ static int multipath_end_io_bio(struct dm_target *ti, struct bio *clone,
1754
1747
static void multipath_presuspend (struct dm_target * ti )
1755
1748
{
1756
1749
struct multipath * m = ti -> private ;
1757
- unsigned long flags ;
1758
1750
1759
- spin_lock_irqsave (& m -> lock , flags );
1751
+ spin_lock_irq (& m -> lock );
1760
1752
m -> is_suspending = true;
1761
- spin_unlock_irqrestore (& m -> lock , flags );
1753
+ spin_unlock_irq (& m -> lock );
1762
1754
/* FIXME: bio-based shouldn't need to always disable queue_if_no_path */
1763
1755
if (m -> queue_mode == DM_TYPE_BIO_BASED || !dm_noflush_suspending (m -> ti ))
1764
1756
queue_if_no_path (m , false, true, __func__ );
@@ -1779,9 +1771,8 @@ static void multipath_postsuspend(struct dm_target *ti)
1779
1771
static void multipath_resume (struct dm_target * ti )
1780
1772
{
1781
1773
struct multipath * m = ti -> private ;
1782
- unsigned long flags ;
1783
1774
1784
- spin_lock_irqsave (& m -> lock , flags );
1775
+ spin_lock_irq (& m -> lock );
1785
1776
m -> is_suspending = false;
1786
1777
if (test_bit (MPATHF_SAVED_QUEUE_IF_NO_PATH , & m -> flags )) {
1787
1778
set_bit (MPATHF_QUEUE_IF_NO_PATH , & m -> flags );
@@ -1793,7 +1784,7 @@ static void multipath_resume(struct dm_target *ti)
1793
1784
test_bit (MPATHF_QUEUE_IF_NO_PATH , & m -> flags ),
1794
1785
test_bit (MPATHF_SAVED_QUEUE_IF_NO_PATH , & m -> flags ));
1795
1786
1796
- spin_unlock_irqrestore (& m -> lock , flags );
1787
+ spin_unlock_irq (& m -> lock );
1797
1788
}
1798
1789
1799
1790
/*
@@ -1816,14 +1807,13 @@ static void multipath_status(struct dm_target *ti, status_type_t type,
1816
1807
unsigned int status_flags , char * result , unsigned int maxlen )
1817
1808
{
1818
1809
int sz = 0 , pg_counter , pgpath_counter ;
1819
- unsigned long flags ;
1820
1810
struct multipath * m = ti -> private ;
1821
1811
struct priority_group * pg ;
1822
1812
struct pgpath * p ;
1823
1813
unsigned int pg_num ;
1824
1814
char state ;
1825
1815
1826
- spin_lock_irqsave (& m -> lock , flags );
1816
+ spin_lock_irq (& m -> lock );
1827
1817
1828
1818
/* Features */
1829
1819
if (type == STATUSTYPE_INFO )
@@ -1969,7 +1959,7 @@ static void multipath_status(struct dm_target *ti, status_type_t type,
1969
1959
break ;
1970
1960
}
1971
1961
1972
- spin_unlock_irqrestore (& m -> lock , flags );
1962
+ spin_unlock_irq (& m -> lock );
1973
1963
}
1974
1964
1975
1965
static int multipath_message (struct dm_target * ti , unsigned int argc , char * * argv ,
@@ -1979,7 +1969,6 @@ static int multipath_message(struct dm_target *ti, unsigned int argc, char **arg
1979
1969
dev_t dev ;
1980
1970
struct multipath * m = ti -> private ;
1981
1971
action_fn action ;
1982
- unsigned long flags ;
1983
1972
1984
1973
mutex_lock (& m -> work_mutex );
1985
1974
@@ -1991,9 +1980,9 @@ static int multipath_message(struct dm_target *ti, unsigned int argc, char **arg
1991
1980
if (argc == 1 ) {
1992
1981
if (!strcasecmp (argv [0 ], "queue_if_no_path" )) {
1993
1982
r = queue_if_no_path (m , true, false, __func__ );
1994
- spin_lock_irqsave (& m -> lock , flags );
1983
+ spin_lock_irq (& m -> lock );
1995
1984
enable_nopath_timeout (m );
1996
- spin_unlock_irqrestore (& m -> lock , flags );
1985
+ spin_unlock_irq (& m -> lock );
1997
1986
goto out ;
1998
1987
} else if (!strcasecmp (argv [0 ], "fail_if_no_path" )) {
1999
1988
r = queue_if_no_path (m , false, false, __func__ );
@@ -2096,10 +2085,9 @@ static int probe_active_paths(struct multipath *m)
2096
2085
{
2097
2086
struct pgpath * pgpath ;
2098
2087
struct priority_group * pg = NULL ;
2099
- unsigned long flags ;
2100
2088
int r = 0 ;
2101
2089
2102
- spin_lock_irqsave (& m -> lock , flags );
2090
+ spin_lock_irq (& m -> lock );
2103
2091
if (test_bit (MPATHF_DELAY_PG_SWITCH , & m -> flags )) {
2104
2092
wait_event_lock_irq (m -> probe_wait ,
2105
2093
!test_bit (MPATHF_DELAY_PG_SWITCH , & m -> flags ),
@@ -2117,7 +2105,7 @@ static int probe_active_paths(struct multipath *m)
2117
2105
goto skip_probe ;
2118
2106
set_bit (MPATHF_DELAY_PG_SWITCH , & m -> flags );
2119
2107
pg = m -> last_probed_pg = m -> current_pg ;
2120
- spin_unlock_irqrestore (& m -> lock , flags );
2108
+ spin_unlock_irq (& m -> lock );
2121
2109
2122
2110
list_for_each_entry (pgpath , & pg -> pgpaths , list ) {
2123
2111
if (pg != READ_ONCE (m -> current_pg ) ||
@@ -2132,7 +2120,7 @@ static int probe_active_paths(struct multipath *m)
2132
2120
}
2133
2121
2134
2122
out :
2135
- spin_lock_irqsave (& m -> lock , flags );
2123
+ spin_lock_irq (& m -> lock );
2136
2124
clear_bit (MPATHF_DELAY_PG_SWITCH , & m -> flags );
2137
2125
if (test_and_clear_bit (MPATHF_NEED_PG_SWITCH , & m -> flags )) {
2138
2126
m -> current_pgpath = NULL ;
@@ -2141,7 +2129,7 @@ static int probe_active_paths(struct multipath *m)
2141
2129
skip_probe :
2142
2130
if (r == 0 && !atomic_read (& m -> nr_valid_paths ))
2143
2131
r = - ENOTCONN ;
2144
- spin_unlock_irqrestore (& m -> lock , flags );
2132
+ spin_unlock_irq (& m -> lock );
2145
2133
if (pg )
2146
2134
wake_up (& m -> probe_wait );
2147
2135
return r ;
@@ -2154,7 +2142,6 @@ static int multipath_prepare_ioctl(struct dm_target *ti,
2154
2142
{
2155
2143
struct multipath * m = ti -> private ;
2156
2144
struct pgpath * pgpath ;
2157
- unsigned long flags ;
2158
2145
int r ;
2159
2146
2160
2147
if (_IOC_TYPE (cmd ) == DM_IOCTL ) {
@@ -2182,21 +2169,21 @@ static int multipath_prepare_ioctl(struct dm_target *ti,
2182
2169
} else {
2183
2170
/* No path is available */
2184
2171
r = - EIO ;
2185
- spin_lock_irqsave (& m -> lock , flags );
2172
+ spin_lock_irq (& m -> lock );
2186
2173
if (test_bit (MPATHF_QUEUE_IF_NO_PATH , & m -> flags ))
2187
2174
r = - ENOTCONN ;
2188
- spin_unlock_irqrestore (& m -> lock , flags );
2175
+ spin_unlock_irq (& m -> lock );
2189
2176
}
2190
2177
2191
2178
if (r == - ENOTCONN ) {
2192
2179
if (!READ_ONCE (m -> current_pg )) {
2193
2180
/* Path status changed, redo selection */
2194
2181
(void ) choose_pgpath (m , 0 );
2195
2182
}
2196
- spin_lock_irqsave (& m -> lock , flags );
2183
+ spin_lock_irq (& m -> lock );
2197
2184
if (test_bit (MPATHF_PG_INIT_REQUIRED , & m -> flags ))
2198
2185
(void ) __pg_init_all_paths (m );
2199
- spin_unlock_irqrestore (& m -> lock , flags );
2186
+ spin_unlock_irq (& m -> lock );
2200
2187
dm_table_run_md_queue_async (m -> ti -> table );
2201
2188
process_queued_io_list (m );
2202
2189
}
0 commit comments