sysfs: honor bin_attr.attr.ignore_lockdep
authorTejun Heo <tj@kernel.org>
Thu, 24 Oct 2013 15:49:08 +0000 (11:49 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Oct 2013 22:12:07 +0000 (15:12 -0700)
ignore_lockdep is currently honored only for regular files.  There's
no reason to ignore it for bin files.  Update sysfs_ignore_lockdep()
so that bin_attr.attr.ignore_lockdep works too.

While this doesn't have any in-kernel user, this unifies the behaviors
between regular and bin files and will help later changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/sysfs.h

index c095d952f3a5ab5ec16b3615d78f3d16327ab440..bdce8458af3b54208ce697745aa032ceefb0cc10 100644 (file)
@@ -114,7 +114,9 @@ do {                                                                \
 /* Test for attributes that want to ignore lockdep for read-locking */
 static inline bool sysfs_ignore_lockdep(struct sysfs_dirent *sd)
 {
-       return sysfs_type(sd) == SYSFS_KOBJ_ATTR &&
+       int type = sysfs_type(sd);
+
+       return (type == SYSFS_KOBJ_ATTR || type == SYSFS_KOBJ_BIN_ATTR) &&
                sd->s_attr.attr->ignore_lockdep;
 }