From patchwork Fri Nov 1 03:56:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Wang X-Patchwork-Id: 3122951 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 DA3859F3C4 for ; Fri, 1 Nov 2013 03:51:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7DA5F20434 for ; Fri, 1 Nov 2013 03:57:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D0532042C for ; Fri, 1 Nov 2013 03:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751940Ab3KAD5J (ORCPT ); Thu, 31 Oct 2013 23:57:09 -0400 Received: from m59-178.qiye.163.com ([123.58.178.59]:60884 "EHLO m59-178.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492Ab3KAD5I (ORCPT ); Thu, 31 Oct 2013 23:57:08 -0400 Received: from localhost.localdomain (unknown [222.240.177.34]) by m59-178.qiye.163.com (HMail) with ESMTPA id 24C421481280; Fri, 1 Nov 2013 11:57:05 +0800 (CST) From: Li Wang To: ceph-devel@vger.kernel.org Cc: linux-cachefs@redhat.com, Sage Weil , linux-kernel@vger.kernel.org, Li Wang , Min Chen , Yunchuan Wen Subject: [PATCH] ceph: Update the pages in fscache in writepages() path Date: Fri, 1 Nov 2013 11:56:48 +0800 Message-Id: <1383278208-4053-1-git-send-email-liwang@ubuntukylin.com> X-Mailer: git-send-email 1.7.9.5 X-HM-Spam-Status: e1koWUFPN1dZCBgUCR5ZQUpMVUNJQkJCQkJJSExLTUtOTldZCQ4XHghZQV koKz0kKzooKCQyNSQzPjo*PilBS1VLQDYjJCI#KCQyNSQzPjo*PilBS1VLQCsvKSQ1NCQyNSQzPj o*PilBSVVLQDg0LjUvKSIkODVBS1VLQCk#PDI0NSQ6KDI6QUtVS0ArKTQtMjU4PiQzLjU6NUFLVU tAPyI1OjYyOCQyKyQ1NCQyNSQzPjo*PilBS1VLQCk#OjckMiskMjUkKTk3JDI1JDM#Oj8#KUFKSV VLQDYuNy8yJCk4Ky8kPzI9PT4pPjUvJDI1JDM#Oj8#KUFJVUtAMiskLzQ*OiIkODUvJEskSktLQU tVS0AyKyRKJDM0LikkODUvJEskSktLQUtVS0AyKyRKJDYyNS4vPiQ4NS8kSyRKS0FLVUtAMiskSE skNjI1Li8#JDg1LyRLJE5LQUtVS0AyKyROJDYyNS4vPiQ4NS8kSyRKS0FLVUtAKC45JD5BSlVOTk A9NSQoLjkkPjUsNCk*KCQzNzEkSktLSUtKQUtVSUNZBg++ X-HM-Sender-Digest: e1kSHx4VD1lBWUc6MQg6Cjo4LDo4EDorKjhIOj4qOkMwCjFVSlVKSENI SUxDSUlOSEJIVTMWGhIXVRcSDBoVHDsOGQ4VDw4QAhcSFVUYFBZFWVdZDB4ZWUEdGhcIHldZCAFZ QUlKTEo3V1kSC1lBWUlJSVVJT0tVSkxMVUhPWQY+ Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Currently, the pages in fscache only are updated in writepage() path, add the process in writepages(). Signed-off-by: Min Chen Signed-off-by: Li Wang Signed-off-by: Yunchuan Wen --- fs/ceph/addr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 6df8bd4..cc57911 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -746,7 +746,7 @@ retry: while (!done && index <= end) { int num_ops = do_sync ? 2 : 1; - unsigned i; + unsigned i, j; int first; pgoff_t next; int pvec_pages, locked_pages; @@ -894,7 +894,6 @@ get_more_pages: if (!locked_pages) goto release_pvec_pages; if (i) { - int j; BUG_ON(!locked_pages || first < 0); if (pvec_pages && i == pvec_pages && @@ -924,7 +923,10 @@ get_more_pages: osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, !!pool, false); - + for(j = 0; j < locked_pages; j++) { + struct page *page = pages[j]; + ceph_readpage_to_fscache(inode, page); + } pages = NULL; /* request message now owns the pages array */ pool = NULL;