lindebugfs: Add debugfs_lookup()

[Why]
This function is used by hhe DRM generic code starting with Linux 6.7.

Reviewed by:	manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48761
This commit is contained in:
Jean-Sébastien Pédron 2025-01-13 19:55:00 +01:00
parent f570760e5f
commit 2ee1311820
No known key found for this signature in database
GPG key ID: 39E99761A5FD94CC
2 changed files with 19 additions and 0 deletions

View file

@ -328,6 +328,23 @@ debugfs_create_symlink(const char *name, struct dentry *parent,
return (NULL);
}
struct dentry *
debugfs_lookup(const char *name, struct dentry *parent)
{
struct dentry_meta *dm;
struct dentry *dnode;
struct pfs_node *pnode;
pnode = pfs_find_node(parent->d_pfs_node, name);
if (pnode == NULL)
return (NULL);
dm = (struct dentry_meta *)pnode->pn_data;
dnode = &dm->dm_dnode;
return (dnode);
}
void
debugfs_remove(struct dentry *dnode)
{

View file

@ -82,6 +82,8 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
const char *dest);
struct dentry *debugfs_lookup(const char *name, struct dentry *parent);
void debugfs_remove(struct dentry *dentry);
void debugfs_remove_recursive(struct dentry *dentry);