ceph: refactor ceph_write_begin, fix ceph_page_mkwrite

Previous thread: ceph: remove bogus invalidate_mapping_pages by Linux Kernel Mailing List on Friday, March 19, 2010 - 10:00 am. (1 message)

Next thread: ceph: use rbtree for mds requests by Linux Kernel Mailing List on Friday, March 19, 2010 - 10:00 am. (1 message)
From: Linux Kernel Mailing List
Date: Friday, March 19, 2010 - 10:00 am

Gitweb:     http://git.kernel.org/linus/4af6b2257ee0eb8f4bf3b1dc8acb643c0e8a887f
Commit:     4af6b2257ee0eb8f4bf3b1dc8acb643c0e8a887f
Parent:     972f0d3ab1a15cb5d790dd8c53903066084b28f2
Author:     Yehuda Sadeh <yehuda@hq.newdream.net>
AuthorDate: Tue Feb 9 11:02:51 2010 -0800
Committer:  Sage Weil <sage@newdream.net>
CommitDate: Thu Feb 11 11:48:50 2010 -0800

    ceph: refactor ceph_write_begin, fix ceph_page_mkwrite
    
    Originally ceph_page_mkwrite called ceph_write_begin, hoping that
    the returned locked page would be the page that it was requested
    to mkwrite. Factored out relevant part of ceph_page_mkwrite and
    we lock the right page anyway.
    
    Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
    Signed-off-by: Sage Weil <sage@newdream.net>
---
 fs/ceph/addr.c |   80 +++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 51 insertions(+), 29 deletions(-)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 92f4821..89c5ff3 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -907,15 +907,13 @@ static int context_is_writeable_or_written(struct inode *inode,
  * We are only allowed to write into/dirty the page if the page is
  * clean, or already dirty within the same snap context.
  */
-static int ceph_write_begin(struct file *file, struct address_space *mapping,
-			    loff_t pos, unsigned len, unsigned flags,
-			    struct page **pagep, void **fsdata)
+static int ceph_update_writeable_page(struct file *file,
+			    loff_t pos, unsigned len,
+			    struct page *page)
 {
 	struct inode *inode = file->f_dentry->d_inode;
 	struct ceph_inode_info *ci = ceph_inode(inode);
 	struct ceph_mds_client *mdsc = &ceph_inode_to_client(inode)->mdsc;
-	struct page *page;
-	pgoff_t index = pos >> PAGE_CACHE_SHIFT;
 	loff_t page_off = pos & PAGE_CACHE_MASK;
 	int pos_in_page = pos & ~PAGE_CACHE_MASK;
 	int end_in_page = pos_in_page + len;
@@ -923,16 +921,6 @@ static int ceph_write_begin(struct file *file, struct address_space ...
Previous thread: ceph: remove bogus invalidate_mapping_pages by Linux Kernel Mailing List on Friday, March 19, 2010 - 10:00 am. (1 message)

Next thread: ceph: use rbtree for mds requests by Linux Kernel Mailing List on Friday, March 19, 2010 - 10:00 am. (1 message)