From patchwork Sat Feb 10 04:44:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10210291 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 8BE6060247 for ; Sat, 10 Feb 2018 04:53:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77F702993E for ; Sat, 10 Feb 2018 04:53:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A3FA299D8; Sat, 10 Feb 2018 04:53:14 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2B4072993E for ; Sat, 10 Feb 2018 04:53:12 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8F2C5222DE126; Fri, 9 Feb 2018 20:47:25 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.88; helo=mga01.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D6A4E21F0DA74 for ; Fri, 9 Feb 2018 20:47:22 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Feb 2018 20:53:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,487,1511856000"; d="scan'208";a="16920006" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga008.fm.intel.com with ESMTP; 09 Feb 2018 20:53:08 -0800 Subject: [ndctl PATCH] ndctl: fallback to sysconf for PAGE_SIZE From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 09 Feb 2018 20:44:03 -0800 Message-ID: <151823784326.20330.6389521335698598896.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP On ARM and PowerPC PAGE_SIZE is not defined. Fall back to sysconf(). Signed-off-by: Dan Williams --- ndctl/ndctl.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h index eb5a9b387b3d..ebd2a41cce46 100644 --- a/ndctl/ndctl.h +++ b/ndctl/ndctl.h @@ -16,6 +16,7 @@ #include #include #include +#include struct nd_cmd_dimm_flags { __u32 status; @@ -210,9 +211,13 @@ enum nd_driver_flags { ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM, }; +#ifdef PAGE_SIZE enum { ND_MIN_NAMESPACE_SIZE = PAGE_SIZE, }; +#else +#define ND_MIN_NAMESPACE_SIZE ((unsigned) sysconf(_SC_PAGESIZE)) +#endif enum ars_masks { ARS_STATUS_MASK = 0x0000FFFF,