From patchwork Wed Jul 11 20:30:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1185321 Return-Path: X-Original-To: patchwork-linux-nfs@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 4E3013FC8F for ; Wed, 11 Jul 2012 20:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932361Ab2GKUaZ (ORCPT ); Wed, 11 Jul 2012 16:30:25 -0400 Received: from mail-yw0-f52.google.com ([209.85.213.52]:34087 "EHLO mail-yw0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932350Ab2GKUaZ (ORCPT ); Wed, 11 Jul 2012 16:30:25 -0400 Received: by mail-yw0-f52.google.com with SMTP id p61so1948409yhp.11 for ; Wed, 11 Jul 2012 13:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=hx4fZ2kxohmcptjIIvzIXk7hWotriKcParXdW9YCUcU=; b=wopwYNXX22OppOg2vvCHmJs32ia22K16eihG7dNQcrBRtEtTalzJtI1vvpQVQ1hH4m QE54yvdHIWmedOrkptQ6G5SPteptIOd4UZ10okWlffCOKqWrNplx67/7/uX0bYQN8pH+ M783slDtBsuCHLwTZQUMJRO2OmdsCnwJLjQ7lRQu0hV/EFw+IOMO2n/BRRGXaRDC2HOf pLcRT7nUTNhOprKkCNDoOGibFCFO4YnWPDmc0vDMgelfhFTYLg2r66nwgfp1VE1pmTEl J5z2VVEqt40aMUNO4qlM6blk0FUkJbioYZZQasycrrvm3BM2nRfyytqCzL1YwKxU3B7e FWYw== Received: by 10.50.190.230 with SMTP id gt6mr15482667igc.48.1342038624686; Wed, 11 Jul 2012 13:30:24 -0700 (PDT) Received: from degas.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id f8sm15371348ign.0.2012.07.11.13.30.23 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jul 2012 13:30:24 -0700 (PDT) From: Chuck Lever Subject: [PATCH 05/15] NFS: Clean up TEST_STATEID and FREE_STATEID error reporting To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Date: Wed, 11 Jul 2012 16:30:23 -0400 Message-ID: <20120711203023.3767.32128.stgit@degas.1015granger.net> In-Reply-To: <20120711201718.3767.66867.stgit@degas.1015granger.net> References: <20120711201718.3767.66867.stgit@degas.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org As a finishing touch, add appropriate documenting comments and some debugging printk's. Signed-off-by: Chuck Lever --- fs/nfs/nfs4proc.c | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c4df35b..0d6da38 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6636,13 +6636,28 @@ static int _nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) .rpc_resp = &res, }; + dprintk("NFS call test_stateid %p\n", stateid); nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 1); - if (status != NFS_OK) + if (status != NFS_OK) { + dprintk("NFS reply test_stateid: failed, %d\n", status); return status; + } + dprintk("NFS reply test_stateid: succeeded, %d\n", -res.status); + return -res.status; return -res.status; } +/** + * nfs41_test_stateid - perform a TEST_STATEID operation + * + * @server: server / transport on which to perform the operation + * @stateid: state ID to test + * + * Returns NFS_OK if the server recognizes that "stateid" is valid. + * Otherwise a negative NFS4ERR value is returned if the operation + * failed or the state ID is not currently valid. + */ static int nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) { struct nfs4_exception exception = { }; @@ -6667,12 +6682,25 @@ static int _nfs4_free_stateid(struct nfs_server *server, nfs4_stateid *stateid) .rpc_argp = &args, .rpc_resp = &res, }; + int status; + dprintk("NFS call free_stateid %p\n", stateid); nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); - return nfs4_call_sync_sequence(server->client, server, &msg, + status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 1); + dprintk("NFS reply free_stateid: %d\n", status); + return status; } +/** + * nfs41_free_stateid - perform a FREE_STATEID operation + * + * @server: server / transport on which to perform the operation + * @stateid: state ID to release + * + * Returns NFS_OK if the server freed "stateid". Otherwise a + * negative NFS4ERR value is returned. + */ static int nfs41_free_stateid(struct nfs_server *server, nfs4_stateid *stateid) { struct nfs4_exception exception = { };