Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fb53b3094888be0cf8ddf052277654268904bdf5
Commit:     fb53b3094888be0cf8ddf052277654268904bdf5
Parent:     4899f9c852564ce7b6d0ca932ac6674bf471fd28
Author:     Nick Piggin <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:25:16 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:42:57 2007 -0700

    smbfs: convert to new aops
    
    Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/smbfs/file.c |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/fs/smbfs/file.c b/fs/smbfs/file.c
index c5d78a7..f5d14ce 100644
--- a/fs/smbfs/file.c
+++ b/fs/smbfs/file.c
@@ -292,29 +292,45 @@ out:
  * If the writer ends up delaying the write, the writer needs to
  * increment the page use counts until he is done with the page.
  */
-static int smb_prepare_write(struct file *file, struct page *page, 
-                            unsigned offset, unsigned to)
+static int smb_write_begin(struct file *file, struct address_space *mapping,
+                       loff_t pos, unsigned len, unsigned flags,
+                       struct page **pagep, void **fsdata)
 {
+       pgoff_t index = pos >> PAGE_CACHE_SHIFT;
+       *pagep = __grab_cache_page(mapping, index);
+       if (!*pagep)
+               return -ENOMEM;
        return 0;
 }
 
-static int smb_commit_write(struct file *file, struct page *page,
-                           unsigned offset, unsigned to)
+static int smb_write_end(struct file *file, struct address_space *mapping,
+                       loff_t pos, unsigned len, unsigned copied,
+                       struct page *page, void *fsdata)
 {
        int status;
+       unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
 
-       status = -EFAULT;
        lock_kernel();
-       status = smb_updatepage(file, page, offset, to-offset);
+       status = smb_updatepage(file, page, offset, copied);
        unlock_kernel();
+
+       if (!status) {
+               if (!PageUptodate(page) && copied == PAGE_CACHE_SIZE)
+                       SetPageUptodate(page);
+               status = copied;
+       }
+
+       unlock_page(page);
+       page_cache_release(page);
+
        return status;
 }
 
 const struct address_space_operations smb_file_aops = {
        .readpage = smb_readpage,
        .writepage = smb_writepage,
-       .prepare_write = smb_prepare_write,
-       .commit_write = smb_commit_write
+       .write_begin = smb_write_begin,
+       .write_end = smb_write_end,
 };
 
 /* 
-
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