summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.com>2008-07-28 14:55:20 -0700
committerMark Fasheh <mfasheh@suse.com>2008-10-13 13:57:57 -0700
commitebcee4b5c9136096f64ee6f691a013d7c0a4bc34 (patch)
treecb28c9135559a8f5aaf4c61b9d39f9c4ce733b55 /fs/ocfs2/ocfs2.h
parent53da4939f349d4edd283b043219221ca5b78e4d4 (diff)
downloadop-kernel-dev-ebcee4b5c9136096f64ee6f691a013d7c0a4bc34.zip
op-kernel-dev-ebcee4b5c9136096f64ee6f691a013d7c0a4bc34.tar.gz
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.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 7f625f2..43dd42e 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -252,7 +252,7 @@ struct ocfs2_super
struct ocfs2_journal *journal;
unsigned long osb_commit_interval;
- int local_alloc_size;
+ unsigned int local_alloc_bits;
enum ocfs2_local_alloc_state local_alloc_state;
struct buffer_head *local_alloc_bh;
u64 la_last_gd;
@@ -554,6 +554,14 @@ static inline unsigned int ocfs2_pages_per_cluster(struct super_block *sb)
return pages_per_cluster;
}
+static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb,
+ unsigned int megs)
+{
+ BUILD_BUG_ON(OCFS2_MAX_CLUSTERSIZE > 1048576);
+
+ return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits);
+}
+
static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb)
{
spin_lock(&osb->osb_lock);
OpenPOWER on IntegriCloud