Driver core changes for 5.14-rc1
Here is the small set of driver core and debugfs updates for 5.14-rc1. Included in here are: - debugfs api cleanups (touched some drivers) - devres updates - tiny driver core updates and tweaks Nothing major in here at all, and all have been in linux-next for a while with no reported issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYOM7jA8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+yloDQCfZOlLYXF+2KgXJQqevNnRiu7/B1gAn3aCX6xh UWVUfu5LDIXi2uFERRT1 =Ze3R -----END PGP SIGNATURE----- Merge tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core changes from Greg KH: "Here is the small set of driver core and debugfs updates for 5.14-rc1. Included in here are: - debugfs api cleanups (touched some drivers) - devres updates - tiny driver core updates and tweaks Nothing major in here at all, and all have been in linux-next for a while with no reported issues" * tag 'driver-core-5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits) docs: ABI: testing: sysfs-firmware-memmap: add some memmap types. devres: Enable trace events devres: No need to call remove_nodes() when there none present devres: Use list_for_each_safe_from() in remove_nodes() devres: Make locking straight forward in release_nodes() kernfs: move revalidate to be near lookup drivers/base: Constify static attribute_group structs firmware_loader: remove unneeded 'comma' macro devcoredump: remove contact information driver core: Drop helper devm_platform_ioremap_resource_wc() component: Rename 'dev' to 'parent' component: Drop 'dev' argument to component_match_realloc() device property: Don't check for NULL twice in the loops driver core: auxiliary bus: Fix typo in the docs drivers/base/node.c: make CACHE_ATTR define static DEVICE_ATTR_RO debugfs: remove return value of debugfs_create_ulong() debugfs: remove return value of debugfs_create_bool() scsi: snic: debugfs: remove local storage of debugfs files b43: don't save dentries for debugfs b43legacy: don't save dentries for debugfs ...
This commit is contained in:
commit
f5c13f1fde
45 changed files with 314 additions and 371 deletions
|
|
@ -548,49 +548,6 @@ void kernfs_put(struct kernfs_node *kn)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(kernfs_put);
|
||||
|
||||
static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
|
||||
{
|
||||
struct kernfs_node *kn;
|
||||
|
||||
if (flags & LOOKUP_RCU)
|
||||
return -ECHILD;
|
||||
|
||||
/* Always perform fresh lookup for negatives */
|
||||
if (d_really_is_negative(dentry))
|
||||
goto out_bad_unlocked;
|
||||
|
||||
kn = kernfs_dentry_node(dentry);
|
||||
mutex_lock(&kernfs_mutex);
|
||||
|
||||
/* The kernfs node has been deactivated */
|
||||
if (!kernfs_active(kn))
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been moved? */
|
||||
if (kernfs_dentry_node(dentry->d_parent) != kn->parent)
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been renamed */
|
||||
if (strcmp(dentry->d_name.name, kn->name) != 0)
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been moved to a different namespace */
|
||||
if (kn->parent && kernfs_ns_enabled(kn->parent) &&
|
||||
kernfs_info(dentry->d_sb)->ns != kn->ns)
|
||||
goto out_bad;
|
||||
|
||||
mutex_unlock(&kernfs_mutex);
|
||||
return 1;
|
||||
out_bad:
|
||||
mutex_unlock(&kernfs_mutex);
|
||||
out_bad_unlocked:
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct dentry_operations kernfs_dops = {
|
||||
.d_revalidate = kernfs_dop_revalidate,
|
||||
};
|
||||
|
||||
/**
|
||||
* kernfs_node_from_dentry - determine kernfs_node associated with a dentry
|
||||
* @dentry: the dentry in question
|
||||
|
|
@ -1073,6 +1030,49 @@ struct kernfs_node *kernfs_create_empty_dir(struct kernfs_node *parent,
|
|||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
static int kernfs_dop_revalidate(struct dentry *dentry, unsigned int flags)
|
||||
{
|
||||
struct kernfs_node *kn;
|
||||
|
||||
if (flags & LOOKUP_RCU)
|
||||
return -ECHILD;
|
||||
|
||||
/* Always perform fresh lookup for negatives */
|
||||
if (d_really_is_negative(dentry))
|
||||
goto out_bad_unlocked;
|
||||
|
||||
kn = kernfs_dentry_node(dentry);
|
||||
mutex_lock(&kernfs_mutex);
|
||||
|
||||
/* The kernfs node has been deactivated */
|
||||
if (!kernfs_active(kn))
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been moved? */
|
||||
if (kernfs_dentry_node(dentry->d_parent) != kn->parent)
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been renamed */
|
||||
if (strcmp(dentry->d_name.name, kn->name) != 0)
|
||||
goto out_bad;
|
||||
|
||||
/* The kernfs node has been moved to a different namespace */
|
||||
if (kn->parent && kernfs_ns_enabled(kn->parent) &&
|
||||
kernfs_info(dentry->d_sb)->ns != kn->ns)
|
||||
goto out_bad;
|
||||
|
||||
mutex_unlock(&kernfs_mutex);
|
||||
return 1;
|
||||
out_bad:
|
||||
mutex_unlock(&kernfs_mutex);
|
||||
out_bad_unlocked:
|
||||
return 0;
|
||||
}
|
||||
|
||||
const struct dentry_operations kernfs_dops = {
|
||||
.d_revalidate = kernfs_dop_revalidate,
|
||||
};
|
||||
|
||||
static struct dentry *kernfs_iop_lookup(struct inode *dir,
|
||||
struct dentry *dentry,
|
||||
unsigned int flags)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue