diff options
author | Mark Fasheh <mfasheh@suse.com> | 2010-04-05 21:17:16 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-05 21:18:07 -0400 |
commit | 83f92318fa33cc084e14e64dc903e605f75884c1 (patch) | |
tree | c7466c64019fb050c69cab27b4388e3a86d58b1a /fs/ocfs2/reservations.c | |
parent | b07f8f24dfe54da0f074b78949044842e8df881f (diff) |
ocfs2: Add dir_resv_level mount option
The default behavior for directory reservations stays the same, but we add a
mount option so people can tweak the size of directory reservations
according to their workloads.
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/reservations.c')
-rw-r--r-- | fs/ocfs2/reservations.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ocfs2/reservations.c b/fs/ocfs2/reservations.c index 87fa35791f18..6497bcc00fa5 100644 --- a/fs/ocfs2/reservations.c +++ b/fs/ocfs2/reservations.c | |||
@@ -44,7 +44,11 @@ DEFINE_SPINLOCK(resv_lock); | |||
44 | 44 | ||
45 | #define OCFS2_MIN_RESV_WINDOW_BITS 8 | 45 | #define OCFS2_MIN_RESV_WINDOW_BITS 8 |
46 | #define OCFS2_MAX_RESV_WINDOW_BITS 1024 | 46 | #define OCFS2_MAX_RESV_WINDOW_BITS 1024 |
47 | #define OCFS2_RESV_DIR_WINDOW_BITS OCFS2_MIN_RESV_WINDOW_BITS | 47 | |
48 | int ocfs2_dir_resv_allowed(struct ocfs2_super *osb) | ||
49 | { | ||
50 | return (osb->osb_resv_level && osb->osb_dir_resv_level); | ||
51 | } | ||
48 | 52 | ||
49 | static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap, | 53 | static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap, |
50 | struct ocfs2_alloc_reservation *resv) | 54 | struct ocfs2_alloc_reservation *resv) |
@@ -56,8 +60,7 @@ static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap, | |||
56 | /* 8, 16, 32, 64, 128, 256, 512, 1024 */ | 60 | /* 8, 16, 32, 64, 128, 256, 512, 1024 */ |
57 | bits = 4 << osb->osb_resv_level; | 61 | bits = 4 << osb->osb_resv_level; |
58 | } else { | 62 | } else { |
59 | /* For now, treat directories the same as files. */ | 63 | bits = 4 << osb->osb_dir_resv_level; |
60 | bits = 4 << osb->osb_resv_level; | ||
61 | } | 64 | } |
62 | return bits; | 65 | return bits; |
63 | } | 66 | } |