diff options
author | Mark Fasheh <mfasheh@suse.com> | 2010-04-05 21:17:13 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-05-05 21:18:06 -0400 |
commit | 73c8a80003d13be54e2309865030404441075182 (patch) | |
tree | 9b5a47939c22838133f46ea6d207254aa68d177b /fs/ocfs2/ocfs2.h | |
parent | a57c8fd2ad238258cc983049008aea5f985804b2 (diff) |
ocfs2: clean up localalloc mount option size parsing
This patch pulls the local alloc sizing code into localalloc.c and provides
a callout to it from ocfs2_fill_super(). Behavior is essentially unchanged
except that I correctly calculate the maximum local alloc size. The old code
in ocfs2_parse_options() calculated the max size as:
ocfs2_local_alloc_size(sb) * 8
which is correct, in bits. Unfortunately though the option passed in is in
megabytes. Ultimately, this bug made no real difference - the shrink code
would catch a too-large size and bring it down to something reasonable.
Still, it's less than efficient as-is.
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 9552560df6cd..e98c954cf961 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -768,6 +768,12 @@ static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb, | |||
768 | return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); | 768 | return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); |
769 | } | 769 | } |
770 | 770 | ||
771 | static inline unsigned int ocfs2_clusters_to_megabytes(struct super_block *sb, | ||
772 | unsigned int clusters) | ||
773 | { | ||
774 | return clusters >> (20 - OCFS2_SB(sb)->s_clustersize_bits); | ||
775 | } | ||
776 | |||
771 | static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) | 777 | static inline void _ocfs2_set_bit(unsigned int bit, unsigned long *bitmap) |
772 | { | 778 | { |
773 | ext2_set_bit(bit, bitmap); | 779 | ext2_set_bit(bit, bitmap); |