aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2007-12-18 02:46:10 -0500
committerMark Fasheh <mark.fasheh@oracle.com>2008-01-25 17:48:54 -0500
commite9d578a8f279d5e7d1e903f436aefc76ba330b43 (patch)
treeac5ee47053d00940d25f6dd9d2b23cb18e587cf0 /fs/ocfs2/super.c
parent1252c434e39dc60ca9e8ed682f3e04930e2c08de (diff)
ocfs2: Initalize bitmap_cpg of ocfs2_super to be the maximum.
This value is initialized from global_bitmap->id2.i_chain.cl_cpg. If there is only 1 group, it will be equal to the total clusters in the volume. So as for online resize, it should change for all the nodes in the cluster. It isn't easy and there is no corresponding lock for it. bitmap_cpg is only used in 2 areas: 1. Check whether the suballoc is too large for us to allocate from the global bitmap, so it is little used. And now the suballoc size is 2048, it rarely meet this situation and the check is almost useless. 2. Calculate which group a cluster belongs to. We use it during truncate to figure out which cluster group an extent belongs too. But we should be OK if we increase it though as the cluster group calculated shouldn't change and we only ever have a small bitmap_cpg on file systems with a single cluster group. Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 7708df36e223..479ac50c86d9 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1280,7 +1280,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
1280 int i, cbits, bbits; 1280 int i, cbits, bbits;
1281 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data; 1281 struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh->b_data;
1282 struct inode *inode = NULL; 1282 struct inode *inode = NULL;
1283 struct buffer_head *bitmap_bh = NULL;
1284 struct ocfs2_journal *journal; 1283 struct ocfs2_journal *journal;
1285 __le32 uuid_net_key; 1284 __le32 uuid_net_key;
1286 struct ocfs2_super *osb; 1285 struct ocfs2_super *osb;
@@ -1497,25 +1496,9 @@ static int ocfs2_initialize_super(struct super_block *sb,
1497 } 1496 }
1498 1497
1499 osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno; 1498 osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
1500
1501 /* We don't have a cluster lock on the bitmap here because
1502 * we're only interested in static information and the extra
1503 * complexity at mount time isn't worht it. Don't pass the
1504 * inode in to the read function though as we don't want it to
1505 * be put in the cache. */
1506 status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
1507 NULL);
1508 iput(inode); 1499 iput(inode);
1509 if (status < 0) {
1510 mlog_errno(status);
1511 goto bail;
1512 }
1513 1500
1514 di = (struct ocfs2_dinode *) bitmap_bh->b_data; 1501 osb->bitmap_cpg = ocfs2_group_bitmap_size(sb) * 8;
1515 osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
1516 brelse(bitmap_bh);
1517 mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
1518 (unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg);
1519 1502
1520 status = ocfs2_init_slot_info(osb); 1503 status = ocfs2_init_slot_info(osb);
1521 if (status < 0) { 1504 if (status < 0) {