diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-20 03:05:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:09 -0400 |
commit | 5a7ad7f044941316dc98eda2a087a12a7a50649d (patch) | |
tree | 03b61af0e90dc158df43f24f8a38792d8c6ae651 /fs/sysfs/file.c | |
parent | 59f69015684b3de7b9472be9a81b1a978f93a496 (diff) |
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 <htejun@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 9fdf8dae0dcd..61a8c19df7c3 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -3,7 +3,6 @@ | |||
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
6 | #include <linux/fsnotify.h> | ||
7 | #include <linux/kobject.h> | 6 | #include <linux/kobject.h> |
8 | #include <linux/namei.h> | 7 | #include <linux/namei.h> |
9 | #include <linux/poll.h> | 8 | #include <linux/poll.h> |
@@ -453,44 +452,6 @@ int sysfs_add_file_to_group(struct kobject *kobj, | |||
453 | } | 452 | } |
454 | EXPORT_SYMBOL_GPL(sysfs_add_file_to_group); | 453 | EXPORT_SYMBOL_GPL(sysfs_add_file_to_group); |
455 | 454 | ||
456 | |||
457 | /** | ||
458 | * sysfs_update_file - update the modified timestamp on an object attribute. | ||
459 | * @kobj: object we're acting for. | ||
460 | * @attr: attribute descriptor. | ||
461 | */ | ||
462 | int sysfs_update_file(struct kobject * kobj, const struct attribute * attr) | ||
463 | { | ||
464 | struct sysfs_dirent *victim_sd = NULL; | ||
465 | struct dentry *victim = NULL; | ||
466 | int rc; | ||
467 | |||
468 | rc = -ENOENT; | ||
469 | victim_sd = sysfs_get_dirent(kobj->sd, attr->name); | ||
470 | if (!victim_sd) | ||
471 | goto out; | ||
472 | |||
473 | mutex_lock(&sysfs_rename_mutex); | ||
474 | victim = sysfs_get_dentry(victim_sd); | ||
475 | mutex_unlock(&sysfs_rename_mutex); | ||
476 | if (IS_ERR(victim)) { | ||
477 | rc = PTR_ERR(victim); | ||
478 | victim = NULL; | ||
479 | goto out; | ||
480 | } | ||
481 | |||
482 | mutex_lock(&victim->d_inode->i_mutex); | ||
483 | victim->d_inode->i_mtime = CURRENT_TIME; | ||
484 | fsnotify_modify(victim); | ||
485 | mutex_unlock(&victim->d_inode->i_mutex); | ||
486 | rc = 0; | ||
487 | out: | ||
488 | dput(victim); | ||
489 | sysfs_put(victim_sd); | ||
490 | return rc; | ||
491 | } | ||
492 | |||
493 | |||
494 | /** | 455 | /** |
495 | * sysfs_chmod_file - update the modified mode value on an object attribute. | 456 | * sysfs_chmod_file - update the modified mode value on an object attribute. |
496 | * @kobj: object we're acting for. | 457 | * @kobj: object we're acting for. |
@@ -641,4 +602,3 @@ EXPORT_SYMBOL_GPL(sysfs_schedule_callback); | |||
641 | 602 | ||
642 | EXPORT_SYMBOL_GPL(sysfs_create_file); | 603 | EXPORT_SYMBOL_GPL(sysfs_create_file); |
643 | EXPORT_SYMBOL_GPL(sysfs_remove_file); | 604 | EXPORT_SYMBOL_GPL(sysfs_remove_file); |
644 | EXPORT_SYMBOL_GPL(sysfs_update_file); | ||