]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
md: move two macros into md.h
authorMing Lei <tom.leiming@gmail.com>
Thu, 16 Mar 2017 16:12:23 +0000 (00:12 +0800)
committerShaohua Li <shli@fb.com>
Fri, 24 Mar 2017 17:41:36 +0000 (10:41 -0700)
Both raid1 and raid10 share common resync
block size and page count, so move them into md.h.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/md.h
drivers/md/raid1.c
drivers/md/raid10.c

index 7a7847d1cc39a50720712fac906cdf598bf54906..31d2d70849b62ba4312964da160070a6ad4f9ab8 100644 (file)
@@ -718,4 +718,9 @@ static inline void mddev_check_writesame(struct mddev *mddev, struct bio *bio)
            !bdev_get_queue(bio->bi_bdev)->limits.max_write_same_sectors)
                mddev->queue->limits.max_write_same_sectors = 0;
 }
+
+/* Maximum size of each resync request */
+#define RESYNC_BLOCK_SIZE (64*1024)
+#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
+
 #endif /* _MD_MD_H */
index 569f501fb710346a859eb2bf9c5b5228e18d3a56..c31f9e206148e98d38d34246bb31303023ff79d4 100644 (file)
@@ -95,10 +95,8 @@ static void r1bio_pool_free(void *r1_bio, void *data)
        kfree(r1_bio);
 }
 
-#define RESYNC_BLOCK_SIZE (64*1024)
 #define RESYNC_DEPTH 32
 #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9)
-#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
 #define RESYNC_WINDOW (RESYNC_BLOCK_SIZE * RESYNC_DEPTH)
 #define RESYNC_WINDOW_SECTORS (RESYNC_WINDOW >> 9)
 #define CLUSTER_RESYNC_WINDOW (16 * RESYNC_WINDOW)
index 6c9783ba85db7865b910f6d0aea99100af83a168..301e73fe2d2f8eb5f61b42fb625f03d15eb90fd3 100644 (file)
@@ -125,9 +125,6 @@ static void r10bio_pool_free(void *r10_bio, void *data)
        kfree(r10_bio);
 }
 
-/* Maximum size of each resync request */
-#define RESYNC_BLOCK_SIZE (64*1024)
-#define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE)
 /* amount of memory to reserve for resync requests */
 #define RESYNC_WINDOW (1024*1024)
 /* maximum number of concurrent requests, memory permitting */