PATCH: linux-2.5.1-pre7/drivers/block/xd.c compilation fix (version 2)

Adam J. Richter (adam@yggdrasil.com)
Sat, 8 Dec 2001 20:42:25 -0800


--XsQoSWH+UP9D9v3l
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Per the advice of Jens Axboe, I have added one line to my
previous fix to make linux-2.5.1-pre7/drivers/block/xd.c compile
(the "&& (CURRENT->flags & REQ_CMD)" line). Here is the diff
against pristine linux-2.5.1-pre7/drivers/block/xd.c.

There is no maintainer for xd.c listed in linux/MAINTAINERS,
although I am and have been mailing to the email addresses that appear
in xd.c.

Linus, if nobody says otherwise, I recommend that you apply
this patch.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

--XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xd.patch"

--- linux-2.5.1-pre7/drivers/block/xd.c Fri Dec 7 19:37:41 2001 +++ linux/drivers/block/xd.c Sat Dec 8 20:28:14 2001 @@ -121,7 +121,6 @@ static struct hd_struct xd_struct[XD_MAXDRIVES << 6]; static int xd_sizes[XD_MAXDRIVES << 6], xd_access[XD_MAXDRIVES]; static int xd_blocksizes[XD_MAXDRIVES << 6]; -static int xd_maxsect[XD_MAXDRIVES << 6]; extern struct block_device_operations xd_fops; @@ -246,8 +245,7 @@ } /* xd_maxsectors depends on controller - so set after detection */ - for(i=0; i<(XD_MAXDRIVES << 6); i++) xd_maxsect[i] = xd_maxsectors; - max_sectors[MAJOR_NR] = xd_maxsect; + blk_queue_max_sectors(BLK_DEFAULT_QUEUE(MAJOR_NR), xd_maxsectors); for (i = 0; i < xd_drives; i++) { xd_valid[i] = 1; @@ -289,16 +287,17 @@ INIT_REQUEST; /* do some checking on the request structure */ if (CURRENT_DEV < xd_drives + && (CURRENT->flags & REQ_CMD) && CURRENT->sector + CURRENT->nr_sectors <= xd_struct[MINOR(CURRENT->rq_dev)].nr_sects) { block = CURRENT->sector; count = CURRENT->nr_sectors; - switch (CURRENT->cmd) { + switch (rq_data_dir(CURRENT)) { case READ: case WRITE: for (retry = 0; (retry < XD_RETRIES) && !code; retry++) - code = xd_readwrite(CURRENT->cmd,CURRENT_DEV,CURRENT->buffer,block,count); + code = xd_readwrite(rq_data_dir(CURRENT),CURRENT_DEV,CURRENT->buffer,block,count); break; default: printk("do_xd_request: unknown request\n");

--XsQoSWH+UP9D9v3l-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/