Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa41045fcbf78269991d5aebb1820fc51534f05d
Commit:     fa41045fcbf78269991d5aebb1820fc51534f05d
Parent:     5b04aa3a64f854244bc40a6f528176ed50b5c4f6
Author:     Mark Fasheh <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 1 11:22:19 2007 -0800
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 15:02:30 2007 -0700

    ocfs2: Use do_sync_mapping_range() in ocfs2_zero_tail_for_truncate()
    
    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 <[EMAIL PROTECTED]>
---
 fs/ocfs2/alloc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
index 98694a1..027cf5d 100644
--- a/fs/ocfs2/alloc.c
+++ b/fs/ocfs2/alloc.c
@@ -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;
 
@@ -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);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to