From patchwork Wed Jun 15 16:52:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew W Elble X-Patchwork-Id: 9178973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9CF2560776 for ; Wed, 15 Jun 2016 16:59:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E54A27D5D for ; Wed, 15 Jun 2016 16:59:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8331E27E5A; Wed, 15 Jun 2016 16:59:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2EBA27DF9 for ; Wed, 15 Jun 2016 16:59:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932849AbcFOQ66 (ORCPT ); Wed, 15 Jun 2016 12:58:58 -0400 Received: from discipline.rit.edu ([129.21.6.207]:19650 "HELO discipline.rit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S932772AbcFOQ65 (ORCPT ); Wed, 15 Jun 2016 12:58:57 -0400 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Jun 2016 12:58:56 EDT Received: (qmail 7474 invoked by uid 501); 15 Jun 2016 16:52:16 -0000 From: Andrew Elble To: linux-nfs@vger.kernel.org, bfields@fieldses.org Cc: Andrew Elble Subject: [PATCH v3 1/3] nfs/nfsd: Move useful bitfield ops to a commonly accessible place Date: Wed, 15 Jun 2016 12:52:07 -0400 Message-Id: <1466009529-3421-2-git-send-email-aweits@rit.edu> X-Mailer: git-send-email 2.6.3 In-Reply-To: <1466009529-3421-1-git-send-email-aweits@rit.edu> References: <1466009529-3421-1-git-send-email-aweits@rit.edu> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP So these may be used in nfsd as well Signed-off-by: Andrew Elble --- include/linux/nfs4.h | 11 +++++++++++ include/linux/nfs_xdr.h | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index bfed6b367350..c6564ada9beb 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -643,4 +643,15 @@ enum pnfs_update_layout_reason { PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET, }; +#define NFS4_OP_MAP_NUM_LONGS \ + DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long)) +#define NFS4_OP_MAP_NUM_WORDS \ + (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32)) +struct nfs4_op_map { + union { + unsigned long longs[NFS4_OP_MAP_NUM_LONGS]; + u32 words[NFS4_OP_MAP_NUM_WORDS]; + } u; +}; + #endif diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c304a11b5b1a..e66abc2d1f88 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1185,17 +1185,6 @@ struct pnfs_ds_commit_info { struct pnfs_commit_bucket *buckets; }; -#define NFS4_OP_MAP_NUM_LONGS \ - DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long)) -#define NFS4_OP_MAP_NUM_WORDS \ - (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32)) -struct nfs4_op_map { - union { - unsigned long longs[NFS4_OP_MAP_NUM_LONGS]; - u32 words[NFS4_OP_MAP_NUM_WORDS]; - } u; -}; - struct nfs41_state_protection { u32 how; struct nfs4_op_map enforce;