aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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 /drivers/net
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 'drivers/net')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c11
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c12
2 files changed, 15 insertions, 8 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index c61a61f177b7..6ce6ce1df6d2 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -2560,7 +2560,8 @@ netxen_sysfs_validate_crb(struct netxen_adapter *adapter,
2560} 2560}
2561 2561
2562static ssize_t 2562static ssize_t
2563netxen_sysfs_read_crb(struct kobject *kobj, struct bin_attribute *attr, 2563netxen_sysfs_read_crb(struct file *filp, struct kobject *kobj,
2564 struct bin_attribute *attr,
2564 char *buf, loff_t offset, size_t size) 2565 char *buf, loff_t offset, size_t size)
2565{ 2566{
2566 struct device *dev = container_of(kobj, struct device, kobj); 2567 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2587,7 +2588,8 @@ netxen_sysfs_read_crb(struct kobject *kobj, struct bin_attribute *attr,
2587} 2588}
2588 2589
2589static ssize_t 2590static ssize_t
2590netxen_sysfs_write_crb(struct kobject *kobj, struct bin_attribute *attr, 2591netxen_sysfs_write_crb(struct file *filp, struct kobject *kobj,
2592 struct bin_attribute *attr,
2591 char *buf, loff_t offset, size_t size) 2593 char *buf, loff_t offset, size_t size)
2592{ 2594{
2593 struct device *dev = container_of(kobj, struct device, kobj); 2595 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2627,7 +2629,8 @@ netxen_sysfs_validate_mem(struct netxen_adapter *adapter,
2627} 2629}
2628 2630
2629static ssize_t 2631static ssize_t
2630netxen_sysfs_read_mem(struct kobject *kobj, struct bin_attribute *attr, 2632netxen_sysfs_read_mem(struct file *filp, struct kobject *kobj,
2633 struct bin_attribute *attr,
2631 char *buf, loff_t offset, size_t size) 2634 char *buf, loff_t offset, size_t size)
2632{ 2635{
2633 struct device *dev = container_of(kobj, struct device, kobj); 2636 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2647,7 +2650,7 @@ netxen_sysfs_read_mem(struct kobject *kobj, struct bin_attribute *attr,
2647 return size; 2650 return size;
2648} 2651}
2649 2652
2650static ssize_t netxen_sysfs_write_mem(struct kobject *kobj, 2653static ssize_t netxen_sysfs_write_mem(struct file *filp, struct kobject *kobj,
2651 struct bin_attribute *attr, char *buf, 2654 struct bin_attribute *attr, char *buf,
2652 loff_t offset, size_t size) 2655 loff_t offset, size_t size)
2653{ 2656{
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 1003eb76fda3..23ea9caa5261 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2464,7 +2464,8 @@ qlcnic_sysfs_validate_crb(struct qlcnic_adapter *adapter,
2464} 2464}
2465 2465
2466static ssize_t 2466static ssize_t
2467qlcnic_sysfs_read_crb(struct kobject *kobj, struct bin_attribute *attr, 2467qlcnic_sysfs_read_crb(struct file *filp, struct kobject *kobj,
2468 struct bin_attribute *attr,
2468 char *buf, loff_t offset, size_t size) 2469 char *buf, loff_t offset, size_t size)
2469{ 2470{
2470 struct device *dev = container_of(kobj, struct device, kobj); 2471 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2488,7 +2489,8 @@ qlcnic_sysfs_read_crb(struct kobject *kobj, struct bin_attribute *attr,
2488} 2489}
2489 2490
2490static ssize_t 2491static ssize_t
2491qlcnic_sysfs_write_crb(struct kobject *kobj, struct bin_attribute *attr, 2492qlcnic_sysfs_write_crb(struct file *filp, struct kobject *kobj,
2493 struct bin_attribute *attr,
2492 char *buf, loff_t offset, size_t size) 2494 char *buf, loff_t offset, size_t size)
2493{ 2495{
2494 struct device *dev = container_of(kobj, struct device, kobj); 2496 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2525,7 +2527,8 @@ qlcnic_sysfs_validate_mem(struct qlcnic_adapter *adapter,
2525} 2527}
2526 2528
2527static ssize_t 2529static ssize_t
2528qlcnic_sysfs_read_mem(struct kobject *kobj, struct bin_attribute *attr, 2530qlcnic_sysfs_read_mem(struct file *filp, struct kobject *kobj,
2531 struct bin_attribute *attr,
2529 char *buf, loff_t offset, size_t size) 2532 char *buf, loff_t offset, size_t size)
2530{ 2533{
2531 struct device *dev = container_of(kobj, struct device, kobj); 2534 struct device *dev = container_of(kobj, struct device, kobj);
@@ -2546,7 +2549,8 @@ qlcnic_sysfs_read_mem(struct kobject *kobj, struct bin_attribute *attr,
2546} 2549}
2547 2550
2548static ssize_t 2551static ssize_t
2549qlcnic_sysfs_write_mem(struct kobject *kobj, struct bin_attribute *attr, 2552qlcnic_sysfs_write_mem(struct file *filp, struct kobject *kobj,
2553 struct bin_attribute *attr,
2550 char *buf, loff_t offset, size_t size) 2554 char *buf, loff_t offset, size_t size)
2551{ 2555{
2552 struct device *dev = container_of(kobj, struct device, kobj); 2556 struct device *dev = container_of(kobj, struct device, kobj);