From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Andre Hedrick <andre@linux-ide.org>, Jens Axboe <axboe@suse.de>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (2/4)
Date: Wed, 23 Apr 2003 19:39:09 +0200 (MET DST) [thread overview]
Message-ID: <Pine.SOL.4.30.0304231938460.10502-100000@mion.elka.pw.edu.pl> (raw)
In-Reply-To: <Pine.SOL.4.30.0304231933360.10502-100000@mion.elka.pw.edu.pl>
# Pass bdev to IDE ioctl handlers.
#
# Pass bdev to ide_cmd_ioctl(), ide_task_ioctl() and ide_taskfile_ioctl()
# from generic_ide_ioctl().
#
# Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
diff -uNr linux-2.5.67-ac2-dtf1/drivers/ide/ide-taskfile.c linux/drivers/ide/ide-taskfile.c
--- linux-2.5.67-ac2-dtf1/drivers/ide/ide-taskfile.c Fri Apr 18 02:04:28 2003
+++ linux/drivers/ide/ide-taskfile.c Tue Apr 22 18:43:32 2003
@@ -1056,7 +1056,8 @@
#define MAX_DMA (256*SECTOR_WORDS)
-int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
+int ide_taskfile_ioctl (struct block_device *bdev, ide_drive_t *drive,
+ unsigned int cmd, unsigned long arg)
{
ide_task_request_t *req_task;
ide_task_t args;
@@ -1256,7 +1257,8 @@
/*
* FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
*/
-int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
+int ide_cmd_ioctl (struct block_device *bdev, ide_drive_t *drive,
+ unsigned int cmd, unsigned long arg)
{
#ifndef CONFIG_IDE_TASKFILE_IO
int err = 0;
@@ -1400,7 +1402,8 @@
/*
* FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
*/
-int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
+int ide_task_ioctl (struct block_device *bdev, ide_drive_t *drive,
+ unsigned int cmd, unsigned long arg)
{
int err = 0;
u8 args[7], *argbuf = args;
@@ -1544,7 +1547,8 @@
#ifdef CONFIG_PKT_TASK_IOCTL
-int pkt_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
+int pkt_taskfile_ioctl (struct block_device *bdev, ide_drive_t *drive,
+ unsigned int cmd, unsigned long arg)
{
#if 0
switch(req_task->data_phase) {
diff -uNr linux-2.5.67-ac2-dtf1/drivers/ide/ide.c linux/drivers/ide/ide.c
--- linux-2.5.67-ac2-dtf1/drivers/ide/ide.c Wed Apr 23 15:14:10 2003
+++ linux/drivers/ide/ide.c Wed Apr 23 15:25:13 2003
@@ -1533,29 +1533,47 @@
case HDIO_DRIVE_TASKFILE:
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
return -EACCES;
+ err = bd_claim(bdev, current);
+ if (err)
+ return err;
switch(drive->media) {
case ide_disk:
- return ide_taskfile_ioctl(drive, cmd, arg);
+ err = ide_taskfile_ioctl(bdev, drive, cmd, arg);
+ break;
#ifdef CONFIG_PKT_TASK_IOCTL
case ide_cdrom:
case ide_tape:
case ide_floppy:
- return pkt_taskfile_ioctl(drive, cmd, arg);
+ err = pkt_taskfile_ioctl(bdev, drive, cmd, arg);
+ break;
#endif /* CONFIG_PKT_TASK_IOCTL */
default:
- return -ENOMSG;
+ err = -ENOMSG;
+ break;
}
+ bd_release(bdev);
+ return err;
#endif /* CONFIG_IDE_TASK_IOCTL */
case HDIO_DRIVE_CMD:
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
return -EACCES;
- return ide_cmd_ioctl(drive, cmd, arg);
+ err = bd_claim(bdev, current);
+ if (err)
+ return err;
+ err = ide_cmd_ioctl(bdev, drive, cmd, arg);
+ bd_release(bdev);
+ return err;
case HDIO_DRIVE_TASK:
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
return -EACCES;
- return ide_task_ioctl(drive, cmd, arg);
+ err = bd_claim(bdev, current);
+ if (err)
+ return err;
+ err = ide_task_ioctl(bdev, drive, cmd, arg);
+ bd_release(bdev);
+ return err;
case HDIO_SCAN_HWIF:
{
diff -uNr linux-2.5.67-ac2-dtf1/include/linux/ide.h linux/include/linux/ide.h
--- linux-2.5.67-ac2-dtf1/include/linux/ide.h Fri Apr 18 02:04:12 2003
+++ linux/include/linux/ide.h Tue Apr 22 18:45:56 2003
@@ -1477,9 +1477,9 @@
/* Expects args is a full set of TF registers and parses the command type */
extern int ide_cmd_type_parser(ide_task_t *);
-int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
-int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
-int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
+int ide_taskfile_ioctl(struct block_device *, ide_drive_t *, unsigned int, unsigned long);
+int ide_cmd_ioctl(struct block_device *, ide_drive_t *, unsigned int, unsigned long);
+int ide_task_ioctl(struct block_device *, ide_drive_t *, unsigned int, unsigned long);
#if 0
next prev parent reply other threads:[~2003-04-23 17:29 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-23 17:37 [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:38 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (1/4) Bartlomiej Zolnierkiewicz
2003-04-24 8:23 ` Jens Axboe
2003-04-24 14:46 ` Bartlomiej Zolnierkiewicz
2003-04-24 15:47 ` [PATCH] 2.5.68 fix mismatched access_ok() checks in sg_io() Bartlomiej Zolnierkiewicz
2003-04-24 17:31 ` Jens Axboe
2003-04-23 17:39 ` Bartlomiej Zolnierkiewicz [this message]
2003-04-23 17:39 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (3/4) Bartlomiej Zolnierkiewicz
2003-04-23 17:40 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (4/4) Bartlomiej Zolnierkiewicz
2003-04-24 7:56 ` Jens Axboe
2003-04-23 18:24 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) [resend] Bartlomiej Zolnierkiewicz
2003-04-23 22:35 ` [PATCH] 2.5.67-ac2 direct-IO for IDE taskfile ioctl (0/4) Andrew Morton
2003-04-23 22:09 ` Alan Cox
2003-04-23 22:58 ` Bartlomiej Zolnierkiewicz
2003-04-23 23:13 ` Andries Brouwer
2003-04-23 23:20 ` Andrew Morton
2003-04-24 0:02 ` Bartlomiej Zolnierkiewicz
2003-04-24 6:55 ` Jens Axboe
2003-04-24 2:27 ` Andre Hedrick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.SOL.4.30.0304231938460.10502-100000@mion.elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andre@linux-ide.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).