From patchwork Wed Jan 14 16:44:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5633371 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 49DD49F357 for ; Wed, 14 Jan 2015 16:46:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DB5E200D4 for ; Wed, 14 Jan 2015 16:46:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E7FB200F4 for ; Wed, 14 Jan 2015 16:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753893AbbANQpv (ORCPT ); Wed, 14 Jan 2015 11:45:51 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:53739 "EHLO mail-pd0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861AbbANQpr (ORCPT ); Wed, 14 Jan 2015 11:45:47 -0500 Received: by mail-pd0-f180.google.com with SMTP id fl12so10699626pdb.11 for ; Wed, 14 Jan 2015 08:45:47 -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=94fIPm2s5BVydJeVrMEk2y/44Hm5pzB//6ArKEBZ3iw=; b=G7eOW4OVjh7qkSFZgoI8oOkla8CZf/j3SMllJ2c/C3EFkY9CKxAQ5rHcbi1bD+vWaU XkSdCqZCFtugT1ngNk+g7mG7rmnKGBkxXFnVy/NBOxhQAGG5Tds5D6PR9bDX0jIz/XGN giyRuLIyTHadoAxuRcR8HQi3bdSUZfxOjraZ97kqbEPIBajHhe4mtIVrgGg4errJNOrV 2NSQGgWwfHoq/j9lK6ySoBoRSzQiqZyK5eeOi9YR0BnkUpi/XJj9Oa6C698x+fzsg9dR w803eTWtHKZ2BYZY++8Y3964l4/3xms/2ws8lqCIZm2xSexX/R5iNoFal2RVM3KchaL7 0opQ== X-Gm-Message-State: ALoCoQndyMRkPxJresTA0fJTCn/Y3T7shHbugJU95dFkkPKl9iuyv9RdeixGWRjUarTaEZo7tFV3 X-Received: by 10.66.66.135 with SMTP id f7mr6954070pat.93.1421253947332; Wed, 14 Jan 2015 08:45:47 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id u7sm12239039pdp.45.2015.01.14.08.45.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jan 2015 08:45:46 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v4 29/50] nfs/filelayout: use pnfs_error_mark_layout_for_return Date: Wed, 14 Jan 2015 08:44:35 -0800 Message-Id: <1421253896-73106-30-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1421253896-73106-1-git-send-email-loghyr@primarydata.com> References: <1421253896-73106-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 e6a4587..9822e86 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -17,20 +17,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); }