Return-Path: Received: from mx2.netapp.com ([216.240.18.37]:57120 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486Ab0IVWFj (ORCPT ); Wed, 22 Sep 2010 18:05:39 -0400 Received: from localhost.localdomain (vikramyadav.hq.netapp.com [10.58.61.118] (may be forged)) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id o8MM5M8M020412 for ; Wed, 22 Sep 2010 15:05:25 -0700 (PDT) From: Fred Isaman To: linux-nfs@vger.kernel.org Subject: [PATCH 02/12] SUNRPC: define xdr_decode_opaque_fixed Date: Wed, 22 Sep 2010 18:05:00 -0400 Message-Id: <1285193110-24073-3-git-send-email-iisaman@netapp.com> In-Reply-To: <1285193110-24073-1-git-send-email-iisaman@netapp.com> References: <1285193110-24073-1-git-send-email-iisaman@netapp.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: Content-Type: text/plain MIME-Version: 1.0 From: Benny Halevy A helper for decoding a fixed length opaque value. Returns a pointer to the next item in the xdr stream. Signed-off-by: Benny Halevy --- include/linux/sunrpc/xdr.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index 35cf2e8..23dc117 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h @@ -131,6 +131,13 @@ xdr_decode_hyper(__be32 *p, __u64 *valp) return p + 2; } +static inline __be32 * +xdr_decode_opaque_fixed(__be32 *p, void *ptr, unsigned int len) +{ + memcpy(ptr, p, len); + return p + XDR_QUADLEN(len); +} + /* * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) */ -- 1.7.2.1