Skip to contentSkip to conversation

2.5.1-pre4 compile error - pd.c

DISCUSSION Martin A. Brooks 2 participants 5 messages Nov 30, 2001 Block layer

lore
Share & tools
lore
#0 lore raw

gcc -D__KERNEL__ -I/home/martin/kernel-a-day-club/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -c -o pd.o pd.c
pd.c: In function `do_pd_request':
pd.c:856: structure has no member named `bh'
pd.c: In function `pd_next_buf':
pd.c:881: `io_request_lock' undeclared (first use in this function) pd.c:881: (Each undeclared identifier is reported only once pd.c:881: for each function it appears in.)
pd.c: In function `do_pd_read_start':

--

Martin A. Brooks   Systems Administrator
Jtrix Ltd          t: +44 7395 4990
57-59 Neal Street  f: +44 7395 4991
London, WC2H 9PP   e: [email protected]
#1 lore raw
Quoted 11 lines · Martin A. Brooks

gcc -D__KERNEL__ -I/home/martin/kernel-a-day-club/linux/include -Wall

(quoted diff) +0 -3
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686    -c -o pd.o pd.c

pd.c: In function `do_pd_request':
pd.c:856: structure has no member named `bh'
pd.c: In function `pd_next_buf':
pd.c:881: `io_request_lock' undeclared (first use in this function) pd.c:881: (Each undeclared identifier is reported only once pd.c:881: for each function it appears in.)
pd.c: In function `do_pd_read_start':

Please try this diff.

drivers/block/paride/pd.c renamed from opt/kernel/linux-2.5.1-pre4/drivers/block/paride/pd.c +18 -21
diff -ur /opt/kernel/linux-2.5.1-pre4/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
@@ -838,8 +838,7 @@
 }
 
 static void do_pd_request (request_queue_t * q)
-
-{       struct buffer_head * bh;
+{
 	int	unit;
 
         if (pd_busy) return;
@@ -853,8 +852,6 @@
         pd_run = CURRENT->nr_sectors;
         pd_count = CURRENT->current_nr_sectors;
 
-	bh = CURRENT->bh;
-
         if ((pd_dev >= PD_DEVS) || 
 	    ((pd_block+pd_count) > pd_hd[pd_dev].nr_sects)) {
                 end_request(0);
@@ -878,9 +875,9 @@
 
 {	long	saved_flags;
 
-	spin_lock_irqsave(&io_request_lock,saved_flags);
+	spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
 	end_request(1);
-	if (!pd_run) {  spin_unlock_irqrestore(&io_request_lock,saved_flags);
+	if (!pd_run) {  spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
 			return; 
 	}
 	
@@ -896,7 +893,7 @@
 
 	pd_count = CURRENT->current_nr_sectors;
 	pd_buf = CURRENT->buffer;
-	spin_unlock_irqrestore(&io_request_lock,saved_flags);
+	spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
 }
 
 static void do_pd_read( void )
@@ -919,11 +916,11 @@
                         pi_do_claimed(PI,do_pd_read_start);
 			return;
                 }
-		spin_lock_irqsave(&io_request_lock,saved_flags);
+		spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
                 end_request(0);
                 pd_busy = 0;
 		do_pd_request(NULL);
-		spin_unlock_irqrestore(&io_request_lock,saved_flags);
+		spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
                 return;
         }
         pd_ide_command(unit,IDE_READ,pd_block,pd_run);
@@ -943,11 +940,11 @@
                         pi_do_claimed(PI,do_pd_read_start);
                         return;
                 }
-		spin_lock_irqsave(&io_request_lock,saved_flags);
+		spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
                 end_request(0);
                 pd_busy = 0;
 		do_pd_request(NULL);
-		spin_unlock_irqrestore(&io_request_lock,saved_flags);
+		spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
                 return;
             }
             pi_read_block(PI,pd_buf,512);
@@ -958,11 +955,11 @@
 	    if (!pd_count) pd_next_buf(unit);
         }
         pi_disconnect(PI);
-	spin_lock_irqsave(&io_request_lock,saved_flags);
+	spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
         end_request(1);
         pd_busy = 0;
 	do_pd_request(NULL);
-	spin_unlock_irqrestore(&io_request_lock,saved_flags);
+	spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
 }
 
 static void do_pd_write( void )
@@ -985,11 +982,11 @@
 			pi_do_claimed(PI,do_pd_write_start);
                         return;
                 }
-		spin_lock_irqsave(&io_request_lock,saved_flags);
+		spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
                 end_request(0);
                 pd_busy = 0;
 		do_pd_request(NULL);
-		spin_unlock_irqrestore(&io_request_lock,saved_flags);
+		spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
                 return;
         }
         pd_ide_command(unit,IDE_WRITE,pd_block,pd_run);
@@ -1001,11 +998,11 @@
                         pi_do_claimed(PI,do_pd_write_start);
                         return;
                 }
-		spin_lock_irqsave(&io_request_lock,saved_flags);
+		spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
                 end_request(0);
                 pd_busy = 0;
 		do_pd_request(NULL);
-                spin_unlock_irqrestore(&io_request_lock,saved_flags);
+                spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
 		return;
             }
             pi_write_block(PI,pd_buf,512);
@@ -1030,19 +1027,19 @@
                         pi_do_claimed(PI,do_pd_write_start);
                         return;
                 }
-		spin_lock_irqsave(&io_request_lock,saved_flags);
+		spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
                 end_request(0);
                 pd_busy = 0;
 		do_pd_request(NULL);
-		spin_unlock_irqrestore(&io_request_lock,saved_flags);
+		spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
                 return;
         }
         pi_disconnect(PI);
-	spin_lock_irqsave(&io_request_lock,saved_flags);
+	spin_lock_irqsave(&QUEUE->queue_lock,saved_flags);
         end_request(1);
         pd_busy = 0;
 	do_pd_request(NULL);
-	spin_unlock_irqrestore(&io_request_lock,saved_flags);
+	spin_unlock_irqrestore(&QUEUE->queue_lock,saved_flags);
 }
 
 /* end of pd.c */
drivers/block/paride/pf.c renamed from opt/kernel/linux-2.5.1-pre4/drivers/block/paride/pf.c +19 -74

190 lines not on this page · raw message

Signature · 1 line
Jens Axboe, breaking drivers much faster than fixing them
#2 lore raw
Quoted 2 lines

Please try this diff.

That seems to fix that error, but I now get a (possibly related) error elsewhere.

gcc -D__KERNEL__ -I/home/martin/kernel-a-day-club/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -c -o xd.o xd.c
xd.c: In function `xd_geninit':
xd.c:250: `max_sectors' undeclared (first use in this function) xd.c:250: (Each undeclared identifier is reported only once xd.c:250: for each function it appears in.)
make[3]: *** [xd.o] Error 1

--

Martin A. Brooks   Systems Administrator
Jtrix Ltd          t: +44 7395 4990
57-59 Neal Street  f: +44 7395 4991
London, WC2H 9PP   e: [email protected]
#3 lore raw
In reply to Jens Axboe
Quoted 11 lines · Martin A. Brooks
Quoted 2 lines

Please try this diff.

That seems to fix that error, but I now get a (possibly related) error elsewhere.

gcc -D__KERNEL__ -I/home/martin/kernel-a-day-club/linux/include -Wall

(quoted diff) +0 -3
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686    -c -o xd.o xd.c
Quoted 5 lines

xd.c: In function `xd_geninit':
xd.c:250: `max_sectors' undeclared (first use in this function) xd.c:250: (Each undeclared identifier is reported only once xd.c:250: for each function it appears in.)
make[3]: *** [xd.o] Error 1

max_sectors has been moved into the queue. So when you did this before

max_sectors[dev indexing] = max_sectors_in_request

you now do

q = blk_get_queue(dev);
blk_queue_max_sectors(max_sectors_in_request);

Signature · 1 line
Jens Axboe
#4 lore raw
Quoted 9 lines

max_sectors has been moved into the queue. So when you did this before

max_sectors[dev indexing] = max_sectors_in_request

you now do

q = blk_get_queue(dev);
blk_queue_max_sectors(max_sectors_in_request);

I'm sure you're right, but I'm no kernel hacker. Just a chimp with a compiler :)

--

Martin A. Brooks   Systems Administrator
Jtrix Ltd          t: +44 7395 4990
57-59 Neal Street  f: +44 7395 4991
London, WC2H 9PP   e: [email protected]