From patchwork Fri Mar 29 21:24:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2366751 Return-Path: X-Original-To: patchwork-ceph-devel@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 039293FD40 for ; Fri, 29 Mar 2013 21:24:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756839Ab3C2VYS (ORCPT ); Fri, 29 Mar 2013 17:24:18 -0400 Received: from mail-ie0-f176.google.com ([209.85.223.176]:39137 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756793Ab3C2VYR (ORCPT ); Fri, 29 Mar 2013 17:24:17 -0400 Received: by mail-ie0-f176.google.com with SMTP id x14so934832ief.35 for ; Fri, 29 Mar 2013 14:24:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=gTGbUseUv+Bfo8Q1AS19LJaskYOeFqVWlQM6hNx7z04=; b=L0jPguyo66BoUDMBBFcukw/94mLnNxtqwP1Q42XNq3SVKN4OlnGaw9xXreyA4cd3li MCd3GYh9tSgKKNSE9oekqKoIFiLJakrIyDgw8bHop5CU15MAx2NAgXC+zLcLQAWzpmWI OPg4XCCLrz57GKAilSl//YFS1T0YRx7t7GYtxsoC4hAkge9VnG9T0PFLOSNct4ixjg4f sN1wCAUTEOL6/1zvMrEdFECfOxNSjwfpRXrZLgHZfoH5fPGM2upeZmWSgJser4w9kxYi t0zS2prVrhuznWFkjeE8wCfO8oRMJDCFMUwMzsKoMj9XAs1ZIt0t4f+/khSwXZuBGVFd 08IA== X-Received: by 10.50.53.176 with SMTP id c16mr134357igp.36.1364592256977; Fri, 29 Mar 2013 14:24:16 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id y5sm280146igg.7.2013.03.29.14.24.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Mar 2013 14:24:16 -0700 (PDT) Message-ID: <5156067F.7070404@inktank.com> Date: Fri, 29 Mar 2013 16:24:15 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: "ceph-devel@vger.kernel.org" Subject: [PATCH] ceph: move max constant definitions X-Gm-Message-State: ALoCoQkGC5iUqfy72/C+8e8RjSYqXJ0bAOTB4ZUwYTBLPgiPwJCkVF8Ytmlk/FQGT/E5j9Oy0jco Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Move some definitions for max integer values out of the rbd code and into the more central "decode.h" header file. These really belong in a Linux (or libc) header somewhere, but I haven't gotten around to proposing that yet. This is in preparation for moving some code out of rbd.c and into the osd client. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 7 ------- include/linux/ceph/decode.h | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d54a045..9c97204 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -52,13 +52,6 @@ #define SECTOR_SHIFT 9 #define SECTOR_SIZE (1ULL << SECTOR_SHIFT) -/* It might be useful to have these defined elsewhere */ - -#define U8_MAX ((u8) (~0U)) -#define U16_MAX ((u16) (~0U)) -#define U32_MAX ((u32) (~0U)) -#define U64_MAX ((u64) (~0ULL)) - #define RBD_DRV_NAME "rbd" #define RBD_DRV_NAME_LONG "rbd (rados block device)" diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h index 360d9d0..689f1df 100644 --- a/include/linux/ceph/decode.h +++ b/include/linux/ceph/decode.h @@ -8,6 +8,13 @@ #include +/* This seemed to be the easiest place to define these */ + +#define U8_MAX ((u8) (~0U)) +#define U16_MAX ((u16) (~0U)) +#define U32_MAX ((u32) (~0U)) +#define U64_MAX ((u64) (~0ULL)) + /* * in all cases, * void **p pointer to position pointer