From patchwork Tue Nov 3 19:46:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7546551 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3C71A9F2F7 for ; Tue, 3 Nov 2015 19:48:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 518BF206F1 for ; Tue, 3 Nov 2015 19:48:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B845206D5 for ; Tue, 3 Nov 2015 19:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932494AbbKCTsS (ORCPT ); Tue, 3 Nov 2015 14:48:18 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:36652 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932556AbbKCTrA (ORCPT ); Tue, 3 Nov 2015 14:47:00 -0500 Received: by pacdm15 with SMTP id dm15so2822902pac.3 for ; Tue, 03 Nov 2015 11:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt_com.20150623.gappssmtp.com; s=20150623; h=from:to:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:subject :date:message-id:in-reply-to:references; bh=80MF7wfaIrcIdg9U4xgrmdsW1+ReRxEoGq41r4ipWiM=; b=U0SrUyIKjpMrs4VFtna3f3Y4Hs8nnaX2bkBQKS/B2dP6gxd9QO3VRvNScvDhmBVxji KUFS2huIE1V2neRnZGk66dlQhWN2pMforKVpqPNKhxkDwZCOVTH+rxeqzKFNVogXzCu8 vNOZa1YXxBvIUEdBC7A5K+GXFSI4+YYFQe5VqQTnLXlEy1MIOCsJDT6N5rcJT+rjsA2q qcpk1tBSwtGR+2geQxzn0EqL7AGdfu4yEDAhvZiSksKtJ2XWqBuDG4eSoOTCIMMFNyS7 Ilt47VO/djK/ZjPC1QKwtWjuhhXSvRG+SYIntQhTkiyUkwVnnflG8VpGqoYbMBYOKbXH rZNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:to:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc:cc :cc:cc:cc:cc:subject:date:message-id:in-reply-to:references; bh=80MF7wfaIrcIdg9U4xgrmdsW1+ReRxEoGq41r4ipWiM=; b=XNW4HUDJ2sGKECVWD2/FLStQ7u99mRIVABZdMr0VvTAksox0PihdZI+otYHoRUOmGX +u7tocRwS2xpXaz8V6wUtoEeMU/BPImCKGpnetmJZxU5OyWfm/9OWrtQokjwK9kF2jlw JztAS0b0kZXAZ8MSS2lxuQqjwvaHkw77Av4x2bTv4gUR5whncSIYQDwweSY5oaH03Cde rQZf5yvO7gqY1rRMy/3/XRrZHhlg/VCcG2GIO8UwMTTTHvdDppfozuS4Hs7qFCAcVvbv 2/TnGzIbeHbDLYZp+GjWT5bg9Qx5L4Dj2p/xozXDzCZ6oDShseQHsCI5fv4WKr8GQaCX xWCg== X-Gm-Message-State: ALoCoQkOBUP5Jrz5NlsfgBcpb1fQi1AsRO3G4sUkGqD9NDMlFSjQX2r1hDtQxkX/HiRY2EFTNYny X-Received: by 10.68.217.194 with SMTP id pa2mr35764883pbc.105.1446580019593; Tue, 03 Nov 2015 11:46:59 -0800 (PST) Received: from localhost (dhcp-39-103.EECS.Berkeley.EDU. [128.32.39.103]) by smtp.gmail.com with ESMTPSA id ce3sm30960607pbb.35.2015.11.03.11.46.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 11:46:58 -0800 (PST) From: Palmer Dabbelt To: arnd@arndb.de To: dhowells@redhat.com Cc: viro@zeniv.linux.org.uk Cc: ast@plumgrid.com Cc: aishchuk@linux.vnet.ibm.com Cc: aarcange@redhat.com Cc: akpm@linux-foundation.org Cc: luto@kernel.org Cc: acme@kernel.org Cc: bhe@redhat.com Cc: 3chas3@gmail.com Cc: chris@zankel.net Cc: dave@sr71.net Cc: dyoung@redhat.com Cc: drysdale@google.com Cc: davem@davemloft.net Cc: ebiederm@xmission.com Cc: geoff@infradead.org Cc: gregkh@linuxfoundation.org Cc: hpa@zytor.com Cc: mingo@kernel.org Cc: iulia.manda21@gmail.com Cc: plagnioj@jcrosoft.com Cc: jikos@kernel.org Cc: josh@joshtriplett.org Cc: kexec@lists.infradead.org Cc: linux-api@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-xtensa@linux-xtensa.org Cc: mathieu.desnoyers@efficios.com Cc: jcmvbkbc@gmail.com Cc: paulmck@linux.vnet.ibm.com Cc: a.p.zijlstra@chello.nl Cc: tglx@linutronix.de Cc: tomi.valkeinen@ti.com Cc: vgoyal@redhat.com Cc: x86@kernel.org Cc: Palmer Dabbelt Subject: [PATCH 11/13] Always define MAX_RAW_MINORS as 2**20 in userspace Date: Tue, 3 Nov 2015 11:46:32 -0800 Message-Id: <1446579994-9937-12-git-send-email-palmer@dabbelt.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1446579994-9937-1-git-send-email-palmer@dabbelt.com> References: <1442271047-4908-1-git-send-email-palmer@dabbelt.com> <1446579994-9937-1-git-send-email-palmer@dabbelt.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,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 While I don't think this was ever meant to be exposed to userspace, if anyone is using it then this will at least provide a correct (if unlikely) definition. MAX_RAW_MINORS used to be used in the kernel, where it's been replaced with CONFIG_MAX_RAW_MINORS. Note that there's a checkpatch.pl warning about a split config string here, but I've left that alone. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou --- drivers/char/raw.c | 7 ++++--- include/uapi/linux/raw.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/char/raw.c b/drivers/char/raw.c index 60316fb..362d7a6 100644 --- a/drivers/char/raw.c +++ b/drivers/char/raw.c @@ -36,7 +36,7 @@ static struct raw_device_data *raw_devices; static DEFINE_MUTEX(raw_mutex); static const struct file_operations raw_ctl_fops; /* forward declaration */ -static int max_raw_minors = MAX_RAW_MINORS; +static int max_raw_minors = CONFIG_MAX_RAW_MINORS; module_param(max_raw_minors, int, 0); MODULE_PARM_DESC(max_raw_minors, "Maximum number of raw devices (1-65536)"); @@ -317,8 +317,9 @@ static int __init raw_init(void) if (max_raw_minors < 1 || max_raw_minors > 65536) { printk(KERN_WARNING "raw: invalid max_raw_minors (must be" - " between 1 and 65536), using %d\n", MAX_RAW_MINORS); - max_raw_minors = MAX_RAW_MINORS; + " between 1 and 65536), using %d\n", + CONFIG_MAX_RAW_MINORS); + max_raw_minors = CONFIG_MAX_RAW_MINORS; } raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors); diff --git a/include/uapi/linux/raw.h b/include/uapi/linux/raw.h index 62d543e..f3d009b 100644 --- a/include/uapi/linux/raw.h +++ b/include/uapi/linux/raw.h @@ -13,6 +13,6 @@ struct raw_config_request __u64 block_minor; }; -#define MAX_RAW_MINORS CONFIG_MAX_RAW_DEVS +#define MAX_RAW_MINORS (1 << 20) #endif /* __LINUX_RAW_H */