From patchwork Tue Nov 12 19:04:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 3174511 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 088E3C045B for ; Tue, 12 Nov 2013 19:04:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEB06205DD for ; Tue, 12 Nov 2013 19:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D2FC205DC for ; Tue, 12 Nov 2013 19:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754089Ab3KLTET (ORCPT ); Tue, 12 Nov 2013 14:04:19 -0500 Received: from mx11.netapp.com ([216.240.18.76]:3328 "EHLO mx11.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735Ab3KLTET (ORCPT ); Tue, 12 Nov 2013 14:04:19 -0500 X-IronPort-AV: E=Sophos;i="4.93,686,1378882800"; d="scan'208";a="74080388" Received: from vmwexceht01-prd.hq.netapp.com ([10.106.76.239]) by mx11-out.netapp.com with ESMTP; 12 Nov 2013 11:04:19 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCEHT01-PRD.hq.netapp.com (10.106.76.239) with Microsoft SMTP Server id 14.3.123.3; Tue, 12 Nov 2013 11:04:15 -0800 Received: from davros.com ([10.63.227.93]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id rACJ4Asx027523; Tue, 12 Nov 2013 11:04:13 -0800 (PST) From: Anna Schumaker To: , Subject: [PATCH v2 2/3] NFSD: Create nfs v4.2 decode ops Date: Tue, 12 Nov 2013 14:04:07 -0500 Message-ID: <1384283048-7699-3-git-send-email-bjschuma@netapp.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1384283048-7699-1-git-send-email-bjschuma@netapp.com> References: <1384283048-7699-1-git-send-email-bjschuma@netapp.com> MIME-Version: 1.0 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, 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 It's cleaner to introduce everything at once and have the server reply with "not supported" than it would be to introduce extra operations when implementing a specific one in the middle of the list. Signed-off-by: Anna Schumaker --- fs/nfsd/nfs4xdr.c | 22 ++++++++++++++++++++++ include/linux/nfs4.h | 15 +++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 83db5a7..3af6c46 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -1580,6 +1580,17 @@ static nfsd4_dec nfsd4_dec_ops[] = { [OP_WANT_DELEGATION] = (nfsd4_dec)nfsd4_decode_notsupp, [OP_DESTROY_CLIENTID] = (nfsd4_dec)nfsd4_decode_destroy_clientid, [OP_RECLAIM_COMPLETE] = (nfsd4_dec)nfsd4_decode_reclaim_complete, + + /* new operations for NFSv4.2 */ + [OP_COPY] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_OFFLOAD_ABORT] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_COPY_NOTIFY] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_OFFLOAD_REVOKE] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_OFFLOAD_STATUS] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_WRITE_PLUS] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_READ_PLUS] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_SEEK] = (nfsd4_dec)nfsd4_decode_notsupp, + [OP_IO_ADVISE] = (nfsd4_dec)nfsd4_decode_notsupp, }; static inline bool @@ -3575,6 +3586,17 @@ static nfsd4_enc nfsd4_enc_ops[] = { [OP_WANT_DELEGATION] = (nfsd4_enc)nfsd4_encode_noop, [OP_DESTROY_CLIENTID] = (nfsd4_enc)nfsd4_encode_noop, [OP_RECLAIM_COMPLETE] = (nfsd4_enc)nfsd4_encode_noop, + + /* NFSv4.2 operations */ + [OP_COPY] = (nfsd4_enc)nfsd4_encode_noop, + [OP_OFFLOAD_ABORT] = (nfsd4_enc)nfsd4_encode_noop, + [OP_COPY_NOTIFY] = (nfsd4_enc)nfsd4_encode_noop, + [OP_OFFLOAD_REVOKE] = (nfsd4_enc)nfsd4_encode_noop, + [OP_OFFLOAD_STATUS] = (nfsd4_enc)nfsd4_encode_noop, + [OP_WRITE_PLUS] = (nfsd4_enc)nfsd4_encode_noop, + [OP_READ_PLUS] = (nfsd4_enc)nfsd4_encode_noop, + [OP_SEEK] = (nfsd4_enc)nfsd4_encode_noop, + [OP_IO_ADVISE] = (nfsd4_enc)nfsd4_encode_noop, }; /* diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 6d79deb..01119ed 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -110,6 +110,17 @@ enum nfs_opnum4 { OP_DESTROY_CLIENTID = 57, OP_RECLAIM_COMPLETE = 58, + /* nfs42 */ + OP_COPY = 59, + OP_OFFLOAD_ABORT = 60, + OP_COPY_NOTIFY = 61, + OP_OFFLOAD_REVOKE = 62, + OP_OFFLOAD_STATUS = 63, + OP_WRITE_PLUS = 64, + OP_READ_PLUS = 65, + OP_SEEK = 66, + OP_IO_ADVISE = 67, + OP_ILLEGAL = 10044, }; @@ -117,10 +128,10 @@ enum nfs_opnum4 { Needs to be updated if more operations are defined in future.*/ #define FIRST_NFS4_OP OP_ACCESS -#define LAST_NFS4_OP OP_RECLAIM_COMPLETE +#define LAST_NFS4_OP OP_IO_ADVISE #define LAST_NFS40_OP OP_RELEASE_LOCKOWNER #define LAST_NFS41_OP OP_RECLAIM_COMPLETE -#define LAST_NFS42_OP OP_RECLAIM_COMPLETE +#define LAST_NFS42_OP OP_IO_ADVISE enum nfsstat4 { NFS4_OK = 0,