From patchwork Mon Nov 11 15:27:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 3168081 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D0AE59F68F for ; Mon, 11 Nov 2013 15:42:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD57020124 for ; Mon, 11 Nov 2013 15:42:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8AF542015F for ; Mon, 11 Nov 2013 15:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754601Ab3KKPmV (ORCPT ); Mon, 11 Nov 2013 10:42:21 -0500 Received: from m53-178.qiye.163.com ([123.58.178.53]:52836 "EHLO m53-178.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754262Ab3KKPl0 (ORCPT ); Mon, 11 Nov 2013 10:41:26 -0500 Received: from localhost.localdomain (unknown [121.33.255.10]) by m53-178.qiye.163.com (HMail) with ESMTPA id C961213A8042; Mon, 11 Nov 2013 23:41:23 +0800 (CST) From: Li Wang To: linux-kernel@vger.kernel.org Cc: ceph-devel@vger.kernel.org, Sage Weil , linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, Milosz Tanski , Li Wang Subject: [PATCH 1/7] Fscache: Introduce new API fscache_readpage_cancel() Date: Mon, 11 Nov 2013 23:27:23 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: X-HM-Spam-Status: e1koWUFPN1dZCBgUCR5ZQU5VQ0hLS0tLT0tLTk9ISUpIV1kJDhceCFlBWS grPSQrOigoJDI1JDM#Oj8#KUFLVUtANiMkIj4oJDI1JDM#Oj8#KUFLVUtAKy8pJDU0JDI1JDM#Oj 8#KUFJVUtAODQuNS8pIiQ4NUFLVUtAKT48MjQ1JDooMjpBS1VLQCspNC0yNTg#JDwuOjU8PzQ1PE FLVUtAPyI1OjYyOCQyKyQ1NCQyNSQzPjo*PilBS1VLQDYuNy8yJCk4Ky8kPzI9PT4pPjUvJDI1JD M#Oj8#KUFJVUtAMiskLzQ*OiIkODUvJEskSktLQUtVS0AyKyROJDYyNS4vPiQ4NS8kSyRKS0FLVU tAMiskSEskNjI1Li8#JDg1LyRLJE5LQUtVS0AyKyRKJDM0LikkODUvJEskSktLQUtVS0AyKyRKJD YyNS4vPiQ4NS8kSyRKS0FLVUtAKC45JD5BSlVOTkA9NSQoLjkkPjUsNCk*KCQzNzEkSktLSUtKQU tVSUNZBg++ X-HM-Sender-Digest: e1kSHx4VD1lBWUc6MQg6Cjo4LDo4EDorKjhIOj4qOkMwCjFVSlVKSENP SkNPT0NPSk9PVTMWGhIXVRcSDBoVHDsOGQ4VDw4QAhcSFVUYFBZFWVdZDB4ZWUEdGhcIHldZCAFZ QUlMSUM3V1kSC1lBWUpJSlVISFVJTk5VSktZBg++ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Introduce a new API fscache_readpage_cancel() for uncaching one single no-data page from fscache. Signed-off-by: Li Wang --- include/linux/fscache.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/fscache.h b/include/linux/fscache.h index 115bb81..f1ed21f 100644 --- a/include/linux/fscache.h +++ b/include/linux/fscache.h @@ -245,6 +245,8 @@ extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, gfp_t); extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, struct inode *); +extern void __fscache_readpage_cancel(struct fscache_cookie *cookie, + struct page *page); extern void __fscache_readpages_cancel(struct fscache_cookie *cookie, struct list_head *pages); extern void __fscache_disable_cookie(struct fscache_cookie *, bool); @@ -633,6 +635,15 @@ int fscache_alloc_page(struct fscache_cookie *cookie, return -ENOBUFS; } +static inline +void fscache_readpage_cancel(struct fscache_cookie *cookie, + struct page *page) +{ + if (fscache_cookie_valid(cookie)) + __fscache_readpage_cancel(cookie, page); +} + + /** * fscache_readpages_cancel - Cancel read/alloc on pages * @cookie: The cookie representing the inode's cache object.