diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-03-22 19:53:23 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-04-26 18:07:40 -0400 |
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, | |||
285 | 285 | ||
286 | i_size_write(inode, inode->i_sb->s_blocksize); | 286 | i_size_write(inode, inode->i_sb->s_blocksize); |
287 | inode->i_nlink = 2; | 287 | inode->i_nlink = 2; |
288 | inode->i_blocks = ocfs2_align_bytes_to_sectors(inode->i_sb->s_blocksize); | 288 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
289 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); | 289 | status = ocfs2_mark_inode_dirty(handle, inode, fe_bh); |
290 | if (status < 0) { | 290 | if (status < 0) { |
291 | mlog_errno(status); | 291 | mlog_errno(status); |
@@ -1688,7 +1688,7 @@ static int ocfs2_symlink(struct inode *dir, | |||
1688 | goto bail; | 1688 | goto bail; |
1689 | } | 1689 | } |
1690 | i_size_write(inode, newsize); | 1690 | i_size_write(inode, newsize); |
1691 | inode->i_blocks = ocfs2_align_bytes_to_sectors(newsize); | 1691 | inode->i_blocks = ocfs2_inode_sector_count(inode); |
1692 | } else { | 1692 | } else { |
1693 | inode->i_op = &ocfs2_fast_symlink_inode_operations; | 1693 | inode->i_op = &ocfs2_fast_symlink_inode_operations; |
1694 | memcpy((char *) fe->id2.i_symlink, symname, l); | 1694 | memcpy((char *) fe->id2.i_symlink, symname, l); |