diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-03-22 16:53:23 -0700 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-04-26 15:07:40 -0700 |
commit | 8110b073a9135acf0a71bccfc20c0d1023f179c6 (patch) | |
tree | b668738e25648f3fcfd7b1063ab8d4948cebc668 /fs/ocfs2/namei.c | |
parent | 4f902c37727bbedbc0508a1477874c58ddcc9af8 (diff) |
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>
Diffstat (limited to 'fs/ocfs2/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 9bdbe4ae92f8..2bcf353fd7c5 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -285,7 +285,7 @@ static int ocfs2_fill_new_dir(struct ocfs2_super *osb, i_size_write(inode, inode->i_sb->s_blocksize); inode->i_nlink = 2; - inode->i_blocks = ocfs2_align_bytes_to_sectors(inode->i_sb->s_blocksize); + inode->i_blocks = ocfs2_inode_sector_count(inode); status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); if (status < 0) { mlog_errno(status); @@ -1688,7 +1688,7 @@ static int ocfs2_symlink(struct inode *dir, goto bail; } i_size_write(inode, newsize); - inode->i_blocks = ocfs2_align_bytes_to_sectors(newsize); + inode->i_blocks = ocfs2_inode_sector_count(inode); } else { inode->i_op = &ocfs2_fast_symlink_inode_operations; memcpy((char *) fe->id2.i_symlink, symname, l); |