diff options
author | majianpeng <majianpeng@gmail.com> | 2013-11-13 23:16:18 -0500 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-11-18 23:19:18 -0500 |
commit | 8e005f7c0276317cfa8fcb0291a0df57f9ef832c (patch) | |
tree | 277d1be6569695e963cb660563b8dc6de7e2df87 /drivers/md | |
parent | 07169fd478ed2fbb3c894d524be9400658f16747 (diff) |
raid1: Add some macros to make code clearly.
In a subsequent patch, we'll use some const parameters.
Using macros will make the code clearly.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/raid1.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ba5efb080862..78da3392f577 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -84,10 +84,12 @@ static void r1bio_pool_free(void *r1_bio, void *data) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | #define RESYNC_BLOCK_SIZE (64*1024) | 86 | #define RESYNC_BLOCK_SIZE (64*1024) |
87 | //#define RESYNC_BLOCK_SIZE PAGE_SIZE | 87 | #define RESYNC_DEPTH 32 |
88 | #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9) | 88 | #define RESYNC_SECTORS (RESYNC_BLOCK_SIZE >> 9) |
89 | #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) | 89 | #define RESYNC_PAGES ((RESYNC_BLOCK_SIZE + PAGE_SIZE-1) / PAGE_SIZE) |
90 | #define RESYNC_WINDOW (2048*1024) | 90 | #define RESYNC_WINDOW (RESYNC_BLOCK_SIZE * RESYNC_DEPTH) |
91 | #define RESYNC_WINDOW_SECTORS (RESYNC_WINDOW >> 9) | ||
92 | #define NEXT_NORMALIO_DISTANCE (3 * RESYNC_WINDOW_SECTORS) | ||
91 | 93 | ||
92 | static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) | 94 | static void * r1buf_pool_alloc(gfp_t gfp_flags, void *data) |
93 | { | 95 | { |
@@ -814,8 +816,6 @@ static void flush_pending_writes(struct r1conf *conf) | |||
814 | * there is no normal IO happeing. It must arrange to call | 816 | * there is no normal IO happeing. It must arrange to call |
815 | * lower_barrier when the particular background IO completes. | 817 | * lower_barrier when the particular background IO completes. |
816 | */ | 818 | */ |
817 | #define RESYNC_DEPTH 32 | ||
818 | |||
819 | static void raise_barrier(struct r1conf *conf) | 819 | static void raise_barrier(struct r1conf *conf) |
820 | { | 820 | { |
821 | spin_lock_irq(&conf->resync_lock); | 821 | spin_lock_irq(&conf->resync_lock); |