aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 12:40:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-21 12:40:26 -0400
commit9f3938346a5c1fa504647670edb5fea5756cfb00 (patch)
tree7cf6d24d6b076c8db8571494984924cac03703a2 /drivers/md
parent69a7aebcf019ab3ff5764525ad6858fbe23bb86d (diff)
parent317b6e128247f75976b0fc2b9fd8d2c20ef13b3a (diff)
Merge branch 'kmap_atomic' of git://github.com/congwang/linux
Pull kmap_atomic cleanup from Cong Wang. It's been in -next for a long time, and it gets rid of the (no longer used) second argument to k[un]map_atomic(). Fix up a few trivial conflicts in various drivers, and do an "evil merge" to catch some new uses that have come in since Cong's tree. * 'kmap_atomic' of git://github.com/congwang/linux: (59 commits) feature-removal-schedule.txt: schedule the deprecated form of kmap_atomic() for removal highmem: kill all __kmap_atomic() [swarren@nvidia.com: highmem: Fix ARM build break due to __kmap_atomic rename] drbd: remove the second argument of k[un]map_atomic() zcache: remove the second argument of k[un]map_atomic() gma500: remove the second argument of k[un]map_atomic() dm: remove the second argument of k[un]map_atomic() tomoyo: remove the second argument of k[un]map_atomic() sunrpc: remove the second argument of k[un]map_atomic() rds: remove the second argument of k[un]map_atomic() net: remove the second argument of k[un]map_atomic() mm: remove the second argument of k[un]map_atomic() lib: remove the second argument of k[un]map_atomic() power: remove the second argument of k[un]map_atomic() kdb: remove the second argument of k[un]map_atomic() udf: remove the second argument of k[un]map_atomic() ubifs: remove the second argument of k[un]map_atomic() squashfs: remove the second argument of k[un]map_atomic() reiserfs: remove the second argument of k[un]map_atomic() ocfs2: remove the second argument of k[un]map_atomic() ntfs: remove the second argument of k[un]map_atomic() ...
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bitmap.c42
-rw-r--r--drivers/md/dm-crypt.c8
2 files changed, 25 insertions, 25 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index cdf36b1e9aa6..045e086144ad 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -457,7 +457,7 @@ void bitmap_update_sb(struct bitmap *bitmap)
457 return; 457 return;
458 } 458 }
459 spin_unlock_irqrestore(&bitmap->lock, flags); 459 spin_unlock_irqrestore(&bitmap->lock, flags);
460 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 460 sb = kmap_atomic(bitmap->sb_page);
461 sb->events = cpu_to_le64(bitmap->mddev->events); 461 sb->events = cpu_to_le64(bitmap->mddev->events);
462 if (bitmap->mddev->events < bitmap->events_cleared) 462 if (bitmap->mddev->events < bitmap->events_cleared)
463 /* rocking back to read-only */ 463 /* rocking back to read-only */
@@ -467,7 +467,7 @@ void bitmap_update_sb(struct bitmap *bitmap)
467 /* Just in case these have been changed via sysfs: */ 467 /* Just in case these have been changed via sysfs: */
468 sb->daemon_sleep = cpu_to_le32(bitmap->mddev->bitmap_info.daemon_sleep/HZ); 468 sb->daemon_sleep = cpu_to_le32(bitmap->mddev->bitmap_info.daemon_sleep/HZ);
469 sb->write_behind = cpu_to_le32(bitmap->mddev->bitmap_info.max_write_behind); 469 sb->write_behind = cpu_to_le32(bitmap->mddev->bitmap_info.max_write_behind);
470 kunmap_atomic(sb, KM_USER0); 470 kunmap_atomic(sb);
471 write_page(bitmap, bitmap->sb_page, 1); 471 write_page(bitmap, bitmap->sb_page, 1);
472} 472}
473 473
@@ -478,7 +478,7 @@ void bitmap_print_sb(struct bitmap *bitmap)
478 478
479 if (!bitmap || !bitmap->sb_page) 479 if (!bitmap || !bitmap->sb_page)
480 return; 480 return;
481 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 481 sb = kmap_atomic(bitmap->sb_page);
482 printk(KERN_DEBUG "%s: bitmap file superblock:\n", bmname(bitmap)); 482 printk(KERN_DEBUG "%s: bitmap file superblock:\n", bmname(bitmap));
483 printk(KERN_DEBUG " magic: %08x\n", le32_to_cpu(sb->magic)); 483 printk(KERN_DEBUG " magic: %08x\n", le32_to_cpu(sb->magic));
484 printk(KERN_DEBUG " version: %d\n", le32_to_cpu(sb->version)); 484 printk(KERN_DEBUG " version: %d\n", le32_to_cpu(sb->version));
@@ -497,7 +497,7 @@ void bitmap_print_sb(struct bitmap *bitmap)
497 printk(KERN_DEBUG " sync size: %llu KB\n", 497 printk(KERN_DEBUG " sync size: %llu KB\n",
498 (unsigned long long)le64_to_cpu(sb->sync_size)/2); 498 (unsigned long long)le64_to_cpu(sb->sync_size)/2);
499 printk(KERN_DEBUG "max write behind: %d\n", le32_to_cpu(sb->write_behind)); 499 printk(KERN_DEBUG "max write behind: %d\n", le32_to_cpu(sb->write_behind));
500 kunmap_atomic(sb, KM_USER0); 500 kunmap_atomic(sb);
501} 501}
502 502
503/* 503/*
@@ -525,7 +525,7 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
525 } 525 }
526 bitmap->sb_page->index = 0; 526 bitmap->sb_page->index = 0;
527 527
528 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 528 sb = kmap_atomic(bitmap->sb_page);
529 529
530 sb->magic = cpu_to_le32(BITMAP_MAGIC); 530 sb->magic = cpu_to_le32(BITMAP_MAGIC);
531 sb->version = cpu_to_le32(BITMAP_MAJOR_HI); 531 sb->version = cpu_to_le32(BITMAP_MAJOR_HI);
@@ -533,7 +533,7 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
533 chunksize = bitmap->mddev->bitmap_info.chunksize; 533 chunksize = bitmap->mddev->bitmap_info.chunksize;
534 BUG_ON(!chunksize); 534 BUG_ON(!chunksize);
535 if (!is_power_of_2(chunksize)) { 535 if (!is_power_of_2(chunksize)) {
536 kunmap_atomic(sb, KM_USER0); 536 kunmap_atomic(sb);
537 printk(KERN_ERR "bitmap chunksize not a power of 2\n"); 537 printk(KERN_ERR "bitmap chunksize not a power of 2\n");
538 return -EINVAL; 538 return -EINVAL;
539 } 539 }
@@ -571,7 +571,7 @@ static int bitmap_new_disk_sb(struct bitmap *bitmap)
571 bitmap->flags |= BITMAP_HOSTENDIAN; 571 bitmap->flags |= BITMAP_HOSTENDIAN;
572 sb->version = cpu_to_le32(BITMAP_MAJOR_HOSTENDIAN); 572 sb->version = cpu_to_le32(BITMAP_MAJOR_HOSTENDIAN);
573 573
574 kunmap_atomic(sb, KM_USER0); 574 kunmap_atomic(sb);
575 575
576 return 0; 576 return 0;
577} 577}
@@ -603,7 +603,7 @@ static int bitmap_read_sb(struct bitmap *bitmap)
603 return err; 603 return err;
604 } 604 }
605 605
606 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 606 sb = kmap_atomic(bitmap->sb_page);
607 607
608 chunksize = le32_to_cpu(sb->chunksize); 608 chunksize = le32_to_cpu(sb->chunksize);
609 daemon_sleep = le32_to_cpu(sb->daemon_sleep) * HZ; 609 daemon_sleep = le32_to_cpu(sb->daemon_sleep) * HZ;
@@ -664,7 +664,7 @@ success:
664 bitmap->events_cleared = bitmap->mddev->events; 664 bitmap->events_cleared = bitmap->mddev->events;
665 err = 0; 665 err = 0;
666out: 666out:
667 kunmap_atomic(sb, KM_USER0); 667 kunmap_atomic(sb);
668 if (err) 668 if (err)
669 bitmap_print_sb(bitmap); 669 bitmap_print_sb(bitmap);
670 return err; 670 return err;
@@ -689,7 +689,7 @@ static int bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
689 return 0; 689 return 0;
690 } 690 }
691 spin_unlock_irqrestore(&bitmap->lock, flags); 691 spin_unlock_irqrestore(&bitmap->lock, flags);
692 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 692 sb = kmap_atomic(bitmap->sb_page);
693 old = le32_to_cpu(sb->state) & bits; 693 old = le32_to_cpu(sb->state) & bits;
694 switch (op) { 694 switch (op) {
695 case MASK_SET: 695 case MASK_SET:
@@ -703,7 +703,7 @@ static int bitmap_mask_state(struct bitmap *bitmap, enum bitmap_state bits,
703 default: 703 default:
704 BUG(); 704 BUG();
705 } 705 }
706 kunmap_atomic(sb, KM_USER0); 706 kunmap_atomic(sb);
707 return old; 707 return old;
708} 708}
709 709
@@ -881,12 +881,12 @@ static void bitmap_file_set_bit(struct bitmap *bitmap, sector_t block)
881 bit = file_page_offset(bitmap, chunk); 881 bit = file_page_offset(bitmap, chunk);
882 882
883 /* set the bit */ 883 /* set the bit */
884 kaddr = kmap_atomic(page, KM_USER0); 884 kaddr = kmap_atomic(page);
885 if (bitmap->flags & BITMAP_HOSTENDIAN) 885 if (bitmap->flags & BITMAP_HOSTENDIAN)
886 set_bit(bit, kaddr); 886 set_bit(bit, kaddr);
887 else 887 else
888 __set_bit_le(bit, kaddr); 888 __set_bit_le(bit, kaddr);
889 kunmap_atomic(kaddr, KM_USER0); 889 kunmap_atomic(kaddr);
890 pr_debug("set file bit %lu page %lu\n", bit, page->index); 890 pr_debug("set file bit %lu page %lu\n", bit, page->index);
891 /* record page number so it gets flushed to disk when unplug occurs */ 891 /* record page number so it gets flushed to disk when unplug occurs */
892 set_page_attr(bitmap, page, BITMAP_PAGE_DIRTY); 892 set_page_attr(bitmap, page, BITMAP_PAGE_DIRTY);
@@ -1050,10 +1050,10 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
1050 * if bitmap is out of date, dirty the 1050 * if bitmap is out of date, dirty the
1051 * whole page and write it out 1051 * whole page and write it out
1052 */ 1052 */
1053 paddr = kmap_atomic(page, KM_USER0); 1053 paddr = kmap_atomic(page);
1054 memset(paddr + offset, 0xff, 1054 memset(paddr + offset, 0xff,
1055 PAGE_SIZE - offset); 1055 PAGE_SIZE - offset);
1056 kunmap_atomic(paddr, KM_USER0); 1056 kunmap_atomic(paddr);
1057 write_page(bitmap, page, 1); 1057 write_page(bitmap, page, 1);
1058 1058
1059 ret = -EIO; 1059 ret = -EIO;
@@ -1061,12 +1061,12 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
1061 goto err; 1061 goto err;
1062 } 1062 }
1063 } 1063 }
1064 paddr = kmap_atomic(page, KM_USER0); 1064 paddr = kmap_atomic(page);
1065 if (bitmap->flags & BITMAP_HOSTENDIAN) 1065 if (bitmap->flags & BITMAP_HOSTENDIAN)
1066 b = test_bit(bit, paddr); 1066 b = test_bit(bit, paddr);
1067 else 1067 else
1068 b = test_bit_le(bit, paddr); 1068 b = test_bit_le(bit, paddr);
1069 kunmap_atomic(paddr, KM_USER0); 1069 kunmap_atomic(paddr);
1070 if (b) { 1070 if (b) {
1071 /* if the disk bit is set, set the memory bit */ 1071 /* if the disk bit is set, set the memory bit */
1072 int needed = ((sector_t)(i+1) << (CHUNK_BLOCK_SHIFT(bitmap)) 1072 int needed = ((sector_t)(i+1) << (CHUNK_BLOCK_SHIFT(bitmap))
@@ -1209,10 +1209,10 @@ void bitmap_daemon_work(struct mddev *mddev)
1209 mddev->bitmap_info.external == 0) { 1209 mddev->bitmap_info.external == 0) {
1210 bitmap_super_t *sb; 1210 bitmap_super_t *sb;
1211 bitmap->need_sync = 0; 1211 bitmap->need_sync = 0;
1212 sb = kmap_atomic(bitmap->sb_page, KM_USER0); 1212 sb = kmap_atomic(bitmap->sb_page);
1213 sb->events_cleared = 1213 sb->events_cleared =
1214 cpu_to_le64(bitmap->events_cleared); 1214 cpu_to_le64(bitmap->events_cleared);
1215 kunmap_atomic(sb, KM_USER0); 1215 kunmap_atomic(sb);
1216 write_page(bitmap, bitmap->sb_page, 1); 1216 write_page(bitmap, bitmap->sb_page, 1);
1217 } 1217 }
1218 spin_lock_irqsave(&bitmap->lock, flags); 1218 spin_lock_irqsave(&bitmap->lock, flags);
@@ -1235,7 +1235,7 @@ void bitmap_daemon_work(struct mddev *mddev)
1235 -1); 1235 -1);
1236 1236
1237 /* clear the bit */ 1237 /* clear the bit */
1238 paddr = kmap_atomic(page, KM_USER0); 1238 paddr = kmap_atomic(page);
1239 if (bitmap->flags & BITMAP_HOSTENDIAN) 1239 if (bitmap->flags & BITMAP_HOSTENDIAN)
1240 clear_bit(file_page_offset(bitmap, j), 1240 clear_bit(file_page_offset(bitmap, j),
1241 paddr); 1241 paddr);
@@ -1244,7 +1244,7 @@ void bitmap_daemon_work(struct mddev *mddev)
1244 file_page_offset(bitmap, 1244 file_page_offset(bitmap,
1245 j), 1245 j),
1246 paddr); 1246 paddr);
1247 kunmap_atomic(paddr, KM_USER0); 1247 kunmap_atomic(paddr);
1248 } else if (*bmc <= 2) { 1248 } else if (*bmc <= 2) {
1249 *bmc = 1; /* maybe clear the bit next time */ 1249 *bmc = 1; /* maybe clear the bit next time */
1250 set_page_attr(bitmap, page, BITMAP_PAGE_PENDING); 1250 set_page_attr(bitmap, page, BITMAP_PAGE_PENDING);
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 8c2a000cf3f5..db6b51639cee 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -590,9 +590,9 @@ static int crypt_iv_lmk_gen(struct crypt_config *cc, u8 *iv,
590 int r = 0; 590 int r = 0;
591 591
592 if (bio_data_dir(dmreq->ctx->bio_in) == WRITE) { 592 if (bio_data_dir(dmreq->ctx->bio_in) == WRITE) {
593 src = kmap_atomic(sg_page(&dmreq->sg_in), KM_USER0); 593 src = kmap_atomic(sg_page(&dmreq->sg_in));
594 r = crypt_iv_lmk_one(cc, iv, dmreq, src + dmreq->sg_in.offset); 594 r = crypt_iv_lmk_one(cc, iv, dmreq, src + dmreq->sg_in.offset);
595 kunmap_atomic(src, KM_USER0); 595 kunmap_atomic(src);
596 } else 596 } else
597 memset(iv, 0, cc->iv_size); 597 memset(iv, 0, cc->iv_size);
598 598
@@ -608,14 +608,14 @@ static int crypt_iv_lmk_post(struct crypt_config *cc, u8 *iv,
608 if (bio_data_dir(dmreq->ctx->bio_in) == WRITE) 608 if (bio_data_dir(dmreq->ctx->bio_in) == WRITE)
609 return 0; 609 return 0;
610 610
611 dst = kmap_atomic(sg_page(&dmreq->sg_out), KM_USER0); 611 dst = kmap_atomic(sg_page(&dmreq->sg_out));
612 r = crypt_iv_lmk_one(cc, iv, dmreq, dst + dmreq->sg_out.offset); 612 r = crypt_iv_lmk_one(cc, iv, dmreq, dst + dmreq->sg_out.offset);
613 613
614 /* Tweak the first block of plaintext sector */ 614 /* Tweak the first block of plaintext sector */
615 if (!r) 615 if (!r)
616 crypto_xor(dst + dmreq->sg_out.offset, iv, cc->iv_size); 616 crypto_xor(dst + dmreq->sg_out.offset, iv, cc->iv_size);
617 617
618 kunmap_atomic(dst, KM_USER0); 618 kunmap_atomic(dst);
619 return r; 619 return r;
620} 620}
621 621