Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1587739

[PATCH v1 04/14] md: move two macros into md.h

From Ming Lei <tom.leiming@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v1 04/14] md: move two macros into md.h
Date 2017-02-24 16:50 +0100
Message-ID <teqi6-2bp-31@gated-at.bofh.it> (permalink)
References <teqi5-2bp-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 drivers/md/md.h     | 5 +++++
 drivers/md/raid1.c  | 2 --
 drivers/md/raid10.c | 3 ---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/md/md.h b/drivers/md/md.h
index b8859cbf84b6..1d63239a1be4 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -715,4 +715,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 */
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 2a0bf5b430c9..2013e5870761 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -91,10 +91,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)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 125d74dba27e..227dd6ad7716 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -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 */
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v1 00/14] md: cleanup on direct access to bvec table Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 06/14] md: raid1: simplify r1buf_pool_free() Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 04/14] md: move two macros into md.h Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 08/14] md: raid1: retrieve page from pre-allocated resync page array Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 13/14] md: raid10: retrieve page from preallocated resync page array Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 14/14] md: raid10: avoid direct access to bvec table in handle_reshape_read_error Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 03/14] md: raid1/raid10: use bio_remove_last_page() Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
  [PATCH v1 01/14] block: introduce bio_segments_all() Ming Lei <tom.leiming@gmail.com> - 2017-02-24 16:50 +0100
    Re: [PATCH v1 01/14] block: introduce bio_segments_all() Christoph Hellwig <hch@infradead.org> - 2017-02-25 19:30 +0100
      Re: [PATCH v1 01/14] block: introduce bio_segments_all() Ming Lei <tom.leiming@gmail.com> - 2017-02-28 13:30 +0100

csiph-web