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/super.c | |
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/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 2a9f4c455f28..fc839996d052 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -94,7 +94,7 @@ struct mount_options | |||
94 | unsigned long mount_opt; | 94 | unsigned long mount_opt; |
95 | unsigned int atime_quantum; | 95 | unsigned int atime_quantum; |
96 | signed short slot; | 96 | signed short slot; |
97 | unsigned int localalloc_opt; | 97 | int localalloc_opt; |
98 | unsigned int resv_level; | 98 | unsigned int resv_level; |
99 | char cluster_stack[OCFS2_STACK_LABEL_LEN + 1]; | 99 | char cluster_stack[OCFS2_STACK_LABEL_LEN + 1]; |
100 | }; | 100 | }; |
@@ -1031,8 +1031,8 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
1031 | osb->s_atime_quantum = parsed_options.atime_quantum; | 1031 | osb->s_atime_quantum = parsed_options.atime_quantum; |
1032 | osb->preferred_slot = parsed_options.slot; | 1032 | osb->preferred_slot = parsed_options.slot; |
1033 | osb->osb_commit_interval = parsed_options.commit_interval; | 1033 | osb->osb_commit_interval = parsed_options.commit_interval; |
1034 | osb->local_alloc_default_bits = ocfs2_megabytes_to_clusters(sb, parsed_options.localalloc_opt); | 1034 | |
1035 | osb->local_alloc_bits = osb->local_alloc_default_bits; | 1035 | ocfs2_la_set_sizes(osb, parsed_options.localalloc_opt); |
1036 | osb->osb_resv_level = parsed_options.resv_level; | 1036 | osb->osb_resv_level = parsed_options.resv_level; |
1037 | 1037 | ||
1038 | status = ocfs2_verify_userspace_stack(osb, &parsed_options); | 1038 | status = ocfs2_verify_userspace_stack(osb, &parsed_options); |
@@ -1292,7 +1292,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
1292 | mopt->mount_opt = 0; | 1292 | mopt->mount_opt = 0; |
1293 | mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; | 1293 | mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; |
1294 | mopt->slot = OCFS2_INVALID_SLOT; | 1294 | mopt->slot = OCFS2_INVALID_SLOT; |
1295 | mopt->localalloc_opt = OCFS2_DEFAULT_LOCAL_ALLOC_SIZE; | 1295 | mopt->localalloc_opt = -1; |
1296 | mopt->cluster_stack[0] = '\0'; | 1296 | mopt->cluster_stack[0] = '\0'; |
1297 | mopt->resv_level = OCFS2_DEFAULT_RESV_LEVEL; | 1297 | mopt->resv_level = OCFS2_DEFAULT_RESV_LEVEL; |
1298 | 1298 | ||
@@ -1385,7 +1385,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
1385 | status = 0; | 1385 | status = 0; |
1386 | goto bail; | 1386 | goto bail; |
1387 | } | 1387 | } |
1388 | if (option >= 0 && (option <= ocfs2_local_alloc_size(sb) * 8)) | 1388 | if (option >= 0) |
1389 | mopt->localalloc_opt = option; | 1389 | mopt->localalloc_opt = option; |
1390 | break; | 1390 | break; |
1391 | case Opt_localflocks: | 1391 | case Opt_localflocks: |