From patchwork Mon May 7 08:37:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10383571 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 D510960353 for ; Mon, 7 May 2018 08:46:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB40A286DF for ; Mon, 7 May 2018 08:46:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C03CD28A96; Mon, 7 May 2018 08:46:07 +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=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87426286DF for ; Mon, 7 May 2018 08:46:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbeEGImk (ORCPT ); Mon, 7 May 2018 04:42:40 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54172 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752196AbeEGIil (ORCPT ); Mon, 7 May 2018 04:38:41 -0400 Received: by mail-wm0-f66.google.com with SMTP id a67so11989516wmf.3 for ; Mon, 07 May 2018 01:38:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hzkx+O+0G3Q3tcctiUrB2z+tB2IVEgkfi5NZ0NyZZAc=; b=OxT9QfdKdMZ2UZgvNqf15Pdcsz1XS9hi7Lth2GVFm85LK2AechMbzW9kftwGt2Vb7T F42z675OcpQq8kGgUQjTCE8Lmo1fO6dfUAm7gR6jax8qnv5ops9DXhS5XV3ejHfYo5cK /VUslAl0CRhf0SoSIwUEwbAU/6mB9Ctwrs0B1ZJvoAGGsNcBS7epse7ELiTnQQg4r7L0 +urbZF21xQlFZQdxaJGd19ra+ulRpO03U1RjQjNNY8uvJC4qti9seB2rffonZ5WJKhGT U1o++ryqP/t5oadYGYa9PZn/e/fM8vF1BjqGicIGpp3MFIXDdUvSF9+XYb/5NZGKd8CT LNjg== X-Gm-Message-State: ALKqPweILMV742dGOuP1mOFec3vMh5LLG/OkTfwn/Jvx159lsRjiUfSl OjqM0ah8FOSTPuBuwcNwpHEjCw== X-Google-Smtp-Source: AB8JxZoqX/nrRlNVbVrnvpoFtHe5tTVgPS2lsL5lm5VjeyxugQdBKqXei/kxf6Bhqltn0QIeb4NfQg== X-Received: by 10.28.71.146 with SMTP id m18mr162484wmi.144.1525682319855; Mon, 07 May 2018 01:38:39 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (C2B0E321.catv.pool.telekom.hu. [194.176.227.33]) by smtp.gmail.com with ESMTPSA id h8-v6sm5908050wmc.16.2018.05.07.01.38.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 May 2018 01:38:39 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: [PATCH v2 24/35] vfs: simplify dentry_open() Date: Mon, 7 May 2018 10:37:56 +0200 Message-Id: <20180507083807.28792-25-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180507083807.28792-1-mszeredi@redhat.com> References: <20180507083807.28792-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dentry_open() can now just call path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fs/open.c b/fs/open.c index 244cd2ecfefd..1d4bc541c619 100644 --- a/fs/open.c +++ b/fs/open.c @@ -935,25 +935,12 @@ EXPORT_SYMBOL(path_open); struct file *dentry_open(const struct path *path, int flags, const struct cred *cred) { - int error; - struct file *f; - validate_creds(cred); /* We must always pass in a valid mount pointer. */ BUG_ON(!path->mnt); - f = get_empty_filp(); - if (IS_ERR(f)) - return f; - - f->f_flags = flags; - error = vfs_open(path, f, cred); - if (error) { - put_filp(f); - return ERR_PTR(error); - } - return f; + return path_open(path, flags, d_backing_inode(path->dentry), cred, true); } EXPORT_SYMBOL(dentry_open);