Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usbmon: restore mmap

Paolo asked to enable the mmap. I kept it off because I'm do not
entirely understand how it workse these days after ->nopage etc.
But it seems like working somewhat at least.

Signed-Off-By: Pete Zaitcev <zaitcev@gmail.com>
Cc: Paolo Abeni <paolo.abeni@email.it>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Pete Zaitcev and committed by
Greg Kroah-Hartman
454459b0 d43a05fd

+4 -8
+3 -6
drivers/usb/mon/mon_bin.c
··· 1026 1026 return mask; 1027 1027 } 1028 1028 1029 - #if 0 1030 - 1031 1029 /* 1032 1030 * open and close: just keep track of how many times the device is 1033 1031 * mapped, to use the proper memory allocation function. ··· 1061 1063 return 0; 1062 1064 } 1063 1065 1064 - struct vm_operations_struct mon_bin_vm_ops = { 1066 + static struct vm_operations_struct mon_bin_vm_ops = { 1065 1067 .open = mon_bin_vma_open, 1066 1068 .close = mon_bin_vma_close, 1067 1069 .fault = mon_bin_vma_fault, 1068 1070 }; 1069 1071 1070 - int mon_bin_mmap(struct file *filp, struct vm_area_struct *vma) 1072 + static int mon_bin_mmap(struct file *filp, struct vm_area_struct *vma) 1071 1073 { 1072 1074 /* don't do anything here: "fault" will set up page table entries */ 1073 1075 vma->vm_ops = &mon_bin_vm_ops; ··· 1076 1078 mon_bin_vma_open(vma); 1077 1079 return 0; 1078 1080 } 1079 - 1080 - #endif /* 0 */ 1081 1081 1082 1082 static const struct file_operations mon_fops_binary = { 1083 1083 .owner = THIS_MODULE, ··· 1086 1090 .poll = mon_bin_poll, 1087 1091 .ioctl = mon_bin_ioctl, 1088 1092 .release = mon_bin_release, 1093 + .mmap = mon_bin_mmap, 1089 1094 }; 1090 1095 1091 1096 static int mon_bin_wait_event(struct file *file, struct mon_reader_bin *rp)
+1 -2
drivers/usb/mon/mon_main.c
··· 129 129 130 130 /* 131 131 */ 132 - static void mon_bus_complete(struct mon_bus *mbus, struct urb *urb, 133 - int status) 132 + static void mon_bus_complete(struct mon_bus *mbus, struct urb *urb, int status) 134 133 { 135 134 unsigned long flags; 136 135 struct list_head *pos;