aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2010-05-12 21:28:57 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-21 12:37:31 -0400
commit2c3c8bea608866d8bd9dcf92657d57fdcac011c5 (patch)
treef509b958d0a65c46c831dbdd447a81e706dd995a /include/linux
parent68d75ed4b84a0806ecd4bc14da4759713b23a532 (diff)
sysfs: add struct file* to bin_attr callbacks
This allows bin_attr->read,write,mmap callbacks to check file specific data (such as inode owner) as part of any privilege validation. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sysfs.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6903e9204032..f2694eb4dd3d 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -87,17 +87,18 @@ struct attribute_group {
87 87
88#define attr_name(_attr) (_attr).attr.name 88#define attr_name(_attr) (_attr).attr.name
89 89
90struct file;
90struct vm_area_struct; 91struct vm_area_struct;
91 92
92struct bin_attribute { 93struct bin_attribute {
93 struct attribute attr; 94 struct attribute attr;
94 size_t size; 95 size_t size;
95 void *private; 96 void *private;
96 ssize_t (*read)(struct kobject *, struct bin_attribute *, 97 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
97 char *, loff_t, size_t); 98 char *, loff_t, size_t);
98 ssize_t (*write)(struct kobject *, struct bin_attribute *, 99 ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *,
99 char *, loff_t, size_t); 100 char *, loff_t, size_t);
100 int (*mmap)(struct kobject *, struct bin_attribute *attr, 101 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
101 struct vm_area_struct *vma); 102 struct vm_area_struct *vma);
102}; 103};
103 104