From patchwork Tue Nov 3 19:46:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 7546611 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 D1EBF9F2F7 for ; Tue, 3 Nov 2015 19:49:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04665206FB for ; Tue, 3 Nov 2015 19:49:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1A34E206F1 for ; Tue, 3 Nov 2015 19:49:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932483AbbKCTqy (ORCPT ); Tue, 3 Nov 2015 14:46:54 -0500 Received: from mail-pa0-f48.google.com ([209.85.220.48]:34369 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932438AbbKCTqt (ORCPT ); Tue, 3 Nov 2015 14:46:49 -0500 Received: by padhx2 with SMTP id hx2so19308717pad.1 for ; Tue, 03 Nov 2015 11:46:48 -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=POhg21Oj5yQpb7MouEGXb74hRBfE2Dwga/UE/kUNEfk=; b=v2VVVPAKW6gXS4w1aAXB/rhVewSQxlNxiumtZBjO73NV1eaWXgaVGPSdNEXcjd+rWQ PzkM5IHw0oRJiyovVbjf0dwprheCRdyEb94AuXvXh7d6yDD8ge+I3E/aoJ36ZIFtIQHL IFu8j4EKPG2Ueo6s/kNxBBRlm51ME1kN6J8JuyATn7dyXnrsBLfJiTN7fxavLkoyxL8+ pgorNkqudp3bxRDhlZ938d4XJfxRp4hwn5V/VLfwrwmBPxQgKa5mU3LR6Y3WS1KF2T5c AeqAqDlc2pY9tezZLUbLCuhWpQ8hArNj5qMt+gQ3tVYITx8xXRXdFOLATTFR2mZJBQDn ftvA== 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=POhg21Oj5yQpb7MouEGXb74hRBfE2Dwga/UE/kUNEfk=; b=Xihu+IgdEttXa/e9nXha6YdBW8Ae01RWfZp2+xNGhx86eHnyP0Z4to4MBW4mRzIbkO LjmSO1CkCQpkSkxAAF5KRddXG2FzeoO5J/ntnkVNyv2r/EqanijJdtukgw0kJmOs1B5J jvZRk9pEnM/2mHDVZJ6UtyLnubfNfjnj+OPohTKL4nLAwENZuEyyTB18O69uRjJ1tTM/ eV8k8C58NKZbZuzS/aH2qNSsshtiPbZhpbsqfiNUr1Qx5ahn+MEkGDV4L4vCLrnDw6iE YFyXvat+yyLWTfJ63UkDYVIEqToqDskmemwYOFggyCEz+SszQxRlDLIDhL71YNhroVmx 0AVw== X-Gm-Message-State: ALoCoQk229tbyxrCjM5APoX5JKHvUGHlvXrX49bIN0AMQNZXljxE42S88ESiwEVC3VsPi4rG5FuJ X-Received: by 10.66.124.165 with SMTP id mj5mr35101197pab.58.1446580008531; Tue, 03 Nov 2015 11:46:48 -0800 (PST) Received: from localhost (dhcp-39-103.EECS.Berkeley.EDU. [128.32.39.103]) by smtp.gmail.com with ESMTPSA id d2sm31052506pat.24.2015.11.03.11.46.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Nov 2015 11:46:47 -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 02/13] Use sys_ni.c instead of #ifdef to disable fork on CONFIG_NOMMU Date: Tue, 3 Nov 2015 11:46:23 -0800 Message-Id: <1446579994-9937-3-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=ham 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 I think this change actually doesn't do anything: __NR_fork was still being defined either way, and on my machine fork() in comes from libc. This just moves to the standard mechanism for defining syscalls that aren't implemented instead, which has the side-effect of no longer having an #ifdef CONFIG_* in a user-visible header. Signed-off-by: Palmer Dabbelt Reviewed-by: Andrew Waterman Reviewed-by: Albert Ou --- include/uapi/asm-generic/unistd.h | 4 ---- kernel/sys_ni.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index ee12400..ffd2957 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -869,11 +869,7 @@ __SYSCALL(__NR_uselib, sys_uselib) __SYSCALL(__NR__sysctl, sys_sysctl) #define __NR_fork 1079 -#ifdef CONFIG_MMU __SYSCALL(__NR_fork, sys_fork) -#else -__SYSCALL(__NR_fork, sys_ni_syscall) -#endif /* CONFIG_MMU */ #undef __NR_syscalls #define __NR_syscalls (__NR_fork+1) diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index a02decf..c830f7f 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -174,6 +174,7 @@ cond_syscall(sys_setfsuid); cond_syscall(sys_setfsgid); cond_syscall(sys_capget); cond_syscall(sys_capset); +cond_syscall(sys_fork); /* arch-specific weak syscall entries */ cond_syscall(sys_pciconfig_read);