aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/pci-sysfs.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 /arch/alpha/kernel/pci-sysfs.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 'arch/alpha/kernel/pci-sysfs.c')
-rw-r--r--arch/alpha/kernel/pci-sysfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c
index d979e7c7bc4b..a5fffc882c72 100644
--- a/arch/alpha/kernel/pci-sysfs.c
+++ b/arch/alpha/kernel/pci-sysfs.c
@@ -53,6 +53,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
53 53
54/** 54/**
55 * pci_mmap_resource - map a PCI resource into user memory space 55 * pci_mmap_resource - map a PCI resource into user memory space
56 * @filp: open sysfs file
56 * @kobj: kobject for mapping 57 * @kobj: kobject for mapping
57 * @attr: struct bin_attribute for the file being mapped 58 * @attr: struct bin_attribute for the file being mapped
58 * @vma: struct vm_area_struct passed into the mmap 59 * @vma: struct vm_area_struct passed into the mmap
@@ -60,7 +61,8 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
60 * 61 *
61 * Use the bus mapping routines to map a PCI resource into userspace. 62 * Use the bus mapping routines to map a PCI resource into userspace.
62 */ 63 */
63static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr, 64static int pci_mmap_resource(struct file *filp, struct kobject *kobj,
65 struct bin_attribute *attr,
64 struct vm_area_struct *vma, int sparse) 66 struct vm_area_struct *vma, int sparse)
65{ 67{
66 struct pci_dev *pdev = to_pci_dev(container_of(kobj, 68 struct pci_dev *pdev = to_pci_dev(container_of(kobj,
@@ -89,14 +91,14 @@ static int pci_mmap_resource(struct kobject *kobj, struct bin_attribute *attr,
89 return hose_mmap_page_range(pdev->sysdata, vma, mmap_type, sparse); 91 return hose_mmap_page_range(pdev->sysdata, vma, mmap_type, sparse);
90} 92}
91 93
92static int pci_mmap_resource_sparse(struct kobject *kobj, 94static int pci_mmap_resource_sparse(struct file *filp, struct kobject *kobj,
93 struct bin_attribute *attr, 95 struct bin_attribute *attr,
94 struct vm_area_struct *vma) 96 struct vm_area_struct *vma)
95{ 97{
96 return pci_mmap_resource(kobj, attr, vma, 1); 98 return pci_mmap_resource(kobj, attr, vma, 1);
97} 99}
98 100
99static int pci_mmap_resource_dense(struct kobject *kobj, 101static int pci_mmap_resource_dense(struct file *filp, struct kobject *kobj,
100 struct bin_attribute *attr, 102 struct bin_attribute *attr,
101 struct vm_area_struct *vma) 103 struct vm_area_struct *vma)
102{ 104{