diff options
author | Chris Wright <chrisw@sous-sol.org> | 2010-05-12 21:28:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-21 12:37:31 -0400 |
commit | 2c3c8bea608866d8bd9dcf92657d57fdcac011c5 (patch) | |
tree | f509b958d0a65c46c831dbdd447a81e706dd995a /drivers/misc/eeprom | |
parent | 68d75ed4b84a0806ecd4bc14da4759713b23a532 (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 'drivers/misc/eeprom')
-rw-r--r-- | drivers/misc/eeprom/at24.c | 6 | ||||
-rw-r--r-- | drivers/misc/eeprom/at25.c | 6 | ||||
-rw-r--r-- | drivers/misc/eeprom/eeprom.c | 3 | ||||
-rw-r--r-- | drivers/misc/eeprom/max6875.c | 2 |
4 files changed, 11 insertions, 6 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index db7d0f21b65d..a79a62f75481 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c | |||
@@ -274,7 +274,8 @@ static ssize_t at24_read(struct at24_data *at24, | |||
274 | return retval; | 274 | return retval; |
275 | } | 275 | } |
276 | 276 | ||
277 | static ssize_t at24_bin_read(struct kobject *kobj, struct bin_attribute *attr, | 277 | static ssize_t at24_bin_read(struct file *filp, struct kobject *kobj, |
278 | struct bin_attribute *attr, | ||
278 | char *buf, loff_t off, size_t count) | 279 | char *buf, loff_t off, size_t count) |
279 | { | 280 | { |
280 | struct at24_data *at24; | 281 | struct at24_data *at24; |
@@ -395,7 +396,8 @@ static ssize_t at24_write(struct at24_data *at24, const char *buf, loff_t off, | |||
395 | return retval; | 396 | return retval; |
396 | } | 397 | } |
397 | 398 | ||
398 | static ssize_t at24_bin_write(struct kobject *kobj, struct bin_attribute *attr, | 399 | static ssize_t at24_bin_write(struct file *filp, struct kobject *kobj, |
400 | struct bin_attribute *attr, | ||
399 | char *buf, loff_t off, size_t count) | 401 | char *buf, loff_t off, size_t count) |
400 | { | 402 | { |
401 | struct at24_data *at24; | 403 | struct at24_data *at24; |
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index d194212a41f6..c627e4174ccd 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c | |||
@@ -126,7 +126,8 @@ at25_ee_read( | |||
126 | } | 126 | } |
127 | 127 | ||
128 | static ssize_t | 128 | static ssize_t |
129 | at25_bin_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 129 | at25_bin_read(struct file *filp, struct kobject *kobj, |
130 | struct bin_attribute *bin_attr, | ||
130 | char *buf, loff_t off, size_t count) | 131 | char *buf, loff_t off, size_t count) |
131 | { | 132 | { |
132 | struct device *dev; | 133 | struct device *dev; |
@@ -253,7 +254,8 @@ at25_ee_write(struct at25_data *at25, const char *buf, loff_t off, | |||
253 | } | 254 | } |
254 | 255 | ||
255 | static ssize_t | 256 | static ssize_t |
256 | at25_bin_write(struct kobject *kobj, struct bin_attribute *bin_attr, | 257 | at25_bin_write(struct file *filp, struct kobject *kobj, |
258 | struct bin_attribute *bin_attr, | ||
257 | char *buf, loff_t off, size_t count) | 259 | char *buf, loff_t off, size_t count) |
258 | { | 260 | { |
259 | struct device *dev; | 261 | struct device *dev; |
diff --git a/drivers/misc/eeprom/eeprom.c b/drivers/misc/eeprom/eeprom.c index e306a8cd2f96..45060ddc4e59 100644 --- a/drivers/misc/eeprom/eeprom.c +++ b/drivers/misc/eeprom/eeprom.c | |||
@@ -81,7 +81,8 @@ exit: | |||
81 | mutex_unlock(&data->update_lock); | 81 | mutex_unlock(&data->update_lock); |
82 | } | 82 | } |
83 | 83 | ||
84 | static ssize_t eeprom_read(struct kobject *kobj, struct bin_attribute *bin_attr, | 84 | static ssize_t eeprom_read(struct file *filp, struct kobject *kobj, |
85 | struct bin_attribute *bin_attr, | ||
85 | char *buf, loff_t off, size_t count) | 86 | char *buf, loff_t off, size_t count) |
86 | { | 87 | { |
87 | struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); | 88 | struct i2c_client *client = to_i2c_client(container_of(kobj, struct device, kobj)); |
diff --git a/drivers/misc/eeprom/max6875.c b/drivers/misc/eeprom/max6875.c index fe2909278507..5653a3ce0517 100644 --- a/drivers/misc/eeprom/max6875.c +++ b/drivers/misc/eeprom/max6875.c | |||
@@ -107,7 +107,7 @@ exit_up: | |||
107 | mutex_unlock(&data->update_lock); | 107 | mutex_unlock(&data->update_lock); |
108 | } | 108 | } |
109 | 109 | ||
110 | static ssize_t max6875_read(struct kobject *kobj, | 110 | static ssize_t max6875_read(struct file *filp, struct kobject *kobj, |
111 | struct bin_attribute *bin_attr, | 111 | struct bin_attribute *bin_attr, |
112 | char *buf, loff_t off, size_t count) | 112 | char *buf, loff_t off, size_t count) |
113 | { | 113 | { |