@@ -682,7 +682,7 @@ static void bitmap_update_sb(void *data)
682
682
return ;
683
683
if (!bitmap -> storage .sb_page ) /* no superblock */
684
684
return ;
685
- sb = kmap_atomic (bitmap -> storage .sb_page );
685
+ sb = kmap_local_page (bitmap -> storage .sb_page );
686
686
sb -> events = cpu_to_le64 (bitmap -> mddev -> events );
687
687
if (bitmap -> mddev -> events < bitmap -> events_cleared )
688
688
/* rocking back to read-only */
@@ -702,7 +702,7 @@ static void bitmap_update_sb(void *data)
702
702
sb -> nodes = cpu_to_le32 (bitmap -> mddev -> bitmap_info .nodes );
703
703
sb -> sectors_reserved = cpu_to_le32 (bitmap -> mddev ->
704
704
bitmap_info .space );
705
- kunmap_atomic (sb );
705
+ kunmap_local (sb );
706
706
707
707
if (bitmap -> storage .file )
708
708
write_file_page (bitmap , bitmap -> storage .sb_page , 1 );
@@ -717,7 +717,7 @@ static void bitmap_print_sb(struct bitmap *bitmap)
717
717
718
718
if (!bitmap || !bitmap -> storage .sb_page )
719
719
return ;
720
- sb = kmap_atomic (bitmap -> storage .sb_page );
720
+ sb = kmap_local_page (bitmap -> storage .sb_page );
721
721
pr_debug ("%s: bitmap file superblock:\n" , bmname (bitmap ));
722
722
pr_debug (" magic: %08x\n" , le32_to_cpu (sb -> magic ));
723
723
pr_debug (" version: %u\n" , le32_to_cpu (sb -> version ));
@@ -736,7 +736,7 @@ static void bitmap_print_sb(struct bitmap *bitmap)
736
736
pr_debug (" sync size: %llu KB\n" ,
737
737
(unsigned long long )le64_to_cpu (sb -> sync_size )/2 );
738
738
pr_debug ("max write behind: %u\n" , le32_to_cpu (sb -> write_behind ));
739
- kunmap_atomic (sb );
739
+ kunmap_local (sb );
740
740
}
741
741
742
742
/*
@@ -760,15 +760,15 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
760
760
return - ENOMEM ;
761
761
bitmap -> storage .sb_index = 0 ;
762
762
763
- sb = kmap_atomic (bitmap -> storage .sb_page );
763
+ sb = kmap_local_page (bitmap -> storage .sb_page );
764
764
765
765
sb -> magic = cpu_to_le32 (BITMAP_MAGIC );
766
766
sb -> version = cpu_to_le32 (BITMAP_MAJOR_HI );
767
767
768
768
chunksize = bitmap -> mddev -> bitmap_info .chunksize ;
769
769
BUG_ON (!chunksize );
770
770
if (!is_power_of_2 (chunksize )) {
771
- kunmap_atomic (sb );
771
+ kunmap_local (sb );
772
772
pr_warn ("bitmap chunksize not a power of 2\n" );
773
773
return - EINVAL ;
774
774
}
@@ -803,7 +803,7 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
803
803
sb -> events_cleared = cpu_to_le64 (bitmap -> mddev -> events );
804
804
bitmap -> mddev -> bitmap_info .nodes = 0 ;
805
805
806
- kunmap_atomic (sb );
806
+ kunmap_local (sb );
807
807
808
808
return 0 ;
809
809
}
@@ -865,7 +865,7 @@ static int md_bitmap_read_sb(struct bitmap *bitmap)
865
865
return err ;
866
866
867
867
err = - EINVAL ;
868
- sb = kmap_atomic (sb_page );
868
+ sb = kmap_local_page (sb_page );
869
869
870
870
chunksize = le32_to_cpu (sb -> chunksize );
871
871
daemon_sleep = le32_to_cpu (sb -> daemon_sleep ) * HZ ;
@@ -932,7 +932,7 @@ static int md_bitmap_read_sb(struct bitmap *bitmap)
932
932
err = 0 ;
933
933
934
934
out :
935
- kunmap_atomic (sb );
935
+ kunmap_local (sb );
936
936
if (err == 0 && nodes && (bitmap -> cluster_slot < 0 )) {
937
937
/* Assigning chunksize is required for "re_read" */
938
938
bitmap -> mddev -> bitmap_info .chunksize = chunksize ;
@@ -1161,12 +1161,12 @@ static void md_bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
1161
1161
bit = file_page_offset (& bitmap -> storage , chunk );
1162
1162
1163
1163
/* set the bit */
1164
- kaddr = kmap_atomic (page );
1164
+ kaddr = kmap_local_page (page );
1165
1165
if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
1166
1166
set_bit (bit , kaddr );
1167
1167
else
1168
1168
set_bit_le (bit , kaddr );
1169
- kunmap_atomic (kaddr );
1169
+ kunmap_local (kaddr );
1170
1170
pr_debug ("set file bit %lu page %lu\n" , bit , index );
1171
1171
/* record page number so it gets flushed to disk when unplug occurs */
1172
1172
set_page_attr (bitmap , index - node_offset , BITMAP_PAGE_DIRTY );
@@ -1190,12 +1190,12 @@ static void md_bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
1190
1190
if (!page )
1191
1191
return ;
1192
1192
bit = file_page_offset (& bitmap -> storage , chunk );
1193
- paddr = kmap_atomic (page );
1193
+ paddr = kmap_local_page (page );
1194
1194
if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
1195
1195
clear_bit (bit , paddr );
1196
1196
else
1197
1197
clear_bit_le (bit , paddr );
1198
- kunmap_atomic (paddr );
1198
+ kunmap_local (paddr );
1199
1199
if (!test_page_attr (bitmap , index - node_offset , BITMAP_PAGE_NEEDWRITE )) {
1200
1200
set_page_attr (bitmap , index - node_offset , BITMAP_PAGE_PENDING );
1201
1201
bitmap -> allclean = 0 ;
@@ -1214,12 +1214,12 @@ static int md_bitmap_file_test_bit(struct bitmap *bitmap, sector_t block)
1214
1214
if (!page )
1215
1215
return - EINVAL ;
1216
1216
bit = file_page_offset (& bitmap -> storage , chunk );
1217
- paddr = kmap_atomic (page );
1217
+ paddr = kmap_local_page (page );
1218
1218
if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
1219
1219
set = test_bit (bit , paddr );
1220
1220
else
1221
1221
set = test_bit_le (bit , paddr );
1222
- kunmap_atomic (paddr );
1222
+ kunmap_local (paddr );
1223
1223
return set ;
1224
1224
}
1225
1225
@@ -1388,9 +1388,9 @@ static int md_bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
1388
1388
* If the bitmap is out of date, dirty the whole page
1389
1389
* and write it out
1390
1390
*/
1391
- paddr = kmap_atomic (page );
1391
+ paddr = kmap_local_page (page );
1392
1392
memset (paddr + offset , 0xff , PAGE_SIZE - offset );
1393
- kunmap_atomic (paddr );
1393
+ kunmap_local (paddr );
1394
1394
1395
1395
filemap_write_page (bitmap , i , true);
1396
1396
if (test_bit (BITMAP_WRITE_ERROR , & bitmap -> flags )) {
@@ -1406,12 +1406,12 @@ static int md_bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
1406
1406
void * paddr ;
1407
1407
bool was_set ;
1408
1408
1409
- paddr = kmap_atomic (page );
1409
+ paddr = kmap_local_page (page );
1410
1410
if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
1411
1411
was_set = test_bit (bit , paddr );
1412
1412
else
1413
1413
was_set = test_bit_le (bit , paddr );
1414
- kunmap_atomic (paddr );
1414
+ kunmap_local (paddr );
1415
1415
1416
1416
if (was_set ) {
1417
1417
/* if the disk bit is set, set the memory bit */
@@ -1546,10 +1546,10 @@ static void bitmap_daemon_work(struct mddev *mddev)
1546
1546
bitmap_super_t * sb ;
1547
1547
bitmap -> need_sync = 0 ;
1548
1548
if (bitmap -> storage .filemap ) {
1549
- sb = kmap_atomic (bitmap -> storage .sb_page );
1549
+ sb = kmap_local_page (bitmap -> storage .sb_page );
1550
1550
sb -> events_cleared =
1551
1551
cpu_to_le64 (bitmap -> events_cleared );
1552
- kunmap_atomic (sb );
1552
+ kunmap_local (sb );
1553
1553
set_page_attr (bitmap , 0 ,
1554
1554
BITMAP_PAGE_NEEDWRITE );
1555
1555
}
0 commit comments