Blame view
drivers/ide/ide-disk_ioctl.c
957 Bytes
f87904898
|
1 2 3 |
#include <linux/kernel.h> #include <linux/ide.h> #include <linux/hdreg.h> |
2a48fc0ab
|
4 |
#include <linux/mutex.h> |
f87904898
|
5 6 |
#include "ide-disk.h" |
2a48fc0ab
|
7 |
static DEFINE_MUTEX(ide_disk_ioctl_mutex); |
f87904898
|
8 9 10 11 12 13 14 15 |
static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { { HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, &ide_devset_address }, { HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, &ide_devset_multcount }, { HDIO_GET_NOWERR, HDIO_SET_NOWERR, &ide_devset_nowerr }, { HDIO_GET_WCACHE, HDIO_SET_WCACHE, &ide_devset_wcache }, { HDIO_GET_ACOUSTIC, HDIO_SET_ACOUSTIC, &ide_devset_acoustic }, { 0 } }; |
badf8082c
|
16 |
int ide_disk_ioctl(ide_drive_t *drive, struct block_device *bdev, fmode_t mode, |
f87904898
|
17 18 |
unsigned int cmd, unsigned long arg) { |
f87904898
|
19 |
int err; |
2a48fc0ab
|
20 |
mutex_lock(&ide_disk_ioctl_mutex); |
f87904898
|
21 22 |
err = ide_setting_ioctl(drive, bdev, cmd, arg, ide_disk_ioctl_settings); if (err != -EOPNOTSUPP) |
8a6cfeb6d
|
23 |
goto out; |
f87904898
|
24 |
|
8a6cfeb6d
|
25 26 |
err = generic_ide_ioctl(drive, bdev, cmd, arg); out: |
2a48fc0ab
|
27 |
mutex_unlock(&ide_disk_ioctl_mutex); |
8a6cfeb6d
|
28 |
return err; |
f87904898
|
29 |
} |