Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1979272ybh; Tue, 14 Jul 2020 12:10:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmH/tNcd+z5P5v5lvO5BT+yrigzdl0ADE/Bg9BikXMju3L5ERHVfZSzHXk5JY70WlRiluK X-Received: by 2002:a17:906:ecb6:: with SMTP id qh22mr5537355ejb.230.1594753810952; Tue, 14 Jul 2020 12:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594753810; cv=none; d=google.com; s=arc-20160816; b=gvnn9CvIc3JqOPbT8NlHBOitJKRY9z/xutGmHsZJfOxT/+abSo7SXh5u1UQNTQhDwP Jy1GEMmCASxoKRrjh7C5LYLgMx0mR9VjD1KmtbMBnWhr6opsFeyBYx8ih6VSNm6Pe9x6 FcNiQTfRH1pxNTX9xGpvmWqwZQLLjR71sswxDgafjd8jXvTfcUyvHitXGd9CbbJSaQNq 4lDXpXrUKY9sLveBQvk0Y3ySaJW/TrEexWupJJg/iyKjMQjHDOh1peUKjdwPFcib5JsY ySZTty/HyuwhAp92KfDIDMwTLhFvlr0HB/OaZNSCsMQxGcxX6ewjJgGJnQVqM7BQrAxj ZkVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iWkh8Btldl3XCc5aNwbc5cXedccmUtTPbYLxbSvDT4g=; b=uXDhESosmV0PJZOypyX7+tFY46XwdNo6VKVUHssjnJG+UPqQq+doBwBmPdfRIw8V68 pfPTWSeTJTb3u5cmljIgd7d9Jg3RlOuq5fyaeApX6y615xIVWXdtAFO2rOplhu/vvTTt IWpt21QcO1ER87wl3nYt2dZ8rGJT4pV4uFL5cBKBy0hMP3T16m87oImXaLcrLeyrgkIV NmJylot76BO3464YRcZXngKsBF6J8MiSMo5vyH/vZp3fj7tunrcj68vfdAmxKPgdo8Q7 JQ948OXPNeBuqLMHnPk4ZP5YPJbu6PpG7zurWMveJLBw9isKr7YRZMTp5znIO6z0J46d pefA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=s520x2cN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si10960164ejh.592.2020.07.14.12.09.47; Tue, 14 Jul 2020 12:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=s520x2cN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730722AbgGNTJp (ORCPT + 99 others); Tue, 14 Jul 2020 15:09:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730912AbgGNTJU (ORCPT ); Tue, 14 Jul 2020 15:09:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99CF3C08C5DB; Tue, 14 Jul 2020 12:09:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=iWkh8Btldl3XCc5aNwbc5cXedccmUtTPbYLxbSvDT4g=; b=s520x2cNbQFFcYmwajOIu+Y7OJ 3a20jztlitplwxJBxD2ngsAElq9udqi3Yb5ZdnkQq7NL3Gqy3lqTxc7bIqC25FpBYcI8UYWnT9fnz maQQGRv3IbXvMHLQFt+OSXlNMOtJqxsNmFCvEF167nbp3Yyq124lAKKRHcyGIZOi/Md9ydMGExigP qwpHlbFWcw8t3wMhTy7QP2TLuWT8Mfa2iBSzE41iSqfztUYjFUxoyt6AbM6oU9W2ag1IGtOf+8nuV br+bFosd5T0SydXxxzU6Y9dcvJaVAWbbX5fL1bbO1M1muMaoZF8m3TI5L6/G78IcRz6z3irPB8obp IYsH6Cew==; Received: from [2001:4bb8:188:5f50:f037:8cfe:627e:7028] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvQIn-0005u4-3m; Tue, 14 Jul 2020 19:09:17 +0000 From: Christoph Hellwig To: linux-kernel@vger.kernel.org Cc: "H. Peter Anvin" , Song Liu , Al Viro , Linus Torvalds , linux-raid@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 20/23] fs: remove ksys_open Date: Tue, 14 Jul 2020 21:04:24 +0200 Message-Id: <20200714190427.4332-21-hch@lst.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714190427.4332-1-hch@lst.de> References: <20200714190427.4332-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just open code it in the two callers. Signed-off-by: Christoph Hellwig --- fs/open.c | 11 ++++++++--- include/linux/syscalls.h | 11 ----------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/fs/open.c b/fs/open.c index 75166f071d280a..ab3671af8a9705 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1208,7 +1208,9 @@ long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) { - return ksys_open(filename, flags, mode); + if (force_o_largefile()) + flags |= O_LARGEFILE; + return do_sys_open(AT_FDCWD, filename, flags, mode); } SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, @@ -1270,9 +1272,12 @@ COMPAT_SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, fla */ SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode) { - return ksys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); -} + int flags = O_CREAT | O_WRONLY | O_TRUNC; + if (force_o_largefile()) + flags |= O_LARGEFILE; + return do_sys_open(AT_FDCWD, pathname, flags, mode); +} #endif /* diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a998651629c71b..363baaadf8e19a 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1374,17 +1374,6 @@ static inline int ksys_close(unsigned int fd) return __close_fd(current->files, fd); } -extern long do_sys_open(int dfd, const char __user *filename, int flags, - umode_t mode); - -static inline long ksys_open(const char __user *filename, int flags, - umode_t mode) -{ - if (force_o_largefile()) - flags |= O_LARGEFILE; - return do_sys_open(AT_FDCWD, filename, flags, mode); -} - extern long do_sys_truncate(const char __user *pathname, loff_t length); static inline long ksys_truncate(const char __user *pathname, loff_t length) -- 2.27.0