diff options
author | Mark Fasheh <mfasheh@suse.com> | 2008-07-28 17:55:20 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-10-13 16:57:57 -0400 |
commit | ebcee4b5c9136096f64ee6f691a013d7c0a4bc34 (patch) | |
tree | cb28c9135559a8f5aaf4c61b9d39f9c4ce733b55 /fs/ocfs2/ocfs2.h | |
parent | 53da4939f349d4edd283b043219221ca5b78e4d4 (diff) |
ocfs2: Track local alloc bits internally
Do this instead of tracking absolute local alloc size. This avoids
needless re-calculatiion of bits from bytes in localalloc.c. Additionally,
the value is now in a more natural unit for internal file system bitmap
work.
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 7f625f2b111..43dd42e313a 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -252,7 +252,7 @@ struct ocfs2_super | |||
252 | struct ocfs2_journal *journal; | 252 | struct ocfs2_journal *journal; |
253 | unsigned long osb_commit_interval; | 253 | unsigned long osb_commit_interval; |
254 | 254 | ||
255 | int local_alloc_size; | 255 | unsigned int local_alloc_bits; |
256 | enum ocfs2_local_alloc_state local_alloc_state; | 256 | enum ocfs2_local_alloc_state local_alloc_state; |
257 | struct buffer_head *local_alloc_bh; | 257 | struct buffer_head *local_alloc_bh; |
258 | u64 la_last_gd; | 258 | u64 la_last_gd; |
@@ -554,6 +554,14 @@ static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb) | |||
554 | return pages_per_cluster; | 554 | return pages_per_cluster; |
555 | } | 555 | } |
556 | 556 | ||
557 | static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb, | ||
558 | unsigned int megs) | ||
559 | { | ||
560 | BUILD_BUG_ON(OCFS2_MAX_CLUSTERSIZE > 1048576); | ||
561 | |||
562 | return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); | ||
563 | } | ||
564 | |||
557 | static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb) | 565 | static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb) |
558 | { | 566 | { |
559 | spin_lock(&osb->osb_lock); | 567 | spin_lock(&osb->osb_lock); |