Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7557e8f7ff785d6c2b5bc914cd1675314ff0fcf
Commit:     f7557e8f7ff785d6c2b5bc914cd1675314ff0fcf
Parent:     ba9d8cec6c7165e440f9b2413a0464cf3c12fb25
Author:     Vladimir Saveliev <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:25:14 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:42:56 2007 -0700

    reiserfs: use generic_cont_expand_simple
    
    This patch makes reiserfs to use AOP_FLAG_CONT_EXPAND
    in order to get rid of the special generic_cont_expand routine
    
    Signed-off-by: Vladimir Saveliev <[EMAIL PROTECTED]>
    Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/reiserfs/inode.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 21db3a7..95051d4 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2562,13 +2562,20 @@ static int reiserfs_write_begin(struct file *file,
        int ret;
        int old_ref = 0;
 
+       inode = mapping->host;
+       *fsdata = 0;
+       if (flags & AOP_FLAG_CONT_EXPAND &&
+           (pos & (inode->i_sb->s_blocksize - 1)) == 0) {
+               pos ++;
+               *fsdata = (void *)(unsigned long)flags;
+       }
+
        index = pos >> PAGE_CACHE_SHIFT;
        page = __grab_cache_page(mapping, index);
        if (!page)
                return -ENOMEM;
        *pagep = page;
 
-       inode = mapping->host;
        reiserfs_wait_on_write_block(inode->i_sb);
        fix_tail_page_for_writing(page);
        if (reiserfs_transaction_running(inode->i_sb)) {
@@ -2678,6 +2685,8 @@ static int reiserfs_write_end(struct file *file, struct 
address_space *mapping,
        struct reiserfs_transaction_handle *th;
        unsigned start;
 
+       if ((unsigned long)fsdata & AOP_FLAG_CONT_EXPAND)
+               pos ++;
 
        reiserfs_wait_on_write_block(inode->i_sb);
        if (reiserfs_transaction_running(inode->i_sb))
@@ -3065,7 +3074,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr 
*attr)
                }
                /* fill in hole pointers in the expanding truncate case. */
                if (attr->ia_size > inode->i_size) {
-                       error = generic_cont_expand(inode, attr->ia_size);
+                       error = generic_cont_expand_simple(inode, 
attr->ia_size);
                        if (REISERFS_I(inode)->i_prealloc_count > 0) {
                                int err;
                                struct reiserfs_transaction_handle th;
-
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