ocfs2: Fix up i_blocks calculation to know about holes

Older file systems which didn't support holes did a dumb calculation of
i_blocks based on i_size. This is no longer accurate, so fix things up to
take actual allocation into account.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
This commit is contained in:
Mark Fasheh
2007-03-22 16:53:23 -07:00
parent 4f902c3772
commit 8110b073a9
9 changed files with 25 additions and 30 deletions

View File

@ -381,8 +381,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
le32_to_cpu(fe->i_clusters)));
spin_unlock(&OCFS2_I(alloc_inode)->ip_lock);
i_size_write(alloc_inode, le64_to_cpu(fe->i_size));
alloc_inode->i_blocks =
ocfs2_align_bytes_to_sectors(i_size_read(alloc_inode));
alloc_inode->i_blocks = ocfs2_inode_sector_count(alloc_inode);
status = 0;
bail: