Skip to content

Commit

Permalink
ocfs2: limit cluster bitmap information saved at mount
Browse files Browse the repository at this point in the history
We were storing cluster count on the ocfs2_super structure, but never
actually using it so remove that. Also, we don't want to populate the
uptodate cache with the unlocked block read - it is technically safe as is,
but we should change it for correctness.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Aug 7, 2006
1 parent 9acd72f commit 101ebf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion fs/ocfs2/ocfs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ struct ocfs2_super
struct ocfs2_node_map recovery_map;
struct ocfs2_node_map umount_map;

u32 num_clusters;
u64 root_blkno;
u64 system_dir_blkno;
u64 bitmap_blkno;
Expand Down
8 changes: 6 additions & 2 deletions fs/ocfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,8 +1442,13 @@ static int ocfs2_initialize_super(struct super_block *sb,

osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;

/* We don't have a cluster lock on the bitmap here because
* we're only interested in static information and the extra
* complexity at mount time isn't worht it. Don't pass the
* inode in to the read function though as we don't want it to
* be put in the cache. */
status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
inode);
NULL);
iput(inode);
if (status < 0) {
mlog_errno(status);
Expand All @@ -1452,7 +1457,6 @@ static int ocfs2_initialize_super(struct super_block *sb,

di = (struct ocfs2_dinode *) bitmap_bh->b_data;
osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
brelse(bitmap_bh);
mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
(unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg);
Expand Down

0 comments on commit 101ebf2

Please sign in to comment.