Skip to content

Commit 105e996

Browse files
robherringdavem330
authored andcommitted
fs/openpromfs: use full_name instead of path_component_name
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" <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 25e19c1 commit 105e996

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎fs/openpromfs/inode.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,11 @@ static struct dentry *openpromfs_lookup(struct inode *dir, struct dentry *dentry
199199

200200
child = dp->child;
201201
while (child) {
202-
int n = strlen(child->path_component_name);
202+
const char *node_name = kbasename(child->full_name);
203+
int n = strlen(node_name);
203204

204205
if (len == n &&
205-
!strncmp(child->path_component_name, name, len)) {
206+
!strncmp(node_name, name, len)) {
206207
ent_type = op_inode_node;
207208
ent_data.node = child;
208209
ino = child->unique_id;
@@ -293,8 +294,8 @@ static int openpromfs_readdir(struct file *file, struct dir_context *ctx)
293294
}
294295
while (child) {
295296
if (!dir_emit(ctx,
296-
child->path_component_name,
297-
strlen(child->path_component_name),
297+
kbasename(child->full_name),
298+
strlen(kbasename(child->full_name)),
298299
child->unique_id, DT_DIR))
299300
goto out;
300301

0 commit comments

Comments
 (0)