summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-10-24 11:49:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-29 15:12:07 -0700
commit672f76a81ad524359e761d7c863d24aec58e23c5 (patch)
tree1d15b0abb7b0a7928536ecbad8263b17ca9272cb
parent56b3f3b884652395e1025a8e4f1c4bd47bc112c4 (diff)
downloadkernel-common-672f76a81ad524359e761d7c863d24aec58e23c5.tar.gz
kernel-common-672f76a81ad524359e761d7c863d24aec58e23c5.tar.bz2
kernel-common-672f76a81ad524359e761d7c863d24aec58e23c5.zip
sysfs: honor bin_attr.attr.ignore_lockdep
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>
-rw-r--r--fs/sysfs/sysfs.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index c095d952f3a5..bdce8458af3b 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -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;
}