@@ -682,7 +682,7 @@ static void bitmap_update_sb(void *data)
682682 return ;
683683 if (!bitmap -> storage .sb_page ) /* no superblock */
684684 return ;
685- sb = kmap_atomic (bitmap -> storage .sb_page );
685+ sb = kmap_local_page (bitmap -> storage .sb_page );
686686 sb -> events = cpu_to_le64 (bitmap -> mddev -> events );
687687 if (bitmap -> mddev -> events < bitmap -> events_cleared )
688688 /* rocking back to read-only */
@@ -702,7 +702,7 @@ static void bitmap_update_sb(void *data)
702702 sb -> nodes = cpu_to_le32 (bitmap -> mddev -> bitmap_info .nodes );
703703 sb -> sectors_reserved = cpu_to_le32 (bitmap -> mddev ->
704704 bitmap_info .space );
705- kunmap_atomic (sb );
705+ kunmap_local (sb );
706706
707707 if (bitmap -> storage .file )
708708 write_file_page (bitmap , bitmap -> storage .sb_page , 1 );
@@ -717,7 +717,7 @@ static void bitmap_print_sb(struct bitmap *bitmap)
717717
718718 if (!bitmap || !bitmap -> storage .sb_page )
719719 return ;
720- sb = kmap_atomic (bitmap -> storage .sb_page );
720+ sb = kmap_local_page (bitmap -> storage .sb_page );
721721 pr_debug ("%s: bitmap file superblock:\n" , bmname (bitmap ));
722722 pr_debug (" magic: %08x\n" , le32_to_cpu (sb -> magic ));
723723 pr_debug (" version: %u\n" , le32_to_cpu (sb -> version ));
@@ -736,7 +736,7 @@ static void bitmap_print_sb(struct bitmap *bitmap)
736736 pr_debug (" sync size: %llu KB\n" ,
737737 (unsigned long long )le64_to_cpu (sb -> sync_size )/2 );
738738 pr_debug ("max write behind: %u\n" , le32_to_cpu (sb -> write_behind ));
739- kunmap_atomic (sb );
739+ kunmap_local (sb );
740740}
741741
742742/*
@@ -760,15 +760,15 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
760760 return - ENOMEM ;
761761 bitmap -> storage .sb_index = 0 ;
762762
763- sb = kmap_atomic (bitmap -> storage .sb_page );
763+ sb = kmap_local_page (bitmap -> storage .sb_page );
764764
765765 sb -> magic = cpu_to_le32 (BITMAP_MAGIC );
766766 sb -> version = cpu_to_le32 (BITMAP_MAJOR_HI );
767767
768768 chunksize = bitmap -> mddev -> bitmap_info .chunksize ;
769769 BUG_ON (!chunksize );
770770 if (!is_power_of_2 (chunksize )) {
771- kunmap_atomic (sb );
771+ kunmap_local (sb );
772772 pr_warn ("bitmap chunksize not a power of 2\n" );
773773 return - EINVAL ;
774774 }
@@ -803,7 +803,7 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
803803 sb -> events_cleared = cpu_to_le64 (bitmap -> mddev -> events );
804804 bitmap -> mddev -> bitmap_info .nodes = 0 ;
805805
806- kunmap_atomic (sb );
806+ kunmap_local (sb );
807807
808808 return 0 ;
809809}
@@ -865,7 +865,7 @@ static int md_bitmap_read_sb(struct bitmap *bitmap)
865865 return err ;
866866
867867 err = - EINVAL ;
868- sb = kmap_atomic (sb_page );
868+ sb = kmap_local_page (sb_page );
869869
870870 chunksize = le32_to_cpu (sb -> chunksize );
871871 daemon_sleep = le32_to_cpu (sb -> daemon_sleep ) * HZ ;
@@ -932,7 +932,7 @@ static int md_bitmap_read_sb(struct bitmap *bitmap)
932932 err = 0 ;
933933
934934out :
935- kunmap_atomic (sb );
935+ kunmap_local (sb );
936936 if (err == 0 && nodes && (bitmap -> cluster_slot < 0 )) {
937937 /* Assigning chunksize is required for "re_read" */
938938 bitmap -> mddev -> bitmap_info .chunksize = chunksize ;
@@ -1161,12 +1161,12 @@ static void md_bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
11611161 bit = file_page_offset (& bitmap -> storage , chunk );
11621162
11631163 /* set the bit */
1164- kaddr = kmap_atomic (page );
1164+ kaddr = kmap_local_page (page );
11651165 if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
11661166 set_bit (bit , kaddr );
11671167 else
11681168 set_bit_le (bit , kaddr );
1169- kunmap_atomic (kaddr );
1169+ kunmap_local (kaddr );
11701170 pr_debug ("set file bit %lu page %lu\n" , bit , index );
11711171 /* record page number so it gets flushed to disk when unplug occurs */
11721172 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)
11901190 if (!page )
11911191 return ;
11921192 bit = file_page_offset (& bitmap -> storage , chunk );
1193- paddr = kmap_atomic (page );
1193+ paddr = kmap_local_page (page );
11941194 if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
11951195 clear_bit (bit , paddr );
11961196 else
11971197 clear_bit_le (bit , paddr );
1198- kunmap_atomic (paddr );
1198+ kunmap_local (paddr );
11991199 if (!test_page_attr (bitmap , index - node_offset , BITMAP_PAGE_NEEDWRITE )) {
12001200 set_page_attr (bitmap , index - node_offset , BITMAP_PAGE_PENDING );
12011201 bitmap -> allclean = 0 ;
@@ -1214,12 +1214,12 @@ static int md_bitmap_file_test_bit(struct bitmap *bitmap, sector_t block)
12141214 if (!page )
12151215 return - EINVAL ;
12161216 bit = file_page_offset (& bitmap -> storage , chunk );
1217- paddr = kmap_atomic (page );
1217+ paddr = kmap_local_page (page );
12181218 if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
12191219 set = test_bit (bit , paddr );
12201220 else
12211221 set = test_bit_le (bit , paddr );
1222- kunmap_atomic (paddr );
1222+ kunmap_local (paddr );
12231223 return set ;
12241224}
12251225
@@ -1388,9 +1388,9 @@ static int md_bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
13881388 * If the bitmap is out of date, dirty the whole page
13891389 * and write it out
13901390 */
1391- paddr = kmap_atomic (page );
1391+ paddr = kmap_local_page (page );
13921392 memset (paddr + offset , 0xff , PAGE_SIZE - offset );
1393- kunmap_atomic (paddr );
1393+ kunmap_local (paddr );
13941394
13951395 filemap_write_page (bitmap , i , true);
13961396 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)
14061406 void * paddr ;
14071407 bool was_set ;
14081408
1409- paddr = kmap_atomic (page );
1409+ paddr = kmap_local_page (page );
14101410 if (test_bit (BITMAP_HOSTENDIAN , & bitmap -> flags ))
14111411 was_set = test_bit (bit , paddr );
14121412 else
14131413 was_set = test_bit_le (bit , paddr );
1414- kunmap_atomic (paddr );
1414+ kunmap_local (paddr );
14151415
14161416 if (was_set ) {
14171417 /* if the disk bit is set, set the memory bit */
@@ -1546,10 +1546,10 @@ static void bitmap_daemon_work(struct mddev *mddev)
15461546 bitmap_super_t * sb ;
15471547 bitmap -> need_sync = 0 ;
15481548 if (bitmap -> storage .filemap ) {
1549- sb = kmap_atomic (bitmap -> storage .sb_page );
1549+ sb = kmap_local_page (bitmap -> storage .sb_page );
15501550 sb -> events_cleared =
15511551 cpu_to_le64 (bitmap -> events_cleared );
1552- kunmap_atomic (sb );
1552+ kunmap_local (sb );
15531553 set_page_attr (bitmap , 0 ,
15541554 BITMAP_PAGE_NEEDWRITE );
15551555 }
0 commit comments