From patchwork Wed Jun 19 07:12:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: majianpeng X-Patchwork-Id: 2747391 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 65E049F39E for ; Wed, 19 Jun 2013 07:12:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F0479201F2 for ; Wed, 19 Jun 2013 07:12:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3839201F0 for ; Wed, 19 Jun 2013 07:12:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756426Ab3FSHML (ORCPT ); Wed, 19 Jun 2013 03:12:11 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:50518 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756393Ab3FSHMK (ORCPT ); Wed, 19 Jun 2013 03:12:10 -0400 Received: by mail-pa0-f54.google.com with SMTP id kx10so4831078pab.41 for ; Wed, 19 Jun 2013 00:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:reply-to:subject:x-priority:x-guid:x-has-attach :x-mailer:mime-version:message-id:content-type :content-transfer-encoding; bh=e0FzSC1JNj8etSs1+ZFdlk+o1P2xZl1Oy847abLOZ7M=; b=ed8mZRbTXNEzFsJrNzqMHb0KnXyAR7kxQdiATsSBcL+AbCunj4t5EofS1pOJ6OlD4O XWJSPCeQSFfowrmAJGvEA+WlH0tWJoedvtQHdWWOoCU7+OfhSUhhKtdDo8BJUjOmXeqB Wt9RPaAMY69iDQ/hGeTOp+7NiEDaM1y+OTl8u+3HtgmHhVCOkKkrRrrS1iZk/99BmkWw MDRvOGCb1iE1aDBy6KkmFBZFVAc79ZVZ2gbaKHsH2oc017+f6YrxjK20Wq7m4X+aqwuW lOTjnbmFYPMgAvam1oTrr9/2aFb1eXjhYu+ZxjSGvGUb8H6jApGM6G4LVNMh44JZVpoj tGGg== X-Received: by 10.66.97.46 with SMTP id dx14mr5370896pab.190.1371625929968; Wed, 19 Jun 2013 00:12:09 -0700 (PDT) Received: from majianpeng ([218.242.10.182]) by mx.google.com with ESMTPSA id pl9sm21917983pbc.5.2013.06.19.00.12.04 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 00:12:08 -0700 (PDT) Date: Wed, 19 Jun 2013 15:12:06 +0800 From: majianpeng To: sage Cc: ceph-devel , linux-kernel Reply-To: majianpeng Subject: [PATCH] ceph: avoid meaningless calling ceph_caps_revoking if sync_mode == WB_SYNC_ALL. X-Priority: 3 X-GUID: 7B38E144-81EF-413B-B8C7-D2BD0DC4372A X-Has-Attach: no X-Mailer: Foxmail 7.0.1.90[en] Mime-Version: 1.0 Message-ID: <201306191512024406391@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Signed-off-by: Jianpeng Ma --- fs/ceph/addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.8.3.rc1.44.gb387c77 diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 3e68ac1..25fa8b8 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -677,8 +677,8 @@ static int ceph_writepages_start(struct address_space *mapping, * integrity write (e.g., O_SYNC write or fsync()), or if our * cap is being revoked. */ - do_sync = wbc->sync_mode == WB_SYNC_ALL; - if (ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER)) + if ((wbc->sync_mode == WB_SYNC_ALL) || + ceph_caps_revoking(ci, CEPH_CAP_FILE_BUFFER)) do_sync = 1; dout("writepages_start %p dosync=%d (mode=%s)\n", inode, do_sync,