From patchwork Wed Jul 3 05:34:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: majianpeng X-Patchwork-Id: 2815161 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CA80BF4A1 for ; Wed, 3 Jul 2013 05:35:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0EB3720125 for ; Wed, 3 Jul 2013 05:35:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 938BC20123 for ; Wed, 3 Jul 2013 05:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752510Ab3GCFfB (ORCPT ); Wed, 3 Jul 2013 01:35:01 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:50785 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512Ab3GCFfA (ORCPT ); Wed, 3 Jul 2013 01:35:00 -0400 Received: by mail-pa0-f43.google.com with SMTP id hz11so7046115pad.30 for ; Tue, 02 Jul 2013 22:35:00 -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=5UawrAVj8PfBiVygN826AWI07dna7/xMeKfLoRBcY1U=; b=p1xa0+Ejfo/nNHVTqmBG9ZykIdrFzsilvVBqxzarj8qw9AbR1vkIfSI/ivq/G88Oru BGdVeoi89dUVH3UhVHBip9owdI7JN8v9gS/HZXC+hlMteDgGjD+LmSLLqVtyLBSKFmPd v21UdIA7sRv6/+LMrLWfDLNCdhUSQXs4OQaDEV35nF579aeQ6EqOVBf3ClaXHZiLRuPC TjHmJzEC/PZGIe3AW+HqUZgoaJFONcmQyw8wgpAPd/UtsG3Cdjf2l4iwQ70nRyFBX4UO O9GWgnJsqXiuhappR6bhyQgbs4Ocv6LBpYa1YR40hyjj5ejENqXEC3UzQt2iEedHvXcp xQxQ== X-Received: by 10.68.12.130 with SMTP id y2mr32244285pbb.49.1372829700376; Tue, 02 Jul 2013 22:35:00 -0700 (PDT) Received: from majianpeng ([218.242.10.182]) by mx.google.com with ESMTPSA id ve3sm30255681pbc.14.2013.07.02.22.34.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 02 Jul 2013 22:34:59 -0700 (PDT) Date: Wed, 3 Jul 2013 13:34:56 +0800 From: majianpeng To: sage Cc: ceph-devel , linux-kernel Reply-To: majianpeng Subject: [PATCH 1/2] ceph: update atime after read. X-Priority: 3 X-GUID: A90B0E5F-BF2C-4B66-A376-F36717614D61 X-Has-Attach: no X-Mailer: Foxmail 7.0.1.90[en] Mime-Version: 1.0 Message-ID: <201307031334515420104@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=-6.8 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 Now ceph don't update atime after read.So add this function. Signed-off-by: Jianpeng Ma --- fs/ceph/file.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 1.8.1.2 diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 656e169..fa74e6f 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -669,6 +669,15 @@ again: out: dout("aio_read %p %llx.%llx dropping cap refs on %s = %d\n", inode, ceph_vinop(inode), ceph_cap_string(got), (int)ret); + + if (ret > 0) { + int dirty; + spin_lock(&ci->i_ceph_lock); + dirty = __ceph_mark_dirty_caps(ci, CEPH_CAP_FILE_RD); + spin_unlock(&ci->i_ceph_lock); + if (dirty) + __mark_inode_dirty(inode, dirty); + } ceph_put_cap_refs(ci, got); if (checkeof && ret >= 0) {