diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-03-27 14:21:26 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2012-03-27 14:21:26 -0400 |
commit | 94598ba8d8ff066115508fb99e593d2de1ca67e1 (patch) | |
tree | 035dcae1b60f84b5620ab1a9d42b5d1fad4b4862 /fs/btrfs/reada.c | |
parent | ea466794084f55d8fcc100711cf17923bf57e962 (diff) |
Btrfs: introduce common define for max number of mirrors
Readahead already has a define for the max number of mirrors. Scrub
needs such a define now, the rest of the code will need something
like this soon. Therefore the define was added to ctree.h and removed
from the readahead code.
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r-- | fs/btrfs/reada.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index 22db04550f6a..dc5d33146fdb 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c | |||
@@ -54,7 +54,6 @@ | |||
54 | * than the 2 started one after another. | 54 | * than the 2 started one after another. |
55 | */ | 55 | */ |
56 | 56 | ||
57 | #define MAX_MIRRORS 2 | ||
58 | #define MAX_IN_FLIGHT 6 | 57 | #define MAX_IN_FLIGHT 6 |
59 | 58 | ||
60 | struct reada_extctl { | 59 | struct reada_extctl { |
@@ -71,7 +70,7 @@ struct reada_extent { | |||
71 | struct list_head extctl; | 70 | struct list_head extctl; |
72 | struct kref refcnt; | 71 | struct kref refcnt; |
73 | spinlock_t lock; | 72 | spinlock_t lock; |
74 | struct reada_zone *zones[MAX_MIRRORS]; | 73 | struct reada_zone *zones[BTRFS_MAX_MIRRORS]; |
75 | int nzones; | 74 | int nzones; |
76 | struct btrfs_device *scheduled_for; | 75 | struct btrfs_device *scheduled_for; |
77 | }; | 76 | }; |
@@ -84,7 +83,8 @@ struct reada_zone { | |||
84 | spinlock_t lock; | 83 | spinlock_t lock; |
85 | int locked; | 84 | int locked; |
86 | struct btrfs_device *device; | 85 | struct btrfs_device *device; |
87 | struct btrfs_device *devs[MAX_MIRRORS]; /* full list, incl self */ | 86 | struct btrfs_device *devs[BTRFS_MAX_MIRRORS]; /* full list, incl |
87 | * self */ | ||
88 | int ndevs; | 88 | int ndevs; |
89 | struct kref refcnt; | 89 | struct kref refcnt; |
90 | }; | 90 | }; |
@@ -365,9 +365,9 @@ again: | |||
365 | if (ret || !bbio || length < blocksize) | 365 | if (ret || !bbio || length < blocksize) |
366 | goto error; | 366 | goto error; |
367 | 367 | ||
368 | if (bbio->num_stripes > MAX_MIRRORS) { | 368 | if (bbio->num_stripes > BTRFS_MAX_MIRRORS) { |
369 | printk(KERN_ERR "btrfs readahead: more than %d copies not " | 369 | printk(KERN_ERR "btrfs readahead: more than %d copies not " |
370 | "supported", MAX_MIRRORS); | 370 | "supported", BTRFS_MAX_MIRRORS); |
371 | goto error; | 371 | goto error; |
372 | } | 372 | } |
373 | 373 | ||