From patchwork Sat Jan 29 19:26:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 516871 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0TJRA1p020201 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 29 Jan 2011 19:27:31 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1PjGRh-00086f-UY; Sat, 29 Jan 2011 19:26:53 +0000 Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.74) (envelope-from ) id 1PjGRh-00086V-2b for v9fs-developer@lists.sourceforge.net; Sat, 29 Jan 2011 19:26:53 +0000 X-ACL-Warn: Received: from e23smtp07.au.ibm.com ([202.81.31.140]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.74) id 1PjGRd-00030U-MI for v9fs-developer@lists.sourceforge.net; Sat, 29 Jan 2011 19:26:53 +0000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [202.81.31.245]) by e23smtp07.au.ibm.com (8.14.4/8.13.1) with ESMTP id p0TJQgCL003155 for ; Sun, 30 Jan 2011 06:26:42 +1100 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0TJQgnJ2519142 for ; Sun, 30 Jan 2011 06:26:42 +1100 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0TJQgON004889 for ; Sun, 30 Jan 2011 06:26:42 +1100 Received: from skywalker.in.ibm.com ([9.77.192.95]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0TJQWTC004824; Sun, 30 Jan 2011 06:26:40 +1100 From: "Aneesh Kumar K.V" To: v9fs-developer@lists.sourceforge.net Date: Sun, 30 Jan 2011 00:56:23 +0530 Message-Id: <1296329186-23807-5-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1296329186-23807-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1296329186-23807-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1PjGRd-00030U-MI Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [V9fs-developer] [RFC PATCH -V1 4/7] fs/9p: [fscache] wait for page write in cached mode X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 29 Jan 2011 19:27:31 +0000 (UTC) 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; }