diff options
| author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-08-04 10:26:03 +1000 | 
|---|---|---|
| committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-08-04 10:26:03 +1000 | 
| commit | 412a4ac5e9cf7fdeb6af562c25547a9b9da7674f (patch) | |
| tree | a8ce13cbc9c47c99799e5e3e3ad26ba78274ee73 /fs/ocfs2/localalloc.c | |
| parent | e8e5c2155b0035b6e04f29be67f6444bc914005b (diff) | |
| parent | 0c2daaafcdec726e89cbccca61d576de8429c537 (diff) | |
| download | olio-linux-3.10-412a4ac5e9cf7fdeb6af562c25547a9b9da7674f.tar.xz olio-linux-3.10-412a4ac5e9cf7fdeb6af562c25547a9b9da7674f.zip  | |
Merge commit 'gcl/next' into next
Diffstat (limited to 'fs/ocfs2/localalloc.c')
| -rw-r--r-- | fs/ocfs2/localalloc.c | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 3d7419682dc..ec6adbf8f55 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -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; @@ -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;  }  |