aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/reservations.c
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2009-12-07 16:16:07 -0500
committerJoel Becker <joel.becker@oracle.com>2010-05-05 21:17:30 -0400
commite3b4a97dbe9741a3227c3ed857a0632532fcd386 (patch)
tree31da8dd09ad6ef8959b287e36e98ead30472a284 /fs/ocfs2/reservations.c
parent4fe370afaae49c57619bb0bedb75de7e7c168308 (diff)
ocfs2: use allocation reservations for directory data
Use the reservations system for unindexed dir tree allocations. We don't bother with the indexed tree as reads from it are mostly random anyway. Directory reservations are marked seperately, to allow the reservations code a chance to optimize their window sizes. This patch allocates only 8 bits for directory windows as they generally are not expected to grow as quickly as file data. Future improvements to dir window sizing can trivially be made. Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/reservations.c')
-rw-r--r--fs/ocfs2/reservations.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ocfs2/reservations.c b/fs/ocfs2/reservations.c
index 79642d608210..7fc6cfee95f1 100644
--- a/fs/ocfs2/reservations.c
+++ b/fs/ocfs2/reservations.c
@@ -44,6 +44,7 @@ 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
48static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap, 49static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap,
49 struct ocfs2_alloc_reservation *resv) 50 struct ocfs2_alloc_reservation *resv)
@@ -51,8 +52,11 @@ static unsigned int ocfs2_resv_window_bits(struct ocfs2_reservation_map *resmap,
51 struct ocfs2_super *osb = resmap->m_osb; 52 struct ocfs2_super *osb = resmap->m_osb;
52 unsigned int bits; 53 unsigned int bits;
53 54
54 /* 8, 16, 32, 64, 128, 256, 512, 1024 */ 55 if (!(resv->r_flags & OCFS2_RESV_FLAG_DIR)) {
55 bits = 4 << osb->osb_resv_level; 56 /* 8, 16, 32, 64, 128, 256, 512, 1024 */
57 bits = 4 << osb->osb_resv_level;
58 } else
59 bits = OCFS2_RESV_DIR_WINDOW_BITS;
56 60
57 return bits; 61 return bits;
58} 62}