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.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index e222b2582746..1b27b5688f62 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -478,9 +478,12 @@ void sysfs_notify(struct kobject *k, const char *dir, const char *attr)
478 mutex_lock(&sysfs_mutex); 478 mutex_lock(&sysfs_mutex);
479 479
480 if (sd && dir) 480 if (sd && dir)
481 sd = sysfs_find_dirent(sd, dir); 481 /* Only directories are tagged, so no need to pass
482 * a tag explicitly.
483 */
484 sd = sysfs_find_dirent(sd, NULL, dir);
482 if (sd && attr) 485 if (sd && attr)
483 sd = sysfs_find_dirent(sd, attr); 486 sd = sysfs_find_dirent(sd, NULL, attr);
484 if (sd) 487 if (sd)
485 sysfs_notify_dirent(sd); 488 sysfs_notify_dirent(sd);
486 489
@@ -569,7 +572,7 @@ int sysfs_add_file_to_group(struct kobject *kobj,
569 int error; 572 int error;
570 573
571 if (group) 574 if (group)
572 dir_sd = sysfs_get_dirent(kobj->sd, group); 575 dir_sd = sysfs_get_dirent(kobj->sd, NULL, group);
573 else 576 else
574 dir_sd = sysfs_get(kobj->sd); 577 dir_sd = sysfs_get(kobj->sd);
575 578
@@ -590,7 +593,8 @@ EXPORT_SYMBOL_GPL(sysfs_add_file_to_group);
590 * @mode: file permissions. 593 * @mode: file permissions.
591 * 594 *
592 */ 595 */
593int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode) 596int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr,
597 mode_t mode)
594{ 598{
595 struct sysfs_dirent *sd; 599 struct sysfs_dirent *sd;
596 struct iattr newattrs; 600 struct iattr newattrs;
@@ -599,7 +603,7 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode)
599 mutex_lock(&sysfs_mutex); 603 mutex_lock(&sysfs_mutex);
600 604
601 rc = -ENOENT; 605 rc = -ENOENT;
602 sd = sysfs_find_dirent(kobj->sd, attr->name); 606 sd = sysfs_find_dirent(kobj->sd, NULL, attr->name);
603 if (!sd) 607 if (!sd)
604 goto out; 608 goto out;
605 609
@@ -624,7 +628,7 @@ EXPORT_SYMBOL_GPL(sysfs_chmod_file);
624 628
625void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr) 629void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)
626{ 630{
627 sysfs_hash_and_remove(kobj->sd, attr->name); 631 sysfs_hash_and_remove(kobj->sd, NULL, attr->name);
628} 632}
629 633
630void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr) 634void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr)
@@ -646,11 +650,11 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
646 struct sysfs_dirent *dir_sd; 650 struct sysfs_dirent *dir_sd;
647 651
648 if (group) 652 if (group)
649 dir_sd = sysfs_get_dirent(kobj->sd, group); 653 dir_sd = sysfs_get_dirent(kobj->sd, NULL, group);
650 else 654 else
651 dir_sd = sysfs_get(kobj->sd); 655 dir_sd = sysfs_get(kobj->sd);
652 if (dir_sd) { 656 if (dir_sd) {
653 sysfs_hash_and_remove(dir_sd, attr->name); 657 sysfs_hash_and_remove(dir_sd, NULL, attr->name);
654 sysfs_put(dir_sd); 658 sysfs_put(dir_sd);
655 } 659 }
656} 660}