aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_attr.c
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/scsi/lpfc/lpfc_attr.c
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/scsi/lpfc/lpfc_attr.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_attr.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 2e5f376d9ccc..bf33b315f93e 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2643,6 +2643,7 @@ static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR,
2643 2643
2644/** 2644/**
2645 * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute 2645 * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute
2646 * @filp: sysfs file
2646 * @kobj: Pointer to the kernel object 2647 * @kobj: Pointer to the kernel object
2647 * @bin_attr: Attribute object 2648 * @bin_attr: Attribute object
2648 * @buff: Buffer pointer 2649 * @buff: Buffer pointer
@@ -2654,7 +2655,8 @@ static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR,
2654 * applications. 2655 * applications.
2655 **/ 2656 **/
2656static ssize_t 2657static ssize_t
2657sysfs_drvr_stat_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, 2658sysfs_drvr_stat_data_read(struct file *filp, struct kobject *kobj,
2659 struct bin_attribute *bin_attr,
2658 char *buf, loff_t off, size_t count) 2660 char *buf, loff_t off, size_t count)
2659{ 2661{
2660 struct device *dev = container_of(kobj, struct device, 2662 struct device *dev = container_of(kobj, struct device,
@@ -3362,6 +3364,7 @@ struct device_attribute *lpfc_vport_attrs[] = {
3362 3364
3363/** 3365/**
3364 * sysfs_ctlreg_write - Write method for writing to ctlreg 3366 * sysfs_ctlreg_write - Write method for writing to ctlreg
3367 * @filp: open sysfs file
3365 * @kobj: kernel kobject that contains the kernel class device. 3368 * @kobj: kernel kobject that contains the kernel class device.
3366 * @bin_attr: kernel attributes passed to us. 3369 * @bin_attr: kernel attributes passed to us.
3367 * @buf: contains the data to be written to the adapter IOREG space. 3370 * @buf: contains the data to be written to the adapter IOREG space.
@@ -3379,7 +3382,8 @@ struct device_attribute *lpfc_vport_attrs[] = {
3379 * value of count, buf contents written 3382 * value of count, buf contents written
3380 **/ 3383 **/
3381static ssize_t 3384static ssize_t
3382sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr, 3385sysfs_ctlreg_write(struct file *filp, struct kobject *kobj,
3386 struct bin_attribute *bin_attr,
3383 char *buf, loff_t off, size_t count) 3387 char *buf, loff_t off, size_t count)
3384{ 3388{
3385 size_t buf_off; 3389 size_t buf_off;
@@ -3415,6 +3419,7 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,
3415 3419
3416/** 3420/**
3417 * sysfs_ctlreg_read - Read method for reading from ctlreg 3421 * sysfs_ctlreg_read - Read method for reading from ctlreg
3422 * @filp: open sysfs file
3418 * @kobj: kernel kobject that contains the kernel class device. 3423 * @kobj: kernel kobject that contains the kernel class device.
3419 * @bin_attr: kernel attributes passed to us. 3424 * @bin_attr: kernel attributes passed to us.
3420 * @buf: if successful contains the data from the adapter IOREG space. 3425 * @buf: if successful contains the data from the adapter IOREG space.
@@ -3431,7 +3436,8 @@ sysfs_ctlreg_write(struct kobject *kobj, struct bin_attribute *bin_attr,
3431 * value of count, buf contents read 3436 * value of count, buf contents read
3432 **/ 3437 **/
3433static ssize_t 3438static ssize_t
3434sysfs_ctlreg_read(struct kobject *kobj, struct bin_attribute *bin_attr, 3439sysfs_ctlreg_read(struct file *filp, struct kobject *kobj,
3440 struct bin_attribute *bin_attr,
3435 char *buf, loff_t off, size_t count) 3441 char *buf, loff_t off, size_t count)
3436{ 3442{
3437 size_t buf_off; 3443 size_t buf_off;
@@ -3496,6 +3502,7 @@ sysfs_mbox_idle(struct lpfc_hba *phba)
3496 3502
3497/** 3503/**
3498 * sysfs_mbox_write - Write method for writing information via mbox 3504 * sysfs_mbox_write - Write method for writing information via mbox
3505 * @filp: open sysfs file
3499 * @kobj: kernel kobject that contains the kernel class device. 3506 * @kobj: kernel kobject that contains the kernel class device.
3500 * @bin_attr: kernel attributes passed to us. 3507 * @bin_attr: kernel attributes passed to us.
3501 * @buf: contains the data to be written to sysfs mbox. 3508 * @buf: contains the data to be written to sysfs mbox.
@@ -3516,7 +3523,8 @@ sysfs_mbox_idle(struct lpfc_hba *phba)
3516 * count number of bytes transferred 3523 * count number of bytes transferred
3517 **/ 3524 **/
3518static ssize_t 3525static ssize_t
3519sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr, 3526sysfs_mbox_write(struct file *filp, struct kobject *kobj,
3527 struct bin_attribute *bin_attr,
3520 char *buf, loff_t off, size_t count) 3528 char *buf, loff_t off, size_t count)
3521{ 3529{
3522 struct device *dev = container_of(kobj, struct device, kobj); 3530 struct device *dev = container_of(kobj, struct device, kobj);
@@ -3571,6 +3579,7 @@ sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr,
3571 3579
3572/** 3580/**
3573 * sysfs_mbox_read - Read method for reading information via mbox 3581 * sysfs_mbox_read - Read method for reading information via mbox
3582 * @filp: open sysfs file
3574 * @kobj: kernel kobject that contains the kernel class device. 3583 * @kobj: kernel kobject that contains the kernel class device.
3575 * @bin_attr: kernel attributes passed to us. 3584 * @bin_attr: kernel attributes passed to us.
3576 * @buf: contains the data to be read from sysfs mbox. 3585 * @buf: contains the data to be read from sysfs mbox.
@@ -3593,7 +3602,8 @@ sysfs_mbox_write(struct kobject *kobj, struct bin_attribute *bin_attr,
3593 * count number of bytes transferred 3602 * count number of bytes transferred
3594 **/ 3603 **/
3595static ssize_t 3604static ssize_t
3596sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, 3605sysfs_mbox_read(struct file *filp, struct kobject *kobj,
3606 struct bin_attribute *bin_attr,
3597 char *buf, loff_t off, size_t count) 3607 char *buf, loff_t off, size_t count)
3598{ 3608{
3599 struct device *dev = container_of(kobj, struct device, kobj); 3609 struct device *dev = container_of(kobj, struct device, kobj);