From patchwork Mon Feb 2 22:38:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5765001 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5FAFEBF440 for ; Mon, 2 Feb 2015 22:40:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D4B6209EB for ; Mon, 2 Feb 2015 22:40:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A4B4F209EA for ; Mon, 2 Feb 2015 22:40:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965361AbbBBWkj (ORCPT ); Mon, 2 Feb 2015 17:40:39 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:37891 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965185AbbBBWkj (ORCPT ); Mon, 2 Feb 2015 17:40:39 -0500 Received: by mail-pa0-f49.google.com with SMTP id fa1so87961652pad.8 for ; Mon, 02 Feb 2015 14:40:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p+vQAWXMzcYgGcvKJslYindkXFG1dJOKsZpaIZzV8Yg=; b=ZuWRMWGPyISBHl/cwv7jAC4WF2tUkRErkDkgDlT2JH3B3w78DJxSgJBxtCo5n39qZg Sx+JKj6YfB7FWjg7P7qEBu0iRXEuZrASrzLSZshGTqIP9F0Dx5xekmyyHDhNDDDqWMps /HiAKWBIy7xHRTV2MkdEVujVqgtuQ0vg/NM4eY9AI6ny0Crw6383gkPP9lXgP3SfipxO FUmrohqc+gujKhNlWMYuIoI8SOKV9FRHcXdApWD53hyXihZCCwHOTbLSsXxilcnHhm7e x2xp+TgQQSxdgjFKpdit3H6st7YNeYpELXXgVu/4V05+1qbNvym09zqGMLbZEeGBJlpx 8QdQ== X-Gm-Message-State: ALoCoQkldXtMPDvuIFvyI/ovKShZMOkxcscGHSQ45UDtOawtLY/DYmSgtaL20Pu0VvDlw1eN1gf8 X-Received: by 10.68.162.130 with SMTP id ya2mr32248464pbb.113.1422916839010; Mon, 02 Feb 2015 14:40:39 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id bx13sm94656pdb.19.2015.02.02.14.40.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 14:40:38 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v6 29/53] nfs/filelayout: use pnfs_error_mark_layout_for_return Date: Mon, 2 Feb 2015 14:38:43 -0800 Message-Id: <1422916747-86649-30-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> References: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 From: Peng Tao Instead of calling layoutreturn directly, call pnfs_error_mark_layout_for_return to mark layouts for return and let generic code return layout when layout segments are freed. Signed-off-by: Peng Tao Signed-off-by: Tom Haynes Conflicts: fs/nfs/filelayout/filelayout.c --- fs/nfs/filelayout/filelayout.c | 2 +- fs/nfs/pnfs_nfs.c | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index bfa8547..5d2eadc 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -200,7 +200,7 @@ static int filelayout_async_handle_error(struct rpc_task *task, dprintk("%s DS connection error %d\n", __func__, task->tk_status); nfs4_mark_deviceid_unavailable(devid); - set_bit(NFS_LAYOUT_RETURN, &lo->plh_flags); + pnfs_error_mark_layout_for_return(inode, lseg); rpc_wake_up(&tbl->slot_tbl_waitq); /* fall through */ default: diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index c87f664..55bff41 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -18,20 +18,10 @@ #define NFSDBG_FACILITY NFSDBG_PNFS -static void pnfs_generic_fenceme(struct inode *inode, - struct pnfs_layout_hdr *lo) -{ - if (!test_and_clear_bit(NFS_LAYOUT_RETURN, &lo->plh_flags)) - return; - pnfs_return_layout(inode); -} - void pnfs_generic_rw_release(void *data) { struct nfs_pgio_header *hdr = data; - struct pnfs_layout_hdr *lo = hdr->lseg->pls_layout; - pnfs_generic_fenceme(lo->plh_inode, lo); nfs_put_client(hdr->ds_clp); hdr->mds_ops->rpc_release(data); }