|
Lines 241-247
Link Here
|
| 241 |
#define LinuxDriverUnlockIoctlPerFD(mutex) do {} while (0) |
241 |
#define LinuxDriverUnlockIoctlPerFD(mutex) do {} while (0) |
| 242 |
#endif |
242 |
#endif |
| 243 |
|
243 |
|
| 244 |
static struct file_operations vmuser_fops; |
244 |
/* |
|
|
245 |
* Moved file operations initialize here because of incompatibilites |
| 246 |
* with Gentoo hardened profile/hardend Linux 3. |
| 247 |
*/ |
| 248 |
static struct file_operations vmuser_fops = { |
| 249 |
.owner = THIS_MODULE, |
| 250 |
.poll = LinuxDriverPoll, |
| 251 |
#ifdef HAVE_UNLOCKED_IOCTL |
| 252 |
.unlocked_ioctl = LinuxDriver_UnlockedIoctl, |
| 253 |
#else |
| 254 |
.ioctl = LinuxDriver_Ioctl, |
| 255 |
#endif |
| 256 |
#ifdef HAVE_COMPAT_IOCTL |
| 257 |
.compat_ioctl = LinuxDriver_UnlockedIoctl, |
| 258 |
#endif |
| 259 |
.open = LinuxDriver_Open, |
| 260 |
.release = LinuxDriver_Close |
| 261 |
}; |
| 245 |
|
262 |
|
| 246 |
|
263 |
|
| 247 |
/* |
264 |
/* |
|
Lines 378-403
Link Here
|
| 378 |
return -ENOMEM; |
395 |
return -ENOMEM; |
| 379 |
} |
396 |
} |
| 380 |
|
397 |
|
| 381 |
/* |
|
|
| 382 |
* Initialize the file_operations structure. Because this code is always |
| 383 |
* compiled as a module, this is fine to do it here and not in a static |
| 384 |
* initializer. |
| 385 |
*/ |
| 386 |
|
| 387 |
memset(&vmuser_fops, 0, sizeof vmuser_fops); |
| 388 |
vmuser_fops.owner = THIS_MODULE; |
| 389 |
vmuser_fops.poll = LinuxDriverPoll; |
| 390 |
#ifdef HAVE_UNLOCKED_IOCTL |
| 391 |
vmuser_fops.unlocked_ioctl = LinuxDriver_UnlockedIoctl; |
| 392 |
#else |
| 393 |
vmuser_fops.ioctl = LinuxDriver_Ioctl; |
| 394 |
#endif |
| 395 |
#ifdef HAVE_COMPAT_IOCTL |
| 396 |
vmuser_fops.compat_ioctl = LinuxDriver_UnlockedIoctl; |
| 397 |
#endif |
| 398 |
vmuser_fops.open = LinuxDriver_Open; |
| 399 |
vmuser_fops.release = LinuxDriver_Close; |
| 400 |
|
| 401 |
sprintf(linuxState.deviceName, "vmci"); |
398 |
sprintf(linuxState.deviceName, "vmci"); |
| 402 |
linuxState.major = 10; |
399 |
linuxState.major = 10; |
| 403 |
linuxState.misc.minor = MISC_DYNAMIC_MINOR; |
400 |
linuxState.misc.minor = MISC_DYNAMIC_MINOR; |