mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
sysfs: kill sysfs_update_file()
sysfs_update_file() depends on inode->i_mtime but sysfs iondes are now reclaimable making the reported modification time unreliable. There's only one user (pci hotplug) of this notification mechanism and it reportedly isn't utilized from userland. Kill sysfs_update_file(). Signed-off-by: Tejun Heo <[email protected]> Acked-by: Cornelia Huck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
59f6901568
commit
5a7ad7f044
3 changed files with 0 additions and 107 deletions
|
|
@ -3,7 +3,6 @@
|
|||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/fsnotify.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/namei.h>
|
||||
#include <linux/poll.h>
|
||||
|
|
@ -453,44 +452,6 @@ int sysfs_add_file_to_group(struct kobject *kobj,
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(sysfs_add_file_to_group);
|
||||
|
||||
|
||||
/**
|
||||
* sysfs_update_file - update the modified timestamp on an object attribute.
|
||||
* @kobj: object we're acting for.
|
||||
* @attr: attribute descriptor.
|
||||
*/
|
||||
int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
|
||||
{
|
||||
struct sysfs_dirent *victim_sd = NULL;
|
||||
struct dentry *victim = NULL;
|
||||
int rc;
|
||||
|
||||
rc = -ENOENT;
|
||||
victim_sd = sysfs_get_dirent(kobj->sd, attr->name);
|
||||
if (!victim_sd)
|
||||
goto out;
|
||||
|
||||
mutex_lock(&sysfs_rename_mutex);
|
||||
victim = sysfs_get_dentry(victim_sd);
|
||||
mutex_unlock(&sysfs_rename_mutex);
|
||||
if (IS_ERR(victim)) {
|
||||
rc = PTR_ERR(victim);
|
||||
victim = NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
mutex_lock(&victim->d_inode->i_mutex);
|
||||
victim->d_inode->i_mtime = CURRENT_TIME;
|
||||
fsnotify_modify(victim);
|
||||
mutex_unlock(&victim->d_inode->i_mutex);
|
||||
rc = 0;
|
||||
out:
|
||||
dput(victim);
|
||||
sysfs_put(victim_sd);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* sysfs_chmod_file - update the modified mode value on an object attribute.
|
||||
* @kobj: object we're acting for.
|
||||
|
|
@ -641,4 +602,3 @@ EXPORT_SYMBOL_GPL(sysfs_schedule_callback);
|
|||
|
||||
EXPORT_SYMBOL_GPL(sysfs_create_file);
|
||||
EXPORT_SYMBOL_GPL(sysfs_remove_file);
|
||||
EXPORT_SYMBOL_GPL(sysfs_update_file);
|
||||
|
|
|
|||
Loading…
Reference in a new issue