ide: switch ide_task_ioctl() to use REQ_TYPE_ATA_TASKFILE requests

Based on the earlier work by Tejun Heo.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <>
parent 813a0eb2
......@@ -806,28 +806,29 @@ abort:
return err;
static int ide_wait_cmd_task(ide_drive_t *drive, u8 *buf)
struct request rq;
rq.cmd_type = REQ_TYPE_ATA_TASK;
rq.buffer = buf;
return ide_do_drive_cmd(drive, &rq, ide_wait);
int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
void __user *p = (void __user *)arg;
int err = 0;
u8 args[7], *argbuf = args;
int argsize = 7;
u8 args[7];
ide_task_t task;
if (copy_from_user(args, p, 7))
return -EFAULT;
err = ide_wait_cmd_task(drive, argbuf);
if (copy_to_user(p, argbuf, argsize))
memset(&task, 0, sizeof(task));
memcpy(&task.tf_array[7], &args[1], 6); = args[0];
err = ide_no_data_taskfile(drive, &task);
args[0] =;
memcpy(&args[1], &task.tf_array[7], 6);
if (copy_to_user(p, args, 7))
err = -EFAULT;
return err;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment