mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: PATCH: linux-2.5.1-pre7/drivers/block/xd.c compilation fix (version 2)
@ 2001-12-09  6:06 Adam J. Richter
  2001-12-09  7:00 ` Keith Owens
  0 siblings, 1 reply; 5+ messages in thread
From: Adam J. Richter @ 2001-12-09  6:06 UTC (permalink / raw)
  To: torvalds; +Cc: ankry, axboe, linux-kernel, pat, tfries

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

>Well, I already applied your previous one, in fact, and it's in the
>just-uploaded pre8 kernel.

	Thanks!

>Mind verifying that and sending the incremental update?

	No problem.  I have attached the one line addition below.

>Btw, do you actually _have_ a machine that uses the xd driver, or was this
>patch done just out of some perverse joy in theoretical retrocomputing?

	Years ago, I submitted a patch to allow configuration of
the kernel with "./configure", which would configure every driver as
a module, aside from compiling in the initial ramdisk and the initial
ramdisk's filesystem.  I haven't configured a kernel for years; the
boot scripts and hot plugging software do that.  The same binary
build of the kernel can run on all of my x86 hardware.

	That is why I know that 92 files failed to compile on x86 in
2.5.1-pre7, and largely why I care about fixing xd.c.

	Anyhow, thanks for asking.  By the way, if you have any interest
in integrating my "./configure" functionality now, I would be happy to
clean it up and resubmit it.  (It is mostly a patch to scripts/Configure.)

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."


--- linux-2.5.1-pre8/drivers/block/xd.c	Sat Dec  8 21:29:50 2001
+++ linux/drivers/block/xd.c	Sat Dec  8 20:19:54 2001
@@ -287,6 +287,7 @@
 		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;

^ permalink raw reply	[flat|nested] 5+ messages in thread
* PATCH: linux-2.5.1-pre7/drivers/block/xd.c compilation fix (version 2)
@ 2001-12-09  4:42 Adam J. Richter
  2001-12-09  4:59 ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Adam J. Richter @ 2001-12-09  4:42 UTC (permalink / raw)
  To: linux-kernel, axboe, pat, tfries, ankry, torvalds

[-- Attachment #1: Type: text/plain, Size: 747 bytes --]

	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."

[-- Attachment #2: xd.patch --]
[-- Type: text/plain, Size: 1469 bytes --]

--- 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");

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-12-09 18:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-09  6:06 PATCH: linux-2.5.1-pre7/drivers/block/xd.c compilation fix (version 2) Adam J. Richter
2001-12-09  7:00 ` Keith Owens
  -- strict thread matches above, loose matches on Subject: below --
2001-12-09  4:42 Adam J. Richter
2001-12-09  4:59 ` Linus Torvalds
2001-12-09 18:08   ` Andrzej Krzysztofowicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®