aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r--fs/sysfs/file.c40
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}
454EXPORT_SYMBOL_GPL(sysfs_add_file_to_group); 453EXPORT_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 */
462int 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
642EXPORT_SYMBOL_GPL(sysfs_create_file); 603EXPORT_SYMBOL_GPL(sysfs_create_file);
643EXPORT_SYMBOL_GPL(sysfs_remove_file); 604EXPORT_SYMBOL_GPL(sysfs_remove_file);
644EXPORT_SYMBOL_GPL(sysfs_update_file);