aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-05-21 23:55:19 -0400
committerNeilBrown <neilb@suse.de>2012-05-21 23:55:19 -0400
commit7466712347c58c367636cc875801c8703bc729e7 (patch)
treef9cd8a4acdb5e60cc4088fd9497dd41dfb8998d1 /drivers/md
parentb405fe91e50c60c80e72d798025aea4917096421 (diff)
md/bitmap: convert some spin_lock_irqsave to spin_lock_irq
All of these sites can only be called from process context with irqs enabled, so using irqsave/irqrestore just adds noise. Remove it. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bitmap.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index f3a9dffc3fc8..a1862d9e6d83 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -737,10 +737,9 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
737 struct page **map, *sb_page; 737 struct page **map, *sb_page;
738 unsigned long *attr; 738 unsigned long *attr;
739 int pages; 739 int pages;
740 unsigned long flags;
741 struct bitmap_storage *store = &bitmap->storage; 740 struct bitmap_storage *store = &bitmap->storage;
742 741
743 spin_lock_irqsave(&bitmap->lock, flags); 742 spin_lock_irq(&bitmap->lock);
744 map = store->filemap; 743 map = store->filemap;
745 store->filemap = NULL; 744 store->filemap = NULL;
746 attr = store->filemap_attr; 745 attr = store->filemap_attr;
@@ -749,7 +748,7 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
749 store->file_pages = 0; 748 store->file_pages = 0;
750 sb_page = store->sb_page; 749 sb_page = store->sb_page;
751 store->sb_page = NULL; 750 store->sb_page = NULL;
752 spin_unlock_irqrestore(&bitmap->lock, flags); 751 spin_unlock_irq(&bitmap->lock);
753 752
754 while (pages--) 753 while (pages--)
755 if (map[pages] != sb_page) /* 0 is sb_page, release it below */ 754 if (map[pages] != sb_page) /* 0 is sb_page, release it below */
@@ -764,12 +763,11 @@ static void bitmap_file_unmap(struct bitmap *bitmap)
764static void bitmap_file_put(struct bitmap *bitmap) 763static void bitmap_file_put(struct bitmap *bitmap)
765{ 764{
766 struct file *file; 765 struct file *file;
767 unsigned long flags;
768 766
769 spin_lock_irqsave(&bitmap->lock, flags); 767 spin_lock_irq(&bitmap->lock);
770 file = bitmap->storage.file; 768 file = bitmap->storage.file;
771 bitmap->storage.file = NULL; 769 bitmap->storage.file = NULL;
772 spin_unlock_irqrestore(&bitmap->lock, flags); 770 spin_unlock_irq(&bitmap->lock);
773 771
774 if (file) 772 if (file)
775 wait_event(bitmap->write_wait, 773 wait_event(bitmap->write_wait,
@@ -901,7 +899,7 @@ static void bitmap_file_clear_bit(struct bitmap *bitmap, sector_t block)
901 * sync the dirty pages of the bitmap file to disk */ 899 * sync the dirty pages of the bitmap file to disk */
902void bitmap_unplug(struct bitmap *bitmap) 900void bitmap_unplug(struct bitmap *bitmap)
903{ 901{
904 unsigned long i, flags; 902 unsigned long i;
905 int dirty, need_write; 903 int dirty, need_write;
906 int wait = 0; 904 int wait = 0;
907 905
@@ -911,9 +909,9 @@ void bitmap_unplug(struct bitmap *bitmap)
911 /* look at each page to see if there are any set bits that need to be 909 /* look at each page to see if there are any set bits that need to be
912 * flushed out to disk */ 910 * flushed out to disk */
913 for (i = 0; i < bitmap->storage.file_pages; i++) { 911 for (i = 0; i < bitmap->storage.file_pages; i++) {
914 spin_lock_irqsave(&bitmap->lock, flags); 912 spin_lock_irq(&bitmap->lock);
915 if (!bitmap->storage.filemap) { 913 if (!bitmap->storage.filemap) {
916 spin_unlock_irqrestore(&bitmap->lock, flags); 914 spin_unlock_irq(&bitmap->lock);
917 return; 915 return;
918 } 916 }
919 dirty = test_page_attr(bitmap, i, BITMAP_PAGE_DIRTY); 917 dirty = test_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
@@ -924,7 +922,7 @@ void bitmap_unplug(struct bitmap *bitmap)
924 clear_page_attr(bitmap, i, BITMAP_PAGE_PENDING); 922 clear_page_attr(bitmap, i, BITMAP_PAGE_PENDING);
925 if (dirty) 923 if (dirty)
926 wait = 1; 924 wait = 1;
927 spin_unlock_irqrestore(&bitmap->lock, flags); 925 spin_unlock_irq(&bitmap->lock);
928 926
929 if (dirty || need_write) 927 if (dirty || need_write)
930 write_page(bitmap, bitmap->storage.filemap[i], 0); 928 write_page(bitmap, bitmap->storage.filemap[i], 0);
@@ -1129,7 +1127,6 @@ void bitmap_daemon_work(struct mddev *mddev)
1129 struct bitmap *bitmap; 1127 struct bitmap *bitmap;
1130 unsigned long j; 1128 unsigned long j;
1131 unsigned long nextpage; 1129 unsigned long nextpage;
1132 unsigned long flags;
1133 sector_t blocks; 1130 sector_t blocks;
1134 1131
1135 /* Use a mutex to guard daemon_work against 1132 /* Use a mutex to guard daemon_work against
@@ -1156,7 +1153,7 @@ void bitmap_daemon_work(struct mddev *mddev)
1156 * So set NEEDWRITE now, then after we make any last-minute changes 1153 * So set NEEDWRITE now, then after we make any last-minute changes
1157 * we will write it. 1154 * we will write it.
1158 */ 1155 */
1159 spin_lock_irqsave(&bitmap->lock, flags); 1156 spin_lock_irq(&bitmap->lock);
1160 for (j = 0; j < bitmap->storage.file_pages; j++) 1157 for (j = 0; j < bitmap->storage.file_pages; j++)
1161 if (test_page_attr(bitmap, j, 1158 if (test_page_attr(bitmap, j,
1162 BITMAP_PAGE_PENDING)) { 1159 BITMAP_PAGE_PENDING)) {
@@ -1235,14 +1232,14 @@ void bitmap_daemon_work(struct mddev *mddev)
1235 BITMAP_PAGE_NEEDWRITE)) { 1232 BITMAP_PAGE_NEEDWRITE)) {
1236 clear_page_attr(bitmap, j, 1233 clear_page_attr(bitmap, j,
1237 BITMAP_PAGE_NEEDWRITE); 1234 BITMAP_PAGE_NEEDWRITE);
1238 spin_unlock_irqrestore(&bitmap->lock, flags); 1235 spin_unlock_irq(&bitmap->lock);
1239 write_page(bitmap, bitmap->storage.filemap[j], 0); 1236 write_page(bitmap, bitmap->storage.filemap[j], 0);
1240 spin_lock_irqsave(&bitmap->lock, flags); 1237 spin_lock_irq(&bitmap->lock);
1241 if (!bitmap->storage.filemap) 1238 if (!bitmap->storage.filemap)
1242 break; 1239 break;
1243 } 1240 }
1244 } 1241 }
1245 spin_unlock_irqrestore(&bitmap->lock, flags); 1242 spin_unlock_irq(&bitmap->lock);
1246 1243
1247 done: 1244 done:
1248 if (bitmap->allclean == 0) 1245 if (bitmap->allclean == 0)
@@ -1815,12 +1812,11 @@ EXPORT_SYMBOL_GPL(bitmap_load);
1815void bitmap_status(struct seq_file *seq, struct bitmap *bitmap) 1812void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
1816{ 1813{
1817 unsigned long chunk_kb; 1814 unsigned long chunk_kb;
1818 unsigned long flags;
1819 1815
1820 if (!bitmap) 1816 if (!bitmap)
1821 return; 1817 return;
1822 1818
1823 spin_lock_irqsave(&bitmap->lock, flags); 1819 spin_lock_irq(&bitmap->lock);
1824 chunk_kb = bitmap->mddev->bitmap_info.chunksize >> 10; 1820 chunk_kb = bitmap->mddev->bitmap_info.chunksize >> 10;
1825 seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], " 1821 seq_printf(seq, "bitmap: %lu/%lu pages [%luKB], "
1826 "%lu%s chunk", 1822 "%lu%s chunk",
@@ -1836,7 +1832,7 @@ void bitmap_status(struct seq_file *seq, struct bitmap *bitmap)
1836 } 1832 }
1837 1833
1838 seq_printf(seq, "\n"); 1834 seq_printf(seq, "\n");
1839 spin_unlock_irqrestore(&bitmap->lock, flags); 1835 spin_unlock_irq(&bitmap->lock);
1840} 1836}
1841 1837
1842static ssize_t 1838static ssize_t