From patchwork Mon Aug 31 19:49:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 7101301 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 A309FBEEC1 for ; Mon, 31 Aug 2015 19:50:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B530120553 for ; Mon, 31 Aug 2015 19:50:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B984920555 for ; Mon, 31 Aug 2015 19:50:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752309AbbHaTuZ (ORCPT ); Mon, 31 Aug 2015 15:50:25 -0400 Received: from mx144.netapp.com ([216.240.21.25]:13094 "EHLO mx144.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbbHaTuY (ORCPT ); Mon, 31 Aug 2015 15:50:24 -0400 X-IronPort-AV: E=Sophos;i="5.17,443,1437462000"; d="scan'208";a="65419813" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx144-out.netapp.com with ESMTP; 31 Aug 2015 12:50:24 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server id 15.0.1076.9; Mon, 31 Aug 2015 12:50:24 -0700 Received: from rhel7-1-snap3-3.localdomain (dros-16.vpn.netapp.com [10.55.66.171]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id t7VJoJHs019457; Mon, 31 Aug 2015 12:50:23 -0700 (PDT) From: To: CC: , , , Olga Kornievskaia Subject: [PATCH 04/16] NFS COPY xdr changes Date: Mon, 31 Aug 2015 15:49:54 -0400 Message-ID: <1441050606-40897-5-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1441050606-40897-1-git-send-email-andros@netapp.com> References: <1441050606-40897-1-git-send-email-andros@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, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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: Olga Kornievskaia add support for decoding NFS4ERR_OFFLOAD_NO_REQS status and corresponding copy_requirements structure. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42xdr.c | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 489bbf3..ae260d3 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c @@ -290,19 +290,9 @@ out_overflow: print_overflow_msg(__func__, xdr); return -EIO; } - -static int decode_copy(struct xdr_stream *xdr, struct nfs42_copy_res *res) -{ +static int decode_copy_requirements(struct xdr_stream *xdr, + struct nfs42_copy_res *res) { __be32 *p; - int status; - - status = decode_op_hdr(xdr, OP_COPY); - if (status) - return status; - - status = decode_write_response(xdr, &res->write_res); - if (status) - return status; p = xdr_inline_decode(xdr, 4 + 4); if (unlikely(!p)) @@ -311,12 +301,31 @@ static int decode_copy(struct xdr_stream *xdr, struct nfs42_copy_res *res) res->consecutive = be32_to_cpup(p++); res->synchronous = be32_to_cpup(p++); return 0; - out_overflow: print_overflow_msg(__func__, xdr); return -EIO; } +static int decode_copy(struct xdr_stream *xdr, struct nfs42_copy_res *res) +{ + int status; + + status = decode_op_hdr(xdr, OP_COPY); + if (status == NFS4ERR_OFFLOAD_NO_REQS) { + status = decode_copy_requirements(xdr, res); + if (status) + return status; + return NFS4ERR_OFFLOAD_NO_REQS; + } else if (status) + return status; + + status = decode_write_response(xdr, &res->write_res); + if (status) + return status; + + return decode_copy_requirements(xdr, res); +} + static int decode_deallocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) { return decode_op_hdr(xdr, OP_DEALLOCATE);