Skip to content

Commit

Permalink
ocfs2: Use do_sync_mapping_range() in ocfs2_zero_tail_for_truncate()
Browse files Browse the repository at this point in the history
Do this instead of filemap_fdatawrite() - this way we sync only the
range between i_size and the cluster boundary.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
  • Loading branch information
Mark Fasheh committed Apr 26, 2007
1 parent 5b04aa3 commit fa41045
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/ocfs2/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3517,6 +3517,7 @@ int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle,
u64 new_i_size)
{
int ret, numpages;
loff_t endbyte;
struct page **pages = NULL;
u64 phys;

Expand Down Expand Up @@ -3555,7 +3556,9 @@ int ocfs2_zero_tail_for_truncate(struct inode *inode, handle_t *handle,
* wait on them - the truncate_inode_pages() call later will
* do that for us.
*/
ret = filemap_fdatawrite(inode->i_mapping);
endbyte = ocfs2_align_bytes_to_clusters(inode->i_sb, new_i_size);
ret = do_sync_mapping_range(inode->i_mapping, new_i_size,
endbyte - 1, SYNC_FILE_RANGE_WRITE);
if (ret)
mlog_errno(ret);

Expand Down

0 comments on commit fa41045

Please sign in to comment.