From patchwork Wed Nov 7 22:31:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 150451 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp93105ljp; Wed, 7 Nov 2018 14:31:58 -0800 (PST) X-Google-Smtp-Source: AJdET5fCfS22JGLvfwHqG6Oqbtyf7L6P754sRQ0bBKbVAsDZ0B3iCWyZeSWRvPzax/dHLYu48Ap+ X-Received: by 2002:a63:1848:: with SMTP id 8mr1768009pgy.81.1541629918540; Wed, 07 Nov 2018 14:31:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541629918; cv=none; d=google.com; s=arc-20160816; b=dToheQLwdhVX53+bsg/oPYkdpHZb32ax2K+0GAcp3a0iHeWZMlXJhRlN5l5kiHs8Ym nd4nVfxJIUNiOfhQztIPTyJO1Qge0S4TrVKGLTghhnBK9G4cab30b2/8j1q28NdW+QgJ DpNNkD05ovojBTlindcUH2b884PNv3eNxCRbz1PXxqJ14rQClU30p2rFoMW3pJMVgj2c pz5lRsr+X89KvB1IzGtrkfIcyInj5mx5XzEAM0bdB33P2w0Ox59EMRrF9avyF6R+honI 9Bc989IT3ytT0n44+ZLlUyyfAmTuKNyW2NILTFQED80HazQ4CwPJYX9GSXX/468Vs3CQ lCfQ== 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; bh=3CYnbqPAmqUfHKzmMcRqlFYTfeL9hdSDgbdLKoosjak=; b=Q2jQGOVRfs+WdTZbAE/crShIDm5A5PDTdzVVmIz/wwF5+T5RuCc/at9VyatDJylDuh Ry8eleGnOFBw4kHkVj9SufQfcsSTuK3iCd5QSui81q8znniKLLdsngeMPmlhCdq5Ewfn xd8nWH7ai0ZSEWbVrLS9OB54pUNmg44qMLMhHXE62+AqikTiSoJq3jXSAojAL03ARY0d 10lCAlaqqfppezmbBEfh8C/7/j3FGmJIxpxSLTRnQC3soPnVqVxkFW7att+gSiFIkas8 V2yCGj2Ijer9eTUgoQsD7y2BascEEV+P6Ndtnc3tIsnTaSkfNyDbsCZYnaA62ef4xuOd bnug== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o61-v6si2068773pld.187.2018.11.07.14.31.58; Wed, 07 Nov 2018 14:31:58 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbeKHIEW (ORCPT + 32 others); Thu, 8 Nov 2018 03:04:22 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:36721 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727591AbeKHIEV (ORCPT ); Thu, 8 Nov 2018 03:04:21 -0500 Received: by mail-oi1-f194.google.com with SMTP id r127-v6so15293462oie.3; Wed, 07 Nov 2018 14:31:54 -0800 (PST) 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:mime-version:content-transfer-encoding; bh=3CYnbqPAmqUfHKzmMcRqlFYTfeL9hdSDgbdLKoosjak=; b=VXtgf+m+r1n4iSX2VsRzo0o8CtPHcBDzcYfi6wJVmwYj8gEP6RxDcCHtx71XEyW0jg 87XnhJvGyFS2ToPel4v4IGUbAHWFojGiVZQlaRmbV5TzUX06FguZ8kVyGHAvr5mI/kG4 pES+seEl8Hl+8oinUIS3CBGz1UdepiFXckJO3WPepaBP9rd2F+ndPmjfv+WThgQY2MZe CUHwzTIHj0TlkOj63maTtrd53eTcvyWSCKvKXyB7VMojog3R1fCDvFc6qno0yDM3OKAm 3012CBrt/zXOC9vbMyv9s5I8qRGcM+OYq7UdbRditK9WLz5HjVymDYs2D2RWowZl1MWJ xu6w== X-Gm-Message-State: AGRZ1gK/ASxbmq0YMljLYD7WgKi9nu09HXUkY94s1TDSD8gtwznSceSv n0GjNiOUjoMY/2err18NeA== X-Received: by 2002:aca:5596:: with SMTP id j144-v6mr1324611oib.54.1541629913931; Wed, 07 Nov 2018 14:31:53 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id f9sm750959oth.17.2018.11.07.14.31.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 14:31:53 -0800 (PST) From: Rob Herring To: "David S. Miller" Cc: Frank Rowand , linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org Subject: [PATCH 1/8] fs/openpromfs: use full_name instead of path_component_name Date: Wed, 7 Nov 2018 16:31:44 -0600 Message-Id: <20181107223151.14991-2-robh@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181107223151.14991-1-robh@kernel.org> References: <20181107223151.14991-1-robh@kernel.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to remove struct device_node.path_component_name, use full_name instead. kbasename is used so full_name can be used whether it is the full path or just the node's name and unit-address. Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring --- fs/openpromfs/inode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.19.1 diff --git a/fs/openpromfs/inode.c b/fs/openpromfs/inode.c index 607092f367ad..3d8e9bcfe239 100644 --- a/fs/openpromfs/inode.c +++ b/fs/openpromfs/inode.c @@ -199,10 +199,11 @@ static struct dentry *openpromfs_lookup(struct inode *dir, struct dentry *dentry child = dp->child; while (child) { - int n = strlen(child->path_component_name); + const char *node_name = kbasename(child->full_name); + int n = strlen(node_name); if (len == n && - !strncmp(child->path_component_name, name, len)) { + !strncmp(node_name, name, len)) { ent_type = op_inode_node; ent_data.node = child; ino = child->unique_id; @@ -293,8 +294,8 @@ static int openpromfs_readdir(struct file *file, struct dir_context *ctx) } while (child) { if (!dir_emit(ctx, - child->path_component_name, - strlen(child->path_component_name), + kbasename(child->full_name), + strlen(kbasename(child->full_name)), child->unique_id, DT_DIR)) goto out;