linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: v9fs-developer@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: [RFC PATCH -V1 4/7] fs/9p: [fscache] wait for page write in cached mode
Date: Sun, 30 Jan 2011 00:56:23 +0530	[thread overview]
Message-ID: <1296329186-23807-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)
In-Reply-To: <1296329186-23807-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>

We need to call fscache_wait_on_page_write in launder_page
for fscache

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 fs/9p/cache.c    |   11 +++++++++++
 fs/9p/cache.h    |   12 ++++++++++++
 fs/9p/vfs_addr.c |    1 +
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/fs/9p/cache.c b/fs/9p/cache.c
index 0dbe0d1..610913d 100644
--- a/fs/9p/cache.c
+++ b/fs/9p/cache.c
@@ -461,3 +461,14 @@ void __v9fs_readpage_to_fscache(struct inode *inode, struct page *page)
 	if (ret != 0)
 		v9fs_uncache_page(inode, page);
 }
+
+/*
+ * wait for a page to complete writing to the cache
+ */
+void __v9fs_fscache_wait_on_page_write(struct inode *inode, struct page *page)
+{
+	const struct v9fs_cookie *vcookie = v9fs_inode2cookie(inode);
+	P9_DPRINTK(P9_DEBUG_FSC, "inode %p page %p", inode, page);
+	if (PageFsCache(page))
+		fscache_wait_on_page_write(vcookie->fscache, page);
+}
diff --git a/fs/9p/cache.h b/fs/9p/cache.h
index a94192b..46fc228 100644
--- a/fs/9p/cache.h
+++ b/fs/9p/cache.h
@@ -131,6 +131,12 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
 	spin_unlock(&vcookie->lock);
 }
 
+static inline void v9fs_fscache_wait_on_page_write(struct inode *inode,
+						   struct page *page)
+{
+	return __v9fs_fscache_wait_on_page_write(inode, page);
+}
+
 #else /* CONFIG_9P_FSCACHE */
 
 static inline int v9fs_cache_register(void)
@@ -172,5 +178,11 @@ static inline void v9fs_vcookie_set_qid(struct inode *inode,
 					struct p9_qid *qid)
 {}
 
+static inline void v9fs_fscache_wait_on_page_write(struct inode *inode,
+						   struct page *page)
+{
+	return;
+}
+
 #endif /* CONFIG_9P_FSCACHE */
 #endif /* _9P_CACHE_H */
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c
index b7f2a8e..005024c 100644
--- a/fs/9p/vfs_addr.c
+++ b/fs/9p/vfs_addr.c
@@ -151,6 +151,7 @@ static void v9fs_invalidate_page(struct page *page, unsigned long offset)
 
 static int v9fs_launder_page(struct page *page)
 {
+	v9fs_fscache_wait_on_page_write(inode, page);
 	return 0;
 }
 
-- 
1.7.1

  parent reply	other threads:[~2011-01-29 19:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-29 19:26 [RFC PATCH -V1 0/7] Buffered write and writeable mmap support for 9P Aneesh Kumar K.V
2011-01-29 19:26 ` [RFC PATCH -V1 1/7] fs/9p: set the cached file_operations struct during inode init Aneesh Kumar K.V
2011-01-29 19:26 ` [RFC PATCH -V1 2/7] fs/9p: set fs cache cookie in create path also Aneesh Kumar K.V
2011-01-29 19:26 ` [RFC PATCH -V1 3/7] fs/9p: increment inode->i_count in cached mode Aneesh Kumar K.V
2011-01-29 19:26 ` Aneesh Kumar K.V [this message]
2011-01-29 19:26 ` [RFC PATCH -V1 5/7] fs/9p: Add read write helper function Aneesh Kumar K.V
2011-01-29 19:26 ` [RFC PATCH -V1 6/7] fs/9p: Add fid to inode in cached mode Aneesh Kumar K.V
2011-01-29 19:26 ` [RFC PATCH -V1 7/7] fs/9p: Add buffered write support for v9fs. We can now support writeable mmaps Aneesh Kumar K.V
2011-01-31  9:38 ` [RFC PATCH -V1 0/7] Buffered write and writeable mmap support for 9P Miklos Szeredi
2011-01-31 18:41   ` Aneesh Kumar K. V

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296329186-23807-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).