From patchwork Fri Feb 22 02:08:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yan, Zheng" X-Patchwork-Id: 2174231 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EEFCA40B0D for ; Fri, 22 Feb 2013 02:08:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754587Ab3BVCI3 (ORCPT ); Thu, 21 Feb 2013 21:08:29 -0500 Received: from mga14.intel.com ([143.182.124.37]:37776 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754654Ab3BVCI1 (ORCPT ); Thu, 21 Feb 2013 21:08:27 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 21 Feb 2013 18:08:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,713,1355126400"; d="scan'208";a="260073817" Received: from zyan5-mobl.sh.intel.com ([10.239.36.43]) by azsmga001.ch.intel.com with ESMTP; 21 Feb 2013 18:08:25 -0800 From: "Yan, Zheng" To: ceph-devel@vger.kernel.org, sage@inktank.com Cc: "Yan, Zheng" Subject: [PATCH 2/3] ceph: queue cap release when trimming cap Date: Fri, 22 Feb 2013 10:08:18 +0800 Message-Id: <1361498899-15831-3-git-send-email-zheng.z.yan@intel.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1361498899-15831-1-git-send-email-zheng.z.yan@intel.com> References: <1361498899-15831-1-git-send-email-zheng.z.yan@intel.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org From: "Yan, Zheng" So the client will later send cap release message to MDS Signed-off-by: Yan, Zheng --- fs/ceph/caps.c | 6 +++--- fs/ceph/mds_client.c | 2 ++ fs/ceph/super.h | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 1e1e020..5d5c32b 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c @@ -997,9 +997,9 @@ static int send_cap_msg(struct ceph_mds_session *session, return 0; } -static void __queue_cap_release(struct ceph_mds_session *session, - u64 ino, u64 cap_id, u32 migrate_seq, - u32 issue_seq) +void __queue_cap_release(struct ceph_mds_session *session, + u64 ino, u64 cap_id, u32 migrate_seq, + u32 issue_seq) { struct ceph_msg *msg; struct ceph_mds_cap_release *head; diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 608ffcf..ccc68b0 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1197,6 +1197,8 @@ static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg) session->s_trim_caps--; if (oissued) { /* we aren't the only cap.. just remove us */ + __queue_cap_release(session, ceph_ino(inode), cap->cap_id, + cap->mseq, cap->issue_seq); __ceph_remove_cap(cap); } else { /* try to drop referring dentries */ diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 66ebe72..e1eb50a 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -755,6 +755,8 @@ static inline void ceph_remove_cap(struct ceph_cap *cap) extern void ceph_put_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap); +extern void __queue_cap_release(struct ceph_mds_session *session, u64 ino, + u64 cap_id, u32 migrate_seq, u32 issue_seq); extern void ceph_queue_caps_release(struct inode *inode); extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc); extern int ceph_fsync(struct file *file, loff_t start, loff_t end,