Received: by 10.192.165.156 with SMTP id m28csp2089383imm; Thu, 12 Apr 2018 08:26:18 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+FxMt9EA//1j8VEK9DGCfZFQs8/LVU5pbN5uBVt+95OJUcsRWe904/p8kmrZxk6/9Kpocj X-Received: by 10.99.122.28 with SMTP id v28mr1001692pgc.299.1523546778373; Thu, 12 Apr 2018 08:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523546778; cv=none; d=google.com; s=arc-20160816; b=LpPUjLRPDVYuDJwybMUmkdXEXQR0hfeBwT6gNQWOjMxX6cAMd6KQoPZfsQWxtVQ3+t npCl5dc7RdxZmQJdIpJUTJSEf40wmFTo6HQgXukC/+VOFDnrbvDvVg/VZwGdabhH8atF iDvgqdg+jqpmRe2Q0I4aCrX6ZpqKWTL+qks7T2VtIJfR+sTtzMH4ahdjnoIzVMxERSnD Vz7GuVK7Zv4hJJmloAOMXOo6xrKTdWm7ca3+d/blooqp2kBTArZJ6sQ2a6vqsGAaZo+i bzSixsSITfHA/P8vPuppJAl7+TAnOp1G2fzYsHhi4GwVQbhnFySMNQzkjzeHXDZlX+7t VYOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=GTQ0EC05y/1W6nQaibqwsmYkIz1jW5hxx+1tQwxP2WE=; b=cSJUGvJnowm15LJ/Fg6pnmm/+33cY8x+Hz4dUHlj/3fLcwON5u/c9rthkvHu+MZ+k7 FfNe2zdWEN+3Oo9rmg/boIONYv6ZoxiEdvylPvNeQb5KZC4D3y6HktfNK7WQZkuZH6Iv q37BM0aVSoaHceEJNErUk5T6Ym82UGedF9D9hdms6DSvCmh9phwl2hUQFdHpJSUqCvX0 66DDQ5wJOXC6/i/pVEIf1OsdSdotZ01QAKNrkjrv1ViYHkBLoZusYRLu8RKFdHFRDL7k YWjqqCsdixQlL/M4WIEtiHXQ+2ee0fPUc5Vk1EIJbixAXxn/vUdUfavaYhOKqOwfNWbp fffQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si2375035pgc.401.2018.04.12.08.25.41; Thu, 12 Apr 2018 08:26:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753888AbeDLPSB (ORCPT + 99 others); Thu, 12 Apr 2018 11:18:01 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44661 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753399AbeDLPI7 (ORCPT ); Thu, 12 Apr 2018 11:08:59 -0400 Received: by mail-wr0-f194.google.com with SMTP id u46so5466232wrc.11 for ; Thu, 12 Apr 2018 08:08:58 -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=GTQ0EC05y/1W6nQaibqwsmYkIz1jW5hxx+1tQwxP2WE=; b=dQiDlMzhT5+5QeaB5NUtzwGQzjEIxbI30cDFPZHwIN4LBCaeCwAnpMRTugs3+r1w5x a9QPrKDkvUYkfQfm/XQtLB6x/TGwc3UbIILVX95EbvGwI+wzBDFXtAxxQHzQKBi9rKt4 jbCHXFwIeDMFjTrwmPLJGY4IdgY3AzQIZvOrJoVoT+Yi8FRBcF+Y9/tJeVgwFz4tRnYn 3/V/fHSgohPUpTTynKPXRm9mHGIX6W2+muvXgqTrayGz7tMLLRaGXiwrcx8oDGEsdtJq Dfzhkd52uvd+JPj66Q3nojlps59dwX64bt4YgLzQRzkeA+SegVFiMV9SN67Y5EusOj/k DEfA== X-Gm-Message-State: ALQs6tAXT31vprqdHuFfGugoCyvdCpg36sfQumP0Cyz7q/eWBTuHFC0N Ptb+f7SJXaU8a00Xivww9Pa4mw== X-Received: by 10.223.174.227 with SMTP id y90mr1083149wrc.76.1523545738319; Thu, 12 Apr 2018 08:08:58 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id p197sm2621783wme.43.2018.04.12.08.08.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Apr 2018 08:08:57 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 23/35] vfs: simplify dentry_open() Date: Thu, 12 Apr 2018 17:08:14 +0200 Message-Id: <20180412150826.20988-24-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180412150826.20988-1-mszeredi@redhat.com> References: <20180412150826.20988-1-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dentry_open() can now just call path_open(). Signed-off-by: Miklos Szeredi --- fs/open.c | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/fs/open.c b/fs/open.c index 1d1a52908b0f..442088ca30f9 100644 --- a/fs/open.c +++ b/fs/open.c @@ -891,31 +891,13 @@ 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)) { - f->f_flags = flags; - error = vfs_open(path, f, cred); - if (!error) { - /* from now on we need fput() to dispose of f */ - error = open_check_o_direct(f); - if (error) { - fput(f); - f = ERR_PTR(error); - } - } else { - put_filp(f); - f = ERR_PTR(error); - } - } - return f; + return path_open(path, flags, d_backing_inode(path->dentry), cred, + true); } EXPORT_SYMBOL(dentry_open); -- 2.14.3