aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/raid56.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/raid56.c')
-rw-r--r--fs/btrfs/raid56.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 55161369fab1..0b7792e02dd5 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -270,7 +270,7 @@ static void cache_rbio_pages(struct btrfs_raid_bio *rbio)
270 s = kmap(rbio->bio_pages[i]); 270 s = kmap(rbio->bio_pages[i]);
271 d = kmap(rbio->stripe_pages[i]); 271 d = kmap(rbio->stripe_pages[i]);
272 272
273 memcpy(d, s, PAGE_CACHE_SIZE); 273 memcpy(d, s, PAGE_SIZE);
274 274
275 kunmap(rbio->bio_pages[i]); 275 kunmap(rbio->bio_pages[i]);
276 kunmap(rbio->stripe_pages[i]); 276 kunmap(rbio->stripe_pages[i]);
@@ -962,7 +962,7 @@ static struct page *page_in_rbio(struct btrfs_raid_bio *rbio,
962 */ 962 */
963static unsigned long rbio_nr_pages(unsigned long stripe_len, int nr_stripes) 963static unsigned long rbio_nr_pages(unsigned long stripe_len, int nr_stripes)
964{ 964{
965 return DIV_ROUND_UP(stripe_len, PAGE_CACHE_SIZE) * nr_stripes; 965 return DIV_ROUND_UP(stripe_len, PAGE_SIZE) * nr_stripes;
966} 966}
967 967
968/* 968/*
@@ -1078,7 +1078,7 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio,
1078 u64 disk_start; 1078 u64 disk_start;
1079 1079
1080 stripe = &rbio->bbio->stripes[stripe_nr]; 1080 stripe = &rbio->bbio->stripes[stripe_nr];
1081 disk_start = stripe->physical + (page_index << PAGE_CACHE_SHIFT); 1081 disk_start = stripe->physical + (page_index << PAGE_SHIFT);
1082 1082
1083 /* if the device is missing, just fail this stripe */ 1083 /* if the device is missing, just fail this stripe */
1084 if (!stripe->dev->bdev) 1084 if (!stripe->dev->bdev)
@@ -1096,8 +1096,8 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio,
1096 if (last_end == disk_start && stripe->dev->bdev && 1096 if (last_end == disk_start && stripe->dev->bdev &&
1097 !last->bi_error && 1097 !last->bi_error &&
1098 last->bi_bdev == stripe->dev->bdev) { 1098 last->bi_bdev == stripe->dev->bdev) {
1099 ret = bio_add_page(last, page, PAGE_CACHE_SIZE, 0); 1099 ret = bio_add_page(last, page, PAGE_SIZE, 0);
1100 if (ret == PAGE_CACHE_SIZE) 1100 if (ret == PAGE_SIZE)
1101 return 0; 1101 return 0;
1102 } 1102 }
1103 } 1103 }
@@ -1111,7 +1111,7 @@ static int rbio_add_io_page(struct btrfs_raid_bio *rbio,
1111 bio->bi_bdev = stripe->dev->bdev; 1111 bio->bi_bdev = stripe->dev->bdev;
1112 bio->bi_iter.bi_sector = disk_start >> 9; 1112 bio->bi_iter.bi_sector = disk_start >> 9;
1113 1113
1114 bio_add_page(bio, page, PAGE_CACHE_SIZE, 0); 1114 bio_add_page(bio, page, PAGE_SIZE, 0);
1115 bio_list_add(bio_list, bio); 1115 bio_list_add(bio_list, bio);
1116 return 0; 1116 return 0;
1117} 1117}
@@ -1154,7 +1154,7 @@ static void index_rbio_pages(struct btrfs_raid_bio *rbio)
1154 bio_list_for_each(bio, &rbio->bio_list) { 1154 bio_list_for_each(bio, &rbio->bio_list) {
1155 start = (u64)bio->bi_iter.bi_sector << 9; 1155 start = (u64)bio->bi_iter.bi_sector << 9;
1156 stripe_offset = start - rbio->bbio->raid_map[0]; 1156 stripe_offset = start - rbio->bbio->raid_map[0];
1157 page_index = stripe_offset >> PAGE_CACHE_SHIFT; 1157 page_index = stripe_offset >> PAGE_SHIFT;
1158 1158
1159 for (i = 0; i < bio->bi_vcnt; i++) { 1159 for (i = 0; i < bio->bi_vcnt; i++) {
1160 p = bio->bi_io_vec[i].bv_page; 1160 p = bio->bi_io_vec[i].bv_page;
@@ -1253,7 +1253,7 @@ static noinline void finish_rmw(struct btrfs_raid_bio *rbio)
1253 } else { 1253 } else {
1254 /* raid5 */ 1254 /* raid5 */
1255 memcpy(pointers[nr_data], pointers[0], PAGE_SIZE); 1255 memcpy(pointers[nr_data], pointers[0], PAGE_SIZE);
1256 run_xor(pointers + 1, nr_data - 1, PAGE_CACHE_SIZE); 1256 run_xor(pointers + 1, nr_data - 1, PAGE_SIZE);
1257 } 1257 }
1258 1258
1259 1259
@@ -1914,7 +1914,7 @@ pstripe:
1914 /* Copy parity block into failed block to start with */ 1914 /* Copy parity block into failed block to start with */
1915 memcpy(pointers[faila], 1915 memcpy(pointers[faila],
1916 pointers[rbio->nr_data], 1916 pointers[rbio->nr_data],
1917 PAGE_CACHE_SIZE); 1917 PAGE_SIZE);
1918 1918
1919 /* rearrange the pointer array */ 1919 /* rearrange the pointer array */
1920 p = pointers[faila]; 1920 p = pointers[faila];
@@ -1923,7 +1923,7 @@ pstripe:
1923 pointers[rbio->nr_data - 1] = p; 1923 pointers[rbio->nr_data - 1] = p;
1924 1924
1925 /* xor in the rest */ 1925 /* xor in the rest */
1926 run_xor(pointers, rbio->nr_data - 1, PAGE_CACHE_SIZE); 1926 run_xor(pointers, rbio->nr_data - 1, PAGE_SIZE);
1927 } 1927 }
1928 /* if we're doing this rebuild as part of an rmw, go through 1928 /* if we're doing this rebuild as part of an rmw, go through
1929 * and set all of our private rbio pages in the 1929 * and set all of our private rbio pages in the
@@ -2250,7 +2250,7 @@ void raid56_add_scrub_pages(struct btrfs_raid_bio *rbio, struct page *page,
2250 ASSERT(logical + PAGE_SIZE <= rbio->bbio->raid_map[0] + 2250 ASSERT(logical + PAGE_SIZE <= rbio->bbio->raid_map[0] +
2251 rbio->stripe_len * rbio->nr_data); 2251 rbio->stripe_len * rbio->nr_data);
2252 stripe_offset = (int)(logical - rbio->bbio->raid_map[0]); 2252 stripe_offset = (int)(logical - rbio->bbio->raid_map[0]);
2253 index = stripe_offset >> PAGE_CACHE_SHIFT; 2253 index = stripe_offset >> PAGE_SHIFT;
2254 rbio->bio_pages[index] = page; 2254 rbio->bio_pages[index] = page;
2255} 2255}
2256 2256
@@ -2365,14 +2365,14 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,
2365 } else { 2365 } else {
2366 /* raid5 */ 2366 /* raid5 */
2367 memcpy(pointers[nr_data], pointers[0], PAGE_SIZE); 2367 memcpy(pointers[nr_data], pointers[0], PAGE_SIZE);
2368 run_xor(pointers + 1, nr_data - 1, PAGE_CACHE_SIZE); 2368 run_xor(pointers + 1, nr_data - 1, PAGE_SIZE);
2369 } 2369 }
2370 2370
2371 /* Check scrubbing pairty and repair it */ 2371 /* Check scrubbing pairty and repair it */
2372 p = rbio_stripe_page(rbio, rbio->scrubp, pagenr); 2372 p = rbio_stripe_page(rbio, rbio->scrubp, pagenr);
2373 parity = kmap(p); 2373 parity = kmap(p);
2374 if (memcmp(parity, pointers[rbio->scrubp], PAGE_CACHE_SIZE)) 2374 if (memcmp(parity, pointers[rbio->scrubp], PAGE_SIZE))
2375 memcpy(parity, pointers[rbio->scrubp], PAGE_CACHE_SIZE); 2375 memcpy(parity, pointers[rbio->scrubp], PAGE_SIZE);
2376 else 2376 else
2377 /* Parity is right, needn't writeback */ 2377 /* Parity is right, needn't writeback */
2378 bitmap_clear(rbio->dbitmap, pagenr, 1); 2378 bitmap_clear(rbio->dbitmap, pagenr, 1);