Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 201022
b: refs/heads/master
c: 1739da4
h: refs/heads/master
v: v3
  • Loading branch information
Tao Ma authored and Joel Becker committed Jun 15, 2010
1 parent c79da00 commit b0dc6f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40f165f416bde747d85cdf71bc9dde700912f71f
refs/heads/master: 1739da40543ed2129050ccfa8a076a851ab6ed00
7 changes: 7 additions & 0 deletions trunk/fs/ocfs2/localalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb)
{
unsigned int la_mb;
unsigned int gd_mb;
unsigned int la_max_mb;
unsigned int megs_per_slot;
struct super_block *sb = osb->sb;

Expand Down Expand Up @@ -182,6 +183,12 @@ unsigned int ocfs2_la_default_mb(struct ocfs2_super *osb)
if (megs_per_slot < la_mb)
la_mb = megs_per_slot;

/* We can't store more bits than we can in a block. */
la_max_mb = ocfs2_clusters_to_megabytes(osb->sb,
ocfs2_local_alloc_size(sb) * 8);
if (la_mb > la_max_mb)
la_mb = la_max_mb;

return la_mb;
}

Expand Down

0 comments on commit b0dc6f9

Please sign in to comment.