Commit 4fe6433a authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] (14/14) resync

end_request(int) turned to end_request(req, int); all old callers
are converted to end_request(CURRENT, value).  Now we can start
killing CURRENT/QUEUE - end_request() was the last obstacle to
that.
parent 718e92c5
...@@ -983,33 +983,35 @@ static void do_stram_request(request_queue_t *q) ...@@ -983,33 +983,35 @@ static void do_stram_request(request_queue_t *q)
unsigned long len; unsigned long len;
while (1) { while (1) {
struct request *req;
if (blk_queue_empty(QUEUE)) if (blk_queue_empty(QUEUE))
return; return;
start = swap_start + (CURRENT->sector << 9); req = CURRENT;
len = CURRENT->current_nr_sectors << 9; start = swap_start + (req->sector << 9);
len = req->current_nr_sectors << 9;
if ((start + len) > swap_end) { if ((start + len) > swap_end) {
printk( KERN_ERR "stram: bad access beyond end of device: " printk( KERN_ERR "stram: bad access beyond end of device: "
"block=%ld, count=%ld\n", "block=%ld, count=%ld\n",
CURRENT->sector, req->sector,
CURRENT->current_nr_sectors ); req->current_nr_sectors );
end_request( 0 ); end_request(req, 0);
continue; continue;
} }
if (CURRENT->cmd == READ) { if (req->cmd == READ) {
memcpy(CURRENT->buffer, start, len); memcpy(req->buffer, start, len);
#ifdef DO_PROC #ifdef DO_PROC
stat_swap_read += N_PAGES(len); stat_swap_read += N_PAGES(len);
#endif #endif
} }
else { else {
memcpy(start, CURRENT->buffer, len); memcpy(start, req->buffer, len);
#ifdef DO_PROC #ifdef DO_PROC
stat_swap_write += N_PAGES(len); stat_swap_write += N_PAGES(len);
#endif #endif
} }
end_request( 1 ); end_request(req, 1);
} }
} }
......
...@@ -598,7 +598,7 @@ static void fd_error(void) ...@@ -598,7 +598,7 @@ static void fd_error(void)
CURRENT->errors++; CURRENT->errors++;
if (CURRENT->errors >= MAX_ERRORS) { if (CURRENT->errors >= MAX_ERRORS) {
printk("fd%d: too many errors.\n", SelectedDrive); printk("fd%d: too many errors.\n", SelectedDrive);
end_request(0); end_request(CURRENT, 0);
} else if (CURRENT->errors == RECALIBRATE_ERRORS) { } else if (CURRENT->errors == RECALIBRATE_ERRORS) {
printk("fd%d: recalibrating\n", SelectedDrive); printk("fd%d: recalibrating\n", SelectedDrive);
if (SelectedDrive != -1) if (SelectedDrive != -1)
...@@ -623,23 +623,25 @@ static void fd_error(void) ...@@ -623,23 +623,25 @@ static void fd_error(void)
static void do_fd_action(int drive) static void do_fd_action(int drive)
{ {
struct request *req;
DPRINT(("do_fd_action unit[drive].track=%d\n", unit[drive].track)); DPRINT(("do_fd_action unit[drive].track=%d\n", unit[drive].track));
#ifdef TRACKBUFFER #ifdef TRACKBUFFER
repeat: repeat:
if (IS_BUFFERED( drive, ReqSide, ReqTrack )) { if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
req = CURRENT;
if (ReqCmd == READ) { if (ReqCmd == READ) {
copy_buffer( SECTOR_BUFFER(ReqSector), ReqData ); copy_buffer( SECTOR_BUFFER(ReqSector), ReqData );
if (++ReqCnt < CURRENT->current_nr_sectors) { if (++ReqCnt < req->current_nr_sectors) {
/* read next sector */ /* read next sector */
setup_req_params( drive ); setup_req_params( drive );
goto repeat; goto repeat;
} else { } else {
/* all sectors finished */ /* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors; req->nr_sectors -= req->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors; req->sector += req->current_nr_sectors;
end_request( 1 ); end_request(req, 1);
redo_fd_request(); redo_fd_request();
return; return;
} }
...@@ -1022,7 +1024,7 @@ static void fd_rwsec_done(int status) ...@@ -1022,7 +1024,7 @@ static void fd_rwsec_done(int status)
/* all sectors finished */ /* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors; CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
end_request(1); end_request(CURRENT, 1);
redo_fd_request(); redo_fd_request();
} }
return; return;
...@@ -1234,7 +1236,7 @@ static void redo_fd_request(void) ...@@ -1234,7 +1236,7 @@ static void redo_fd_request(void)
if (!floppy->connected) { if (!floppy->connected) {
/* drive not connected */ /* drive not connected */
printk("Unknown Device: fd%d\n", drive); printk("Unknown Device: fd%d\n", drive);
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
if (type == 0) { if (type == 0) {
...@@ -1249,7 +1251,7 @@ static void redo_fd_request(void) ...@@ -1249,7 +1251,7 @@ static void redo_fd_request(void)
--type; --type;
if (type >= NUM_DISK_TYPES) { if (type >= NUM_DISK_TYPES) {
printk("fd%d: invalid disk format", drive); printk("fd%d: invalid disk format", drive);
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
floppy->disktype = &disk_type[type]; floppy->disktype = &disk_type[type];
...@@ -1258,7 +1260,7 @@ static void redo_fd_request(void) ...@@ -1258,7 +1260,7 @@ static void redo_fd_request(void)
} }
if (CURRENT->sector + 1 > floppy->disktype->blocks) { if (CURRENT->sector + 1 > floppy->disktype->blocks) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
/* stop deselect timer */ /* stop deselect timer */
......
...@@ -512,7 +512,7 @@ static void mfm_rw_intr(void) ...@@ -512,7 +512,7 @@ static void mfm_rw_intr(void)
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
SectorsLeftInRequest -= CURRENT->current_nr_sectors; SectorsLeftInRequest -= CURRENT->current_nr_sectors;
end_request(1); end_request(CURRENT, 1);
if (SectorsLeftInRequest) { if (SectorsLeftInRequest) {
hdc63463_dataptr = (unsigned int) CURRENT->buffer; hdc63463_dataptr = (unsigned int) CURRENT->buffer;
Copy_buffer = CURRENT->buffer; Copy_buffer = CURRENT->buffer;
...@@ -735,7 +735,7 @@ static void request_done(int uptodate) ...@@ -735,7 +735,7 @@ static void request_done(int uptodate)
/* Apparently worked - let's check bytes left to DMA */ /* Apparently worked - let's check bytes left to DMA */
if (hdc63463_dataleft != (PartFragRead_SectorsLeft * 256)) { if (hdc63463_dataleft != (PartFragRead_SectorsLeft * 256)) {
printk("mfm: request_done - dataleft=%d - should be %d - Eek!\n", hdc63463_dataleft, PartFragRead_SectorsLeft * 256); printk("mfm: request_done - dataleft=%d - should be %d - Eek!\n", hdc63463_dataleft, PartFragRead_SectorsLeft * 256);
end_request(0); end_request(CURRENT, 0);
Busy = 0; Busy = 0;
}; };
/* Potentially this means that we've done; but we might be doing /* Potentially this means that we've done; but we might be doing
...@@ -768,7 +768,7 @@ static void request_done(int uptodate) ...@@ -768,7 +768,7 @@ static void request_done(int uptodate)
DBG("request_done: returned from mfm_request\n"); DBG("request_done: returned from mfm_request\n");
} else { } else {
printk("mfm:request_done: update=0\n"); printk("mfm:request_done: update=0\n");
end_request(0); end_request(CURRENT, 0);
Busy = 0; Busy = 0;
} }
} }
...@@ -930,7 +930,7 @@ static void mfm_request(void) ...@@ -930,7 +930,7 @@ static void mfm_request(void)
printk("mfm%c: bad access: block=%d, count=%d, nr_sects=%ld\n", (dev >> 6)+'a', printk("mfm%c: bad access: block=%d, count=%d, nr_sects=%ld\n", (dev >> 6)+'a',
block, nsect, mfm[dev].nr_sects); block, nsect, mfm[dev].nr_sects);
printk("mfm: continue 1\n"); printk("mfm: continue 1\n");
end_request(0); end_request(CURRENT, 0);
Busy = 0; Busy = 0;
continue; continue;
} }
...@@ -951,7 +951,7 @@ static void mfm_request(void) ...@@ -951,7 +951,7 @@ static void mfm_request(void)
if (CURRENT->cmd != READ && CURRENT->cmd != WRITE) { if (CURRENT->cmd != READ && CURRENT->cmd != WRITE) {
printk("unknown mfm-command %d\n", CURRENT->cmd); printk("unknown mfm-command %d\n", CURRENT->cmd);
end_request(0); end_request(CURRENT, 0);
Busy = 0; Busy = 0;
printk("mfm: continue 4\n"); printk("mfm: continue 4\n");
continue; continue;
......
...@@ -775,7 +775,7 @@ static void bad_rw_intr( void ) ...@@ -775,7 +775,7 @@ static void bad_rw_intr( void )
return; return;
if (++CURRENT->errors >= MAX_ERRORS) if (++CURRENT->errors >= MAX_ERRORS)
end_request(0); end_request(CURRENT, 0);
/* Otherwise just retry */ /* Otherwise just retry */
} }
...@@ -851,7 +851,7 @@ static void acsi_times_out( unsigned long dummy ) ...@@ -851,7 +851,7 @@ static void acsi_times_out( unsigned long dummy )
#ifdef DEBUG #ifdef DEBUG
printk( KERN_ERR "ACSI: too many errors.\n" ); printk( KERN_ERR "ACSI: too many errors.\n" );
#endif #endif
end_request(0); end_request(CURRENT, 0);
} }
redo_acsi_request(); redo_acsi_request();
...@@ -919,7 +919,7 @@ static void do_end_requests( void ) ...@@ -919,7 +919,7 @@ static void do_end_requests( void )
CURRENT->current_nr_sectors -= CurrentNSect; CURRENT->current_nr_sectors -= CurrentNSect;
CURRENT->sector += CurrentNSect; CURRENT->sector += CurrentNSect;
if (CURRENT->nr_sectors == 0) if (CURRENT->nr_sectors == 0)
end_request(1); end_request(CURRENT, 1);
} }
else { else {
for( i = 0; i < CurrentNReq; ++i ) { for( i = 0; i < CurrentNReq; ++i ) {
...@@ -927,7 +927,7 @@ static void do_end_requests( void ) ...@@ -927,7 +927,7 @@ static void do_end_requests( void )
CURRENT->nr_sectors -= n; CURRENT->nr_sectors -= n;
CURRENT->current_nr_sectors -= n; CURRENT->current_nr_sectors -= n;
CURRENT->sector += n; CURRENT->sector += n;
end_request(1); end_request(CURRENT, 1);
} }
} }
} }
...@@ -986,13 +986,13 @@ static void redo_acsi_request( void ) ...@@ -986,13 +986,13 @@ static void redo_acsi_request( void )
block, block + CURRENT->nr_sectors - 1, block, block + CURRENT->nr_sectors - 1,
acsi_part[dev].nr_sects); acsi_part[dev].nr_sects);
#endif #endif
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
if (acsi_info[DEVICE_NR(dev)].changed) { if (acsi_info[DEVICE_NR(dev)].changed) {
printk( KERN_NOTICE "ad%c: request denied because cartridge has " printk( KERN_NOTICE "ad%c: request denied because cartridge has "
"been changed.\n", DEVICE_NR(dev)+'a' ); "been changed.\n", DEVICE_NR(dev)+'a' );
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
......
...@@ -1407,7 +1407,7 @@ static void redo_fd_request(void) ...@@ -1407,7 +1407,7 @@ static void redo_fd_request(void)
#endif #endif
block = CURRENT->sector + cnt; block = CURRENT->sector + cnt;
if ((int)block > floppy->blocks) { if ((int)block > floppy->blocks) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -1421,11 +1421,11 @@ static void redo_fd_request(void) ...@@ -1421,11 +1421,11 @@ static void redo_fd_request(void)
if ((rq_data_dir(CURRENT) != READ) && (rq_data_dir(CURRENT) != WRITE)) { if ((rq_data_dir(CURRENT) != READ) && (rq_data_dir(CURRENT) != WRITE)) {
printk(KERN_WARNING "do_fd_request: unknown command\n"); printk(KERN_WARNING "do_fd_request: unknown command\n");
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
if (get_track(drive, track) == -1) { if (get_track(drive, track) == -1) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -1439,7 +1439,7 @@ static void redo_fd_request(void) ...@@ -1439,7 +1439,7 @@ static void redo_fd_request(void)
/* keep the drive spinning while writes are scheduled */ /* keep the drive spinning while writes are scheduled */
if (!fd_motor_on(drive)) { if (!fd_motor_on(drive)) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
/* /*
...@@ -1462,7 +1462,7 @@ static void redo_fd_request(void) ...@@ -1462,7 +1462,7 @@ static void redo_fd_request(void)
CURRENT->nr_sectors -= CURRENT->current_nr_sectors; CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
end_request(1); end_request(CURRENT, 1);
goto repeat; goto repeat;
} }
......
...@@ -634,7 +634,7 @@ static void fd_error( void ) ...@@ -634,7 +634,7 @@ static void fd_error( void )
CURRENT->errors++; CURRENT->errors++;
if (CURRENT->errors >= MAX_ERRORS) { if (CURRENT->errors >= MAX_ERRORS) {
printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive ); printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive );
end_request( 0 ); end_request(CURRENT, 0);
} }
else if (CURRENT->errors == RECALIBRATE_ERRORS) { else if (CURRENT->errors == RECALIBRATE_ERRORS) {
printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive ); printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive );
...@@ -759,7 +759,7 @@ static void do_fd_action( int drive ) ...@@ -759,7 +759,7 @@ static void do_fd_action( int drive )
/* all sectors finished */ /* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors; CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
end_request( 1 ); end_request(CURRENT, 1);
redo_fd_request(); redo_fd_request();
return; return;
} }
...@@ -1166,7 +1166,7 @@ static void fd_rwsec_done1(int status) ...@@ -1166,7 +1166,7 @@ static void fd_rwsec_done1(int status)
/* all sectors finished */ /* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors; CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
end_request( 1 ); end_request(CURRENT, 1);
redo_fd_request(); redo_fd_request();
} }
return; return;
...@@ -1468,7 +1468,7 @@ static void redo_fd_request(void) ...@@ -1468,7 +1468,7 @@ static void redo_fd_request(void)
if (!UD.connected) { if (!UD.connected) {
/* drive not connected */ /* drive not connected */
printk(KERN_ERR "Unknown Device: fd%d\n", drive ); printk(KERN_ERR "Unknown Device: fd%d\n", drive );
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -1484,12 +1484,12 @@ static void redo_fd_request(void) ...@@ -1484,12 +1484,12 @@ static void redo_fd_request(void)
/* user supplied disk type */ /* user supplied disk type */
if (--type >= NUM_DISK_MINORS) { if (--type >= NUM_DISK_MINORS) {
printk(KERN_WARNING "fd%d: invalid disk format", drive ); printk(KERN_WARNING "fd%d: invalid disk format", drive );
end_request( 0 ); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
if (minor2disktype[type].drive_types > DriveType) { if (minor2disktype[type].drive_types > DriveType) {
printk(KERN_WARNING "fd%d: unsupported disk format", drive ); printk(KERN_WARNING "fd%d: unsupported disk format", drive );
end_request( 0 ); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
type = minor2disktype[type].index; type = minor2disktype[type].index;
...@@ -1499,7 +1499,7 @@ static void redo_fd_request(void) ...@@ -1499,7 +1499,7 @@ static void redo_fd_request(void)
} }
if (CURRENT->sector + 1 > UDT->blocks) { if (CURRENT->sector + 1 > UDT->blocks) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
......
...@@ -775,7 +775,7 @@ static void do_pcd_request (request_queue_t * q) ...@@ -775,7 +775,7 @@ static void do_pcd_request (request_queue_t * q)
ps_set_intr(do_pcd_read,0,0,nice); ps_set_intr(do_pcd_read,0,0,nice);
return; return;
} }
else end_request(0); else end_request(CURRENT, 0);
} }
} }
...@@ -817,7 +817,7 @@ static void pcd_start( void ) ...@@ -817,7 +817,7 @@ static void pcd_start( void )
pcd_bufblk = -1; pcd_bufblk = -1;
spin_lock_irqsave(&pcd_lock,saved_flags); spin_lock_irqsave(&pcd_lock,saved_flags);
pcd_busy = 0; pcd_busy = 0;
end_request(0); end_request(CURRENT, 0);
do_pcd_request(NULL); do_pcd_request(NULL);
spin_unlock_irqrestore(&pcd_lock,saved_flags); spin_unlock_irqrestore(&pcd_lock,saved_flags);
return; return;
...@@ -840,7 +840,7 @@ static void do_pcd_read( void ) ...@@ -840,7 +840,7 @@ static void do_pcd_read( void )
pcd_transfer(); pcd_transfer();
if (!pcd_count) { if (!pcd_count) {
spin_lock_irqsave(&pcd_lock,saved_flags); spin_lock_irqsave(&pcd_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
pcd_busy = 0; pcd_busy = 0;
do_pcd_request(NULL); do_pcd_request(NULL);
spin_unlock_irqrestore(&pcd_lock,saved_flags); spin_unlock_irqrestore(&pcd_lock,saved_flags);
...@@ -865,7 +865,7 @@ static void do_pcd_read_drq( void ) ...@@ -865,7 +865,7 @@ static void do_pcd_read_drq( void )
spin_lock_irqsave(&pcd_lock,saved_flags); spin_lock_irqsave(&pcd_lock,saved_flags);
pcd_busy = 0; pcd_busy = 0;
pcd_bufblk = -1; pcd_bufblk = -1;
end_request(0); end_request(CURRENT, 0);
do_pcd_request(NULL); do_pcd_request(NULL);
spin_unlock_irqrestore(&pcd_lock,saved_flags); spin_unlock_irqrestore(&pcd_lock,saved_flags);
return; return;
......
...@@ -845,7 +845,7 @@ static void do_pd_request (request_queue_t * q) ...@@ -845,7 +845,7 @@ static void do_pd_request (request_queue_t * q)
if ((pd_dev >= PD_DEVS) || if ((pd_dev >= PD_DEVS) ||
((pd_block+pd_count) > pd_hd[pd_dev].nr_sects)) { ((pd_block+pd_count) > pd_hd[pd_dev].nr_sects)) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -857,7 +857,7 @@ static void do_pd_request (request_queue_t * q) ...@@ -857,7 +857,7 @@ static void do_pd_request (request_queue_t * q)
if (pd_cmd == READ) pi_do_claimed(PI,do_pd_read); if (pd_cmd == READ) pi_do_claimed(PI,do_pd_read);
else if (pd_cmd == WRITE) pi_do_claimed(PI,do_pd_write); else if (pd_cmd == WRITE) pi_do_claimed(PI,do_pd_write);
else { pd_busy = 0; else { pd_busy = 0;
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
} }
...@@ -867,7 +867,7 @@ static void pd_next_buf( int unit ) ...@@ -867,7 +867,7 @@ static void pd_next_buf( int unit )
{ long saved_flags; { long saved_flags;
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
if (!pd_run) { spin_unlock_irqrestore(&pd_lock,saved_flags); if (!pd_run) { spin_unlock_irqrestore(&pd_lock,saved_flags);
return; return;
} }
...@@ -907,7 +907,7 @@ static void do_pd_read_start( void ) ...@@ -907,7 +907,7 @@ static void do_pd_read_start( void )
return; return;
} }
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -931,7 +931,7 @@ static void do_pd_read_drq( void ) ...@@ -931,7 +931,7 @@ static void do_pd_read_drq( void )
return; return;
} }
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -946,7 +946,7 @@ static void do_pd_read_drq( void ) ...@@ -946,7 +946,7 @@ static void do_pd_read_drq( void )
} }
pi_disconnect(PI); pi_disconnect(PI);
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -973,7 +973,7 @@ static void do_pd_write_start( void ) ...@@ -973,7 +973,7 @@ static void do_pd_write_start( void )
return; return;
} }
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -989,7 +989,7 @@ static void do_pd_write_start( void ) ...@@ -989,7 +989,7 @@ static void do_pd_write_start( void )
return; return;
} }
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -1018,7 +1018,7 @@ static void do_pd_write_done( void ) ...@@ -1018,7 +1018,7 @@ static void do_pd_write_done( void )
return; return;
} }
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
...@@ -1026,7 +1026,7 @@ static void do_pd_write_done( void ) ...@@ -1026,7 +1026,7 @@ static void do_pd_write_done( void )
} }
pi_disconnect(PI); pi_disconnect(PI);
spin_lock_irqsave(&pd_lock,saved_flags); spin_lock_irqsave(&pd_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
pd_busy = 0; pd_busy = 0;
do_pd_request(NULL); do_pd_request(NULL);
spin_unlock_irqrestore(&pd_lock,saved_flags); spin_unlock_irqrestore(&pd_lock,saved_flags);
......
...@@ -849,7 +849,7 @@ static void do_pf_request (request_queue_t * q) ...@@ -849,7 +849,7 @@ static void do_pf_request (request_queue_t * q)
pf_count = CURRENT->current_nr_sectors; pf_count = CURRENT->current_nr_sectors;
if ((pf_unit >= PF_UNITS) || (pf_block+pf_count > PF.capacity)) { if ((pf_unit >= PF_UNITS) || (pf_block+pf_count > PF.capacity)) {
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -861,7 +861,7 @@ static void do_pf_request (request_queue_t * q) ...@@ -861,7 +861,7 @@ static void do_pf_request (request_queue_t * q)
if (pf_cmd == READ) pi_do_claimed(PI,do_pf_read); if (pf_cmd == READ) pi_do_claimed(PI,do_pf_read);
else if (pf_cmd == WRITE) pi_do_claimed(PI,do_pf_write); else if (pf_cmd == WRITE) pi_do_claimed(PI,do_pf_write);
else { pf_busy = 0; else { pf_busy = 0;
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
} }
...@@ -871,7 +871,7 @@ static void pf_next_buf( int unit ) ...@@ -871,7 +871,7 @@ static void pf_next_buf( int unit )
{ long saved_flags; { long saved_flags;
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
if (!pf_run) { spin_unlock_irqrestore(&pf_spin_lock,saved_flags); if (!pf_run) { spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
return; return;
} }
...@@ -912,7 +912,7 @@ static void do_pf_read_start( void ) ...@@ -912,7 +912,7 @@ static void do_pf_read_start( void )
return; return;
} }
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -938,7 +938,7 @@ static void do_pf_read_drq( void ) ...@@ -938,7 +938,7 @@ static void do_pf_read_drq( void )
return; return;
} }
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -953,7 +953,7 @@ static void do_pf_read_drq( void ) ...@@ -953,7 +953,7 @@ static void do_pf_read_drq( void )
} }
pi_disconnect(PI); pi_disconnect(PI);
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -979,7 +979,7 @@ static void do_pf_write_start( void ) ...@@ -979,7 +979,7 @@ static void do_pf_write_start( void )
return; return;
} }
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -996,7 +996,7 @@ static void do_pf_write_start( void ) ...@@ -996,7 +996,7 @@ static void do_pf_write_start( void )
return; return;
} }
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -1026,7 +1026,7 @@ static void do_pf_write_done( void ) ...@@ -1026,7 +1026,7 @@ static void do_pf_write_done( void )
return; return;
} }
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(0); end_request(CURRENT, 0);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
...@@ -1034,7 +1034,7 @@ static void do_pf_write_done( void ) ...@@ -1034,7 +1034,7 @@ static void do_pf_write_done( void )
} }
pi_disconnect(PI); pi_disconnect(PI);
spin_lock_irqsave(&pf_spin_lock,saved_flags); spin_lock_irqsave(&pf_spin_lock,saved_flags);
end_request(1); end_request(CURRENT, 1);
pf_busy = 0; pf_busy = 0;
do_pf_request(NULL); do_pf_request(NULL);
spin_unlock_irqrestore(&pf_spin_lock,saved_flags); spin_unlock_irqrestore(&pf_spin_lock,saved_flags);
......
...@@ -510,7 +510,7 @@ static void do_ps2esdi_request(request_queue_t * q) ...@@ -510,7 +510,7 @@ static void do_ps2esdi_request(request_queue_t * q)
if (isa_virt_to_bus(CURRENT->buffer + CURRENT->current_nr_sectors * 512) > 16 * MB) { if (isa_virt_to_bus(CURRENT->buffer + CURRENT->current_nr_sectors * 512) > 16 * MB) {
printk("%s: DMA above 16MB not supported\n", DEVICE_NAME); printk("%s: DMA above 16MB not supported\n", DEVICE_NAME);
end_request(FAIL); end_request(CURRENT, FAIL);
} /* check for above 16Mb dmas */ } /* check for above 16Mb dmas */
else if ((DEVICE_NR(CURRENT->rq_dev) < ps2esdi_drives) && else if ((DEVICE_NR(CURRENT->rq_dev) < ps2esdi_drives) &&
(CURRENT->sector + CURRENT->current_nr_sectors <= (CURRENT->sector + CURRENT->current_nr_sectors <=
...@@ -536,7 +536,7 @@ static void do_ps2esdi_request(request_queue_t * q) ...@@ -536,7 +536,7 @@ static void do_ps2esdi_request(request_queue_t * q)
break; break;
default: default:
printk("%s: Unknown command\n", DEVICE_NAME); printk("%s: Unknown command\n", DEVICE_NAME);
end_request(FAIL); end_request(CURRENT, FAIL);
break; break;
} /* handle different commands */ } /* handle different commands */
} }
...@@ -544,7 +544,7 @@ static void do_ps2esdi_request(request_queue_t * q) ...@@ -544,7 +544,7 @@ static void do_ps2esdi_request(request_queue_t * q)
else { else {
printk("Grrr. error. ps2esdi_drives: %d, %lu %lu\n", ps2esdi_drives, printk("Grrr. error. ps2esdi_drives: %d, %lu %lu\n", ps2esdi_drives,
CURRENT->sector, ps2esdi[minor(CURRENT->rq_dev)].nr_sects); CURRENT->sector, ps2esdi[minor(CURRENT->rq_dev)].nr_sects);
end_request(FAIL); end_request(CURRENT, FAIL);
} }
} /* main strategy routine */ } /* main strategy routine */
...@@ -609,7 +609,7 @@ static void ps2esdi_readwrite(int cmd, u_char drive, u_int block, u_int count) ...@@ -609,7 +609,7 @@ static void ps2esdi_readwrite(int cmd, u_char drive, u_int block, u_int count)
if (ps2esdi_out_cmd_blk(cmd_blk)) { if (ps2esdi_out_cmd_blk(cmd_blk)) {
printk("%s: Controller failed\n", DEVICE_NAME); printk("%s: Controller failed\n", DEVICE_NAME);
if ((++CURRENT->errors) >= MAX_RETRIES) if ((++CURRENT->errors) >= MAX_RETRIES)
end_request(FAIL); end_request(CURRENT, FAIL);
} }
/* check for failure to put out the command block */ /* check for failure to put out the command block */
else { else {
...@@ -984,7 +984,7 @@ static void ps2esdi_normal_interrupt_handler(u_int int_ret_code) ...@@ -984,7 +984,7 @@ static void ps2esdi_normal_interrupt_handler(u_int int_ret_code)
} }
if(ending != -1) { if(ending != -1) {
spin_lock_irqsave(&ps2esdi_lock, flags); spin_lock_irqsave(&ps2esdi_lock, flags);
end_request(ending); end_request(CURRENT, ending);
do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR)); do_ps2esdi_request(BLK_DEFAULT_QUEUE(MAJOR_NR));
spin_unlock_irqrestore(&ps2esdi_lock, flags); spin_unlock_irqrestore(&ps2esdi_lock, flags);
} }
......
...@@ -329,15 +329,15 @@ static void start_request(struct floppy_state *fs) ...@@ -329,15 +329,15 @@ static void start_request(struct floppy_state *fs)
#endif #endif
if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) { if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if (CURRENT->current_nr_sectors == 0) { if (CURRENT->current_nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
continue; continue;
} }
if (fs->ejected) { if (fs->ejected) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
...@@ -345,7 +345,7 @@ static void start_request(struct floppy_state *fs) ...@@ -345,7 +345,7 @@ static void start_request(struct floppy_state *fs)
if (fs->write_prot < 0) if (fs->write_prot < 0)
fs->write_prot = swim3_readbit(fs, WRITE_PROT); fs->write_prot = swim3_readbit(fs, WRITE_PROT);
if (fs->write_prot) { if (fs->write_prot) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
} }
...@@ -516,7 +516,7 @@ static void act(struct floppy_state *fs) ...@@ -516,7 +516,7 @@ static void act(struct floppy_state *fs)
case do_transfer: case do_transfer:
if (fs->cur_cyl != fs->req_cyl) { if (fs->cur_cyl != fs->req_cyl) {
if (fs->retries > 5) { if (fs->retries > 5) {
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
return; return;
} }
...@@ -548,7 +548,7 @@ static void scan_timeout(unsigned long data) ...@@ -548,7 +548,7 @@ static void scan_timeout(unsigned long data)
out_8(&sw->intr_enable, 0); out_8(&sw->intr_enable, 0);
fs->cur_cyl = -1; fs->cur_cyl = -1;
if (fs->retries > 5) { if (fs->retries > 5) {
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
} else { } else {
...@@ -577,7 +577,7 @@ static void seek_timeout(unsigned long data) ...@@ -577,7 +577,7 @@ static void seek_timeout(unsigned long data)
return; return;
} }
printk(KERN_ERR "swim3: seek timeout\n"); printk(KERN_ERR "swim3: seek timeout\n");
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
} }
...@@ -605,7 +605,7 @@ static void xfer_timeout(unsigned long data) ...@@ -605,7 +605,7 @@ static void xfer_timeout(unsigned long data)
CURRENT->current_nr_sectors -= s; CURRENT->current_nr_sectors -= s;
printk(KERN_ERR "swim3: timeout %sing sector %ld\n", printk(KERN_ERR "swim3: timeout %sing sector %ld\n",
(rq_data_dir(CURRENT)==WRITE? "writ": "read"), CURRENT->sector); (rq_data_dir(CURRENT)==WRITE? "writ": "read"), CURRENT->sector);
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
} }
...@@ -639,7 +639,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -639,7 +639,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk(KERN_ERR "swim3: seen sector but cyl=ff?\n"); printk(KERN_ERR "swim3: seen sector but cyl=ff?\n");
fs->cur_cyl = -1; fs->cur_cyl = -1;
if (fs->retries > 5) { if (fs->retries > 5) {
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
} else { } else {
...@@ -710,7 +710,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -710,7 +710,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("swim3: error %sing block %ld (err=%x)\n", printk("swim3: error %sing block %ld (err=%x)\n",
rq_data_dir(CURRENT) == WRITE? "writ": "read", rq_data_dir(CURRENT) == WRITE? "writ": "read",
CURRENT->sector, err); CURRENT->sector, err);
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
} }
} else { } else {
...@@ -719,7 +719,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -719,7 +719,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk(KERN_ERR "swim3: fd dma: stat=%x resid=%d\n", stat, resid); printk(KERN_ERR "swim3: fd dma: stat=%x resid=%d\n", stat, resid);
printk(KERN_ERR " state=%d, dir=%lx, intr=%x, err=%x\n", printk(KERN_ERR " state=%d, dir=%lx, intr=%x, err=%x\n",
fs->state, rq_data_dir(CURRENT), intr, err); fs->state, rq_data_dir(CURRENT), intr, err);
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
start_request(fs); start_request(fs);
break; break;
...@@ -728,7 +728,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -728,7 +728,7 @@ static void swim3_interrupt(int irq, void *dev_id, struct pt_regs *regs)
CURRENT->current_nr_sectors -= fs->scount; CURRENT->current_nr_sectors -= fs->scount;
CURRENT->buffer += fs->scount * 512; CURRENT->buffer += fs->scount * 512;
if (CURRENT->current_nr_sectors <= 0) { if (CURRENT->current_nr_sectors <= 0) {
end_request(1); end_request(CURRENT, 1);
fs->state = idle; fs->state = idle;
} else { } else {
fs->req_sector += fs->scount; fs->req_sector += fs->scount;
......
...@@ -100,7 +100,7 @@ static char *drive_names[7] = { ...@@ -100,7 +100,7 @@ static char *drive_names[7] = {
int swimiop_init(void); int swimiop_init(void);
static void swimiop_init_request(struct swim_iop_req *); static void swimiop_init_request(struct swim_iop_req *);
static int swimiop_send_request(struct swim_iop_req *); static int swimiop_send_request(CURRENT, struct swim_iop_req *);
static void swimiop_receive(struct iop_msg *, struct pt_regs *); static void swimiop_receive(struct iop_msg *, struct pt_regs *);
static void swimiop_status_update(int, struct swim_drvstatus *); static void swimiop_status_update(int, struct swim_drvstatus *);
static int swimiop_eject(struct floppy_state *fs); static int swimiop_eject(struct floppy_state *fs);
...@@ -171,7 +171,7 @@ int swimiop_init(void) ...@@ -171,7 +171,7 @@ int swimiop_init(void)
swimiop_init_request(&req); swimiop_init_request(&req);
cmd->code = CMD_STATUS; cmd->code = CMD_STATUS;
cmd->drive_num = i + 1; cmd->drive_num = i + 1;
if (swimiop_send_request(&req) != 0) continue; if (swimiop_send_request(CURRENT, &req) != 0) continue;
while (!req.complete); while (!req.complete);
if (cmd->error != 0) { if (cmd->error != 0) {
printk(KERN_ERR "SWIM-IOP: probe on drive %d returned error %d\n", i, (uint) cmd->error); printk(KERN_ERR "SWIM-IOP: probe on drive %d returned error %d\n", i, (uint) cmd->error);
...@@ -204,7 +204,7 @@ static void swimiop_init_request(struct swim_iop_req *req) ...@@ -204,7 +204,7 @@ static void swimiop_init_request(struct swim_iop_req *req)
req->done = NULL; req->done = NULL;
} }
static int swimiop_send_request(struct swim_iop_req *req) static int swimiop_send_request(CURRENT, struct swim_iop_req *req)
{ {
unsigned long cpu_flags; unsigned long cpu_flags;
int err; int err;
...@@ -319,7 +319,7 @@ static int swimiop_eject(struct floppy_state *fs) ...@@ -319,7 +319,7 @@ static int swimiop_eject(struct floppy_state *fs)
swimiop_init_request(&req); swimiop_init_request(&req);
cmd->code = CMD_EJECT; cmd->code = CMD_EJECT;
cmd->drive_num = fs->drive_num; cmd->drive_num = fs->drive_num;
err = swimiop_send_request(&req); err = swimiop_send_request(CURRENT, &req);
if (err) { if (err) {
release_drive(fs); release_drive(fs);
return err; return err;
...@@ -523,12 +523,12 @@ static void fd_request_complete(struct swim_iop_req *req) ...@@ -523,12 +523,12 @@ static void fd_request_complete(struct swim_iop_req *req)
fs->state = idle; fs->state = idle;
if (cmd->error) { if (cmd->error) {
printk(KERN_ERR "SWIM-IOP: error %d on read/write request.\n", cmd->error); printk(KERN_ERR "SWIM-IOP: error %d on read/write request.\n", cmd->error);
end_request(0); end_request(CURRENT, 0);
} else { } else {
CURRENT->sector += cmd->num_blocks; CURRENT->sector += cmd->num_blocks;
CURRENT->current_nr_sectors -= cmd->num_blocks; CURRENT->current_nr_sectors -= cmd->num_blocks;
if (CURRENT->current_nr_sectors <= 0) { if (CURRENT->current_nr_sectors <= 0) {
end_request(1); end_request(CURRENT, 1);
return; return;
} }
} }
...@@ -540,7 +540,7 @@ static void fd_request_timeout(unsigned long data) ...@@ -540,7 +540,7 @@ static void fd_request_timeout(unsigned long data)
struct floppy_state *fs = (struct floppy_state *) data; struct floppy_state *fs = (struct floppy_state *) data;
fs->timeout_pending = 0; fs->timeout_pending = 0;
end_request(0); end_request(CURRENT, 0);
fs->state = idle; fs->state = idle;
} }
...@@ -568,15 +568,15 @@ static void start_request(struct floppy_state *fs) ...@@ -568,15 +568,15 @@ static void start_request(struct floppy_state *fs)
#endif #endif
if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) { if (CURRENT->sector < 0 || CURRENT->sector >= fs->total_secs) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if (CURRENT->current_nr_sectors == 0) { if (CURRENT->current_nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
continue; continue;
} }
if (fs->ejected) { if (fs->ejected) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
...@@ -586,7 +586,7 @@ static void start_request(struct floppy_state *fs) ...@@ -586,7 +586,7 @@ static void start_request(struct floppy_state *fs)
if (CURRENT->cmd == WRITE) { if (CURRENT->cmd == WRITE) {
if (fs->write_prot) { if (fs->write_prot) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
cmd->code = CMD_WRITE; cmd->code = CMD_WRITE;
...@@ -599,8 +599,8 @@ static void start_request(struct floppy_state *fs) ...@@ -599,8 +599,8 @@ static void start_request(struct floppy_state *fs)
cmd->first_block = CURRENT->sector; cmd->first_block = CURRENT->sector;
cmd->num_blocks = CURRENT->current_nr_sectors; cmd->num_blocks = CURRENT->current_nr_sectors;
if (swimiop_send_request(&req)) { if (swimiop_send_request(CURRENT, &req)) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
......
...@@ -306,7 +306,7 @@ static void do_xd_request (request_queue_t * q) ...@@ -306,7 +306,7 @@ static void do_xd_request (request_queue_t * q)
break; break;
} }
} }
end_request(code); /* wrap up, 0 = fail, 1 = success */ end_request(CURRENT, code); /* wrap up, 0 = fail, 1 = success */
} }
} }
......
...@@ -89,14 +89,14 @@ do_z2_request( request_queue_t * q ) ...@@ -89,14 +89,14 @@ do_z2_request( request_queue_t * q )
printk( KERN_ERR DEVICE_NAME ": bad access: block=%lu, count=%u\n", printk( KERN_ERR DEVICE_NAME ": bad access: block=%lu, count=%u\n",
CURRENT->sector, CURRENT->sector,
CURRENT->current_nr_sectors); CURRENT->current_nr_sectors);
end_request( FALSE ); end_request(CURRENT, FALSE);
continue; continue;
} }
if ( ( rq_data_dir(CURRENT) != READ ) && ( rq_data_dir(CURRENT) != WRITE ) ) if ( ( rq_data_dir(CURRENT) != READ ) && ( rq_data_dir(CURRENT) != WRITE ) )
{ {
printk( KERN_ERR DEVICE_NAME ": bad command: %ld\n", rq_data_dir(CURRENT) ); printk( KERN_ERR DEVICE_NAME ": bad command: %ld\n", rq_data_dir(CURRENT) );
end_request( FALSE ); end_request(CURRENT, FALSE);
continue; continue;
} }
...@@ -118,7 +118,7 @@ do_z2_request( request_queue_t * q ) ...@@ -118,7 +118,7 @@ do_z2_request( request_queue_t * q )
len -= size; len -= size;
} }
end_request( TRUE ); end_request(CURRENT, TRUE);
} }
} }
......
...@@ -1598,21 +1598,21 @@ static void do_aztcd_request(request_queue_t * q) ...@@ -1598,21 +1598,21 @@ static void do_aztcd_request(request_queue_t * q)
#endif #endif
if (DiskInfo.audio) { if (DiskInfo.audio) {
printk("aztcd: Error, tried to mount an Audio CD\n"); printk("aztcd: Error, tried to mount an Audio CD\n");
end_request(0); end_request(CURRENT, 0);
return; return;
} }
azt_transfer_is_active = 1; azt_transfer_is_active = 1;
while (current_valid()) { while (current_valid()) {
azt_transfer(); azt_transfer();
if (CURRENT->nr_sectors == 0) { if (CURRENT->nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
} else { } else {
azt_buf_out = -1; /* Want to read a block not in buffer */ azt_buf_out = -1; /* Want to read a block not in buffer */
if (azt_state == AZT_S_IDLE) { if (azt_state == AZT_S_IDLE) {
if ((!aztTocUpToDate) || aztDiskChanged) { if ((!aztTocUpToDate) || aztDiskChanged) {
if (aztUpdateToc() < 0) { if (aztUpdateToc() < 0) {
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
break; break;
} }
} }
...@@ -2009,7 +2009,7 @@ static void azt_poll(void) ...@@ -2009,7 +2009,7 @@ static void azt_poll(void)
loop_ctl = 0; loop_ctl = 0;
} }
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
AztTries = 5; AztTries = 5;
} }
azt_error = 0; azt_error = 0;
...@@ -2058,7 +2058,7 @@ static void azt_poll(void) ...@@ -2058,7 +2058,7 @@ static void azt_poll(void)
aztDiskChanged = 1; aztDiskChanged = 1;
aztTocUpToDate = 0; aztTocUpToDate = 0;
azt_invalidate_buffers(); azt_invalidate_buffers();
end_request(0); end_request(CURRENT, 0);
printk printk
("aztcd: Disk Changed or Not Ready 1 - Unmount Disk!\n"); ("aztcd: Disk Changed or Not Ready 1 - Unmount Disk!\n");
} }
...@@ -2072,7 +2072,7 @@ static void azt_poll(void) ...@@ -2072,7 +2072,7 @@ static void azt_poll(void)
aztTocUpToDate = 0; aztTocUpToDate = 0;
printk printk
("aztcd: Disk Changed or Not Ready 2 - Unmount Disk!\n"); ("aztcd: Disk Changed or Not Ready 2 - Unmount Disk!\n");
end_request(0); end_request(CURRENT, 0);
printk((st & AST_DOOR_OPEN) ? printk((st & AST_DOOR_OPEN) ?
"aztcd: door open\n" : "aztcd: door open\n" :
"aztcd: disk removed\n"); "aztcd: disk removed\n");
...@@ -2118,7 +2118,7 @@ static void azt_poll(void) ...@@ -2118,7 +2118,7 @@ static void azt_poll(void)
azt_invalidate_buffers(); azt_invalidate_buffers();
printk printk
("aztcd: Disk Changed or Not Ready 3 - Unmount Disk!\n"); ("aztcd: Disk Changed or Not Ready 3 - Unmount Disk!\n");
end_request(0); end_request(CURRENT, 0);
} }
} else } else
break; break;
...@@ -2294,7 +2294,7 @@ static void azt_poll(void) ...@@ -2294,7 +2294,7 @@ static void azt_poll(void)
azt_read_count = 0; azt_read_count = 0;
azt_state = AZT_S_STOP; azt_state = AZT_S_STOP;
loop_ctl = 1; loop_ctl = 1;
end_request(1); /*should we have here (1) or (0)? */ end_request(CURRENT, 1); /*should we have here (1) or (0)? */
} else { } else {
if (azt_read_mode == if (azt_read_mode ==
AZT_MODE_2) { AZT_MODE_2) {
...@@ -2339,7 +2339,7 @@ static void azt_poll(void) ...@@ -2339,7 +2339,7 @@ static void azt_poll(void)
azt_transfer(); azt_transfer();
if (CURRENT->nr_sectors == if (CURRENT->nr_sectors ==
0) 0)
end_request(1); end_request(CURRENT, 1);
else else
break; break;
} }
...@@ -2414,7 +2414,7 @@ static void azt_poll(void) ...@@ -2414,7 +2414,7 @@ static void azt_poll(void)
azt_invalidate_buffers(); azt_invalidate_buffers();
printk printk
("aztcd: Disk Changed or Not Ready 4 - Unmount Disk!\n"); ("aztcd: Disk Changed or Not Ready 4 - Unmount Disk!\n");
end_request(0); end_request(CURRENT, 0);
} }
#ifdef AZT_TEST3 #ifdef AZT_TEST3
......
...@@ -1606,7 +1606,7 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1606,7 +1606,7 @@ static void do_cdu31a_request(request_queue_t * q)
if (!sony_toc_read) { if (!sony_toc_read) {
printk("CDU31A: TOC not read\n"); printk("CDU31A: TOC not read\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
...@@ -1620,14 +1620,14 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1620,14 +1620,14 @@ static void do_cdu31a_request(request_queue_t * q)
if ((block / 4) >= sony_toc.lead_out_start_lba) { if ((block / 4) >= sony_toc.lead_out_start_lba) {
printk printk
("CDU31A: Request past end of media\n"); ("CDU31A: Request past end of media\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
if (((block + nblock) / 4) >= if (((block + nblock) / 4) >=
sony_toc.lead_out_start_lba) { sony_toc.lead_out_start_lba) {
printk printk
("CDU31A: Request past end of media\n"); ("CDU31A: Request past end of media\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
...@@ -1638,7 +1638,7 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1638,7 +1638,7 @@ static void do_cdu31a_request(request_queue_t * q)
if (!sony_toc_read) { if (!sony_toc_read) {
printk("CDU31A: TOC not read\n"); printk("CDU31A: TOC not read\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
...@@ -1647,7 +1647,7 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1647,7 +1647,7 @@ static void do_cdu31a_request(request_queue_t * q)
if (sony_blocks_left == 0) { if (sony_blocks_left == 0) {
if (start_request if (start_request
(block / 4, CDU31A_READAHEAD / 4, 0)) { (block / 4, CDU31A_READAHEAD / 4, 0)) {
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
} }
...@@ -1663,14 +1663,14 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1663,14 +1663,14 @@ static void do_cdu31a_request(request_queue_t * q)
abort_read(); abort_read();
if (!sony_toc_read) { if (!sony_toc_read) {
printk("CDU31A: TOC not read\n"); printk("CDU31A: TOC not read\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
if (start_request if (start_request
(block / 4, CDU31A_READAHEAD / 4, 0)) { (block / 4, CDU31A_READAHEAD / 4, 0)) {
printk printk
("CDU31a: start request failed\n"); ("CDU31a: start request failed\n");
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
} }
...@@ -1679,7 +1679,7 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1679,7 +1679,7 @@ static void do_cdu31a_request(request_queue_t * q)
res_reg, &res_size); res_reg, &res_size);
if (res_reg[0] == 0x20) { if (res_reg[0] == 0x20) {
if (num_retries > MAX_CDU31A_RETRIES) { if (num_retries > MAX_CDU31A_RETRIES) {
end_request(0); end_request(CURRENT, 0);
goto cdu31a_request_startover; goto cdu31a_request_startover;
} }
...@@ -1696,12 +1696,12 @@ static void do_cdu31a_request(request_queue_t * q) ...@@ -1696,12 +1696,12 @@ static void do_cdu31a_request(request_queue_t * q)
} }
goto try_read_again; goto try_read_again;
} else { } else {
end_request(1); end_request(CURRENT, 1);
} }
break; break;
case WRITE: case WRITE:
end_request(0); end_request(CURRENT, 0);
break; break;
default: default:
......
...@@ -864,7 +864,7 @@ static void do_cm206_request(request_queue_t * q) ...@@ -864,7 +864,7 @@ static void do_cm206_request(request_queue_t * q)
if (CURRENT->cmd != READ) { if (CURRENT->cmd != READ) {
debug(("Non-read command %d on cdrom\n", debug(("Non-read command %d on cdrom\n",
CURRENT->cmd)); CURRENT->cmd));
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
...@@ -895,7 +895,7 @@ static void do_cm206_request(request_queue_t * q) ...@@ -895,7 +895,7 @@ static void do_cm206_request(request_queue_t * q)
} }
} }
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
end_request(!error); end_request(CURRENT, !error);
} }
} }
......
...@@ -292,13 +292,13 @@ static void __do_gscd_request(unsigned long dummy) ...@@ -292,13 +292,13 @@ static void __do_gscd_request(unsigned long dummy)
if (CURRENT->cmd != READ) { if (CURRENT->cmd != READ) {
printk("GSCD: bad cmd %p\n", CURRENT->cmd); printk("GSCD: bad cmd %p\n", CURRENT->cmd);
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
if (dev != 0) { if (dev != 0) {
printk("GSCD: this version supports only one device\n"); printk("GSCD: this version supports only one device\n");
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -307,7 +307,7 @@ static void __do_gscd_request(unsigned long dummy) ...@@ -307,7 +307,7 @@ static void __do_gscd_request(unsigned long dummy)
/* if we satisfied the request from the buffer, we're done. */ /* if we satisfied the request from the buffer, we're done. */
if (CURRENT->nr_sectors == 0) { if (CURRENT->nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
goto repeat; goto repeat;
} }
#ifdef GSCD_DEBUG #ifdef GSCD_DEBUG
...@@ -337,11 +337,11 @@ static void gscd_read_cmd(void) ...@@ -337,11 +337,11 @@ static void gscd_read_cmd(void)
cmd_status(); cmd_status();
if (disk_state & (ST_NO_DISK | ST_DOOR_OPEN)) { if (disk_state & (ST_NO_DISK | ST_DOOR_OPEN)) {
printk("GSCD: no disk or door open\n"); printk("GSCD: no disk or door open\n");
end_request(0); end_request(CURRENT, 0);
} else { } else {
if (disk_state & ST_INVALID) { if (disk_state & ST_INVALID) {
printk("GSCD: disk invalid\n"); printk("GSCD: disk invalid\n");
end_request(0); end_request(CURRENT, 0);
} else { } else {
gscd_bn = -1; /* purge our buffer */ gscd_bn = -1; /* purge our buffer */
block = CURRENT->sector / 4; block = CURRENT->sector / 4;
...@@ -360,7 +360,7 @@ static void gscd_read_cmd(void) ...@@ -360,7 +360,7 @@ static void gscd_read_cmd(void)
gscd_bn = CURRENT->sector / 4; gscd_bn = CURRENT->sector / 4;
gscd_transfer(); gscd_transfer();
end_request(1); end_request(CURRENT, 1);
} }
} }
SET_TIMER(__do_gscd_request, 1); SET_TIMER(__do_gscd_request, 1);
......
...@@ -622,14 +622,14 @@ static void do_mcd_request(request_queue_t * q) ...@@ -622,14 +622,14 @@ static void do_mcd_request(request_queue_t * q)
while (current_valid()) { while (current_valid()) {
mcd_transfer(); mcd_transfer();
if (CURRENT->nr_sectors == 0) { if (CURRENT->nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
} else { } else {
mcd_buf_out = -1; /* Want to read a block not in buffer */ mcd_buf_out = -1; /* Want to read a block not in buffer */
if (mcd_state == MCD_S_IDLE) { if (mcd_state == MCD_S_IDLE) {
if (!tocUpToDate) { if (!tocUpToDate) {
if (updateToc() < 0) { if (updateToc() < 0) {
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
break; break;
} }
} }
...@@ -694,7 +694,7 @@ static void mcd_poll(unsigned long dummy) ...@@ -694,7 +694,7 @@ static void mcd_poll(unsigned long dummy)
goto ret; goto ret;
} }
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
McdTries = MCD_RETRY_ATTEMPTS; McdTries = MCD_RETRY_ATTEMPTS;
} }
} }
...@@ -751,7 +751,7 @@ static void mcd_poll(unsigned long dummy) ...@@ -751,7 +751,7 @@ static void mcd_poll(unsigned long dummy)
"mcd: disk removed\n"); "mcd: disk removed\n");
mcd_state = MCD_S_IDLE; mcd_state = MCD_S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
goto out; goto out;
} }
outb(MCMD_SET_MODE, MCDPORT(0)); outb(MCMD_SET_MODE, MCDPORT(0));
...@@ -785,7 +785,7 @@ static void mcd_poll(unsigned long dummy) ...@@ -785,7 +785,7 @@ static void mcd_poll(unsigned long dummy)
"mcd: disk removed\n"); "mcd: disk removed\n");
mcd_state = MCD_S_IDLE; mcd_state = MCD_S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
goto out; goto out;
} }
...@@ -826,7 +826,7 @@ static void mcd_poll(unsigned long dummy) ...@@ -826,7 +826,7 @@ static void mcd_poll(unsigned long dummy)
break; break;
} }
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
McdTries = 5; McdTries = 5;
} }
mcd_state = MCD_S_START; mcd_state = MCD_S_START;
...@@ -853,7 +853,7 @@ static void mcd_poll(unsigned long dummy) ...@@ -853,7 +853,7 @@ static void mcd_poll(unsigned long dummy)
while (current_valid()) { while (current_valid()) {
mcd_transfer(); mcd_transfer();
if (CURRENT->nr_sectors == 0) if (CURRENT->nr_sectors == 0)
end_request(1); end_request(CURRENT, 1);
else else
break; break;
} }
......
...@@ -575,14 +575,14 @@ void do_mcdx_request(request_queue_t * q) ...@@ -575,14 +575,14 @@ void do_mcdx_request(request_queue_t * q)
xwarn("do_request(): bad device: %s\n", xwarn("do_request(): bad device: %s\n",
kdevname(CURRENT->rq_dev)); kdevname(CURRENT->rq_dev));
xtrace(REQUEST, "end_request(0): bad device\n"); xtrace(REQUEST, "end_request(0): bad device\n");
end_request(0); end_request(CURRENT, 0);
return; return;
} }
if (stuffp->audio) { if (stuffp->audio) {
xwarn("do_request() attempt to read from audio cd\n"); xwarn("do_request() attempt to read from audio cd\n");
xtrace(REQUEST, "end_request(0): read from audio\n"); xtrace(REQUEST, "end_request(0): read from audio\n");
end_request(0); end_request(CURRENT, 0);
return; return;
} }
...@@ -592,7 +592,7 @@ void do_mcdx_request(request_queue_t * q) ...@@ -592,7 +592,7 @@ void do_mcdx_request(request_queue_t * q)
if (CURRENT->cmd != READ) { if (CURRENT->cmd != READ) {
xwarn("do_request(): non-read command to cd!!\n"); xwarn("do_request(): non-read command to cd!!\n");
xtrace(REQUEST, "end_request(0): write\n"); xtrace(REQUEST, "end_request(0): write\n");
end_request(0); end_request(CURRENT, 0);
return; return;
} }
else { else {
...@@ -606,18 +606,18 @@ void do_mcdx_request(request_queue_t * q) ...@@ -606,18 +606,18 @@ void do_mcdx_request(request_queue_t * q)
CURRENT->nr_sectors); CURRENT->nr_sectors);
if (i == -1) { if (i == -1) {
end_request(0); end_request(CURRENT, 0);
goto again; goto again;
} }
CURRENT->sector += i; CURRENT->sector += i;
CURRENT->nr_sectors -= i; CURRENT->nr_sectors -= i;
CURRENT->buffer += (i * 512); CURRENT->buffer += (i * 512);
} }
end_request(1); end_request(CURRENT, 1);
goto again; goto again;
xtrace(REQUEST, "end_request(1)\n"); xtrace(REQUEST, "end_request(1)\n");
end_request(1); end_request(CURRENT, 1);
} }
goto again; goto again;
......
...@@ -1096,7 +1096,7 @@ static void poll(unsigned long data) ...@@ -1096,7 +1096,7 @@ static void poll(unsigned long data)
if (transfer_is_active) if (transfer_is_active)
loop_again = 0; loop_again = 0;
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
tries = 5; tries = 5;
} }
error = 0; error = 0;
...@@ -1130,7 +1130,7 @@ static void poll(unsigned long data) ...@@ -1130,7 +1130,7 @@ static void poll(unsigned long data)
if (send_cmd(COMDRVST)) { if (send_cmd(COMDRVST)) {
state = S_IDLE; state = S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
return; return;
} }
state = S_READ; state = S_READ;
...@@ -1157,7 +1157,7 @@ static void poll(unsigned long data) ...@@ -1157,7 +1157,7 @@ static void poll(unsigned long data)
: "disk removed"); : "disk removed");
state = S_IDLE; state = S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
return; return;
} }
if (!current_valid()) { if (!current_valid()) {
...@@ -1212,7 +1212,7 @@ static void poll(unsigned long data) ...@@ -1212,7 +1212,7 @@ static void poll(unsigned long data)
break; break;
} }
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
tries = 5; tries = 5;
} }
state = S_START; state = S_START;
...@@ -1248,7 +1248,7 @@ static void poll(unsigned long data) ...@@ -1248,7 +1248,7 @@ static void poll(unsigned long data)
read_count = 0; read_count = 0;
state = S_STOP; state = S_STOP;
loop_again = 1; loop_again = 1;
end_request(0); end_request(CURRENT, 0);
break; break;
} }
fetch_data(buf+ fetch_data(buf+
...@@ -1278,7 +1278,7 @@ static void poll(unsigned long data) ...@@ -1278,7 +1278,7 @@ static void poll(unsigned long data)
while (current_valid()) { while (current_valid()) {
transfer(); transfer();
if (CURRENT -> nr_sectors == 0) if (CURRENT -> nr_sectors == 0)
end_request(1); end_request(CURRENT, 1);
else else
break; break;
} }
...@@ -1309,7 +1309,7 @@ static void poll(unsigned long data) ...@@ -1309,7 +1309,7 @@ static void poll(unsigned long data)
if (send_cmd(COMDRVST)) { if (send_cmd(COMDRVST)) {
state = S_IDLE; state = S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
return; return;
} }
state = S_STOPPING; state = S_STOPPING;
...@@ -1350,7 +1350,7 @@ static void poll(unsigned long data) ...@@ -1350,7 +1350,7 @@ static void poll(unsigned long data)
if (exec_cmd(COMSTOP) < 0) { if (exec_cmd(COMSTOP) < 0) {
state = S_IDLE; state = S_IDLE;
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
return; return;
} }
} }
...@@ -1366,7 +1366,7 @@ static void do_optcd_request(request_queue_t * q) ...@@ -1366,7 +1366,7 @@ static void do_optcd_request(request_queue_t * q)
if (disk_info.audio) { if (disk_info.audio) {
printk(KERN_WARNING "optcd: tried to mount an Audio CD\n"); printk(KERN_WARNING "optcd: tried to mount an Audio CD\n");
end_request(0); end_request(CURRENT, 0);
return; return;
} }
...@@ -1374,14 +1374,14 @@ static void do_optcd_request(request_queue_t * q) ...@@ -1374,14 +1374,14 @@ static void do_optcd_request(request_queue_t * q)
while (current_valid()) { while (current_valid()) {
transfer(); /* First try to transfer block from buffers */ transfer(); /* First try to transfer block from buffers */
if (CURRENT -> nr_sectors == 0) { if (CURRENT -> nr_sectors == 0) {
end_request(1); end_request(CURRENT, 1);
} else { /* Want to read a block not in buffer */ } else { /* Want to read a block not in buffer */
buf_out = NOBUF; buf_out = NOBUF;
if (state == S_IDLE) { if (state == S_IDLE) {
/* %% Should this block the request queue?? */ /* %% Should this block the request queue?? */
if (update_toc() < 0) { if (update_toc() < 0) {
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
break; break;
} }
/* Start state machine */ /* Start state machine */
......
...@@ -4864,7 +4864,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4864,7 +4864,7 @@ static void do_sbpcd_request(request_queue_t * q)
blkdev_dequeue_request(req); /* task can fuck it up GTL */ blkdev_dequeue_request(req); /* task can fuck it up GTL */
if (req -> sector == -1) if (req -> sector == -1)
end_request(0); end_request(CURRENT, 0);
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
down(&ioctl_read_sem); down(&ioctl_read_sem);
...@@ -4906,7 +4906,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4906,7 +4906,7 @@ static void do_sbpcd_request(request_queue_t * q)
#endif #endif
up(&ioctl_read_sem); up(&ioctl_read_sem);
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
end_request(1); end_request(CURRENT, 1);
goto request_loop; goto request_loop;
} }
...@@ -4947,7 +4947,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4947,7 +4947,7 @@ static void do_sbpcd_request(request_queue_t * q)
#endif #endif
up(&ioctl_read_sem); up(&ioctl_read_sem);
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
end_request(1); end_request(CURRENT, 1);
goto request_loop; goto request_loop;
} }
} }
...@@ -4963,7 +4963,7 @@ static void do_sbpcd_request(request_queue_t * q) ...@@ -4963,7 +4963,7 @@ static void do_sbpcd_request(request_queue_t * q)
up(&ioctl_read_sem); up(&ioctl_read_sem);
sbp_sleep(0); /* wait a bit, try again */ sbp_sleep(0); /* wait a bit, try again */
spin_lock_irq(q->queue_lock); spin_lock_irq(q->queue_lock);
end_request(0); end_request(CURRENT, 0);
goto request_loop; goto request_loop;
} }
/*==========================================================================*/ /*==========================================================================*/
......
...@@ -1304,7 +1304,7 @@ static void sjcd_poll(void) ...@@ -1304,7 +1304,7 @@ static void sjcd_poll(void)
sjcd_next_bn); sjcd_next_bn);
#endif #endif
if (current_valid()) if (current_valid())
end_request(0); end_request(CURRENT, 0);
#if defined( SJCD_TRACE ) #if defined( SJCD_TRACE )
printk printk
("SJCD_S_DATA: pre-cmd failed: go to SJCD_S_STOP mode\n"); ("SJCD_S_DATA: pre-cmd failed: go to SJCD_S_STOP mode\n");
...@@ -1378,7 +1378,7 @@ static void sjcd_poll(void) ...@@ -1378,7 +1378,7 @@ static void sjcd_poll(void)
nr_sectors == nr_sectors ==
0) 0)
end_request end_request
(1); (CURRENT, 1);
else else
break; break;
} }
...@@ -1473,7 +1473,7 @@ static void sjcd_poll(void) ...@@ -1473,7 +1473,7 @@ static void sjcd_poll(void)
if (--sjcd_transfer_timeout == 0) { if (--sjcd_transfer_timeout == 0) {
printk("SJCD: timeout in state %d\n", sjcd_transfer_state); printk("SJCD: timeout in state %d\n", sjcd_transfer_state);
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
sjcd_send_cmd(SCMD_STOP); sjcd_send_cmd(SCMD_STOP);
sjcd_transfer_state = SJCD_S_IDLE; sjcd_transfer_state = SJCD_S_IDLE;
goto ReSwitch; goto ReSwitch;
...@@ -1496,7 +1496,7 @@ static void do_sjcd_request(request_queue_t * q) ...@@ -1496,7 +1496,7 @@ static void do_sjcd_request(request_queue_t * q)
while (current_valid()) { while (current_valid()) {
sjcd_transfer(); sjcd_transfer();
if (CURRENT->nr_sectors == 0) if (CURRENT->nr_sectors == 0)
end_request(1); end_request(CURRENT, 1);
else { else {
sjcd_buf_out = -1; /* Want to read a block not in buffer */ sjcd_buf_out = -1; /* Want to read a block not in buffer */
if (sjcd_transfer_state == SJCD_S_IDLE) { if (sjcd_transfer_state == SJCD_S_IDLE) {
...@@ -1505,7 +1505,7 @@ static void do_sjcd_request(request_queue_t * q) ...@@ -1505,7 +1505,7 @@ static void do_sjcd_request(request_queue_t * q)
printk printk
("SJCD: transfer: discard\n"); ("SJCD: transfer: discard\n");
while (current_valid()) while (current_valid())
end_request(0); end_request(CURRENT, 0);
break; break;
} }
} }
......
...@@ -818,7 +818,7 @@ do_cdu535_request(request_queue_t * q) ...@@ -818,7 +818,7 @@ do_cdu535_request(request_queue_t * q)
block = CURRENT->sector; block = CURRENT->sector;
nsect = CURRENT->nr_sectors; nsect = CURRENT->nr_sectors;
if (dev != 0) { if (dev != 0) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if(CURRENT->flags & REQ_CMD) { if(CURRENT->flags & REQ_CMD) {
...@@ -830,11 +830,11 @@ do_cdu535_request(request_queue_t * q) ...@@ -830,11 +830,11 @@ do_cdu535_request(request_queue_t * q)
*/ */
if (sony_toc->lead_out_start_lba <= (block / 4)) { if (sony_toc->lead_out_start_lba <= (block / 4)) {
end_request(0); end_request(CURRENT, 0);
return; return;
} }
if (sony_toc->lead_out_start_lba <= ((block + nsect) / 4)) { if (sony_toc->lead_out_start_lba <= ((block + nsect) / 4)) {
end_request(0); end_request(CURRENT, 0);
return; return;
} }
while (0 < nsect) { while (0 < nsect) {
...@@ -896,7 +896,7 @@ do_cdu535_request(request_queue_t * q) ...@@ -896,7 +896,7 @@ do_cdu535_request(request_queue_t * q)
status[0]); status[0]);
sony_first_block = -1; sony_first_block = -1;
sony_last_block = -1; sony_last_block = -1;
end_request(0); end_request(CURRENT, 0);
return; return;
} }
if (readStatus == BAD_STATUS) { if (readStatus == BAD_STATUS) {
...@@ -925,11 +925,11 @@ do_cdu535_request(request_queue_t * q) ...@@ -925,11 +925,11 @@ do_cdu535_request(request_queue_t * q)
CURRENT->buffer += 512; CURRENT->buffer += 512;
} }
end_request(1); end_request(CURRENT, 1);
break; break;
case WRITE: case WRITE:
end_request(0); end_request(CURRENT, 0);
break; break;
default: default:
......
...@@ -378,7 +378,7 @@ static void bad_rw_intr(void) ...@@ -378,7 +378,7 @@ static void bad_rw_intr(void)
return; return;
dev = DEVICE_NR(CURRENT->rq_dev); dev = DEVICE_NR(CURRENT->rq_dev);
if (++CURRENT->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) { if (++CURRENT->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) {
end_request(0); end_request(CURRENT, 0);
special_op[dev] = recalibrate[dev] = 1; special_op[dev] = recalibrate[dev] = 1;
} else if (CURRENT->errors % RESET_FREQ == 0) } else if (CURRENT->errors % RESET_FREQ == 0)
reset = 1; reset = 1;
...@@ -428,7 +428,7 @@ static void read_intr(void) ...@@ -428,7 +428,7 @@ static void read_intr(void)
(unsigned long) CURRENT->buffer+512)); (unsigned long) CURRENT->buffer+512));
#endif #endif
if (CURRENT->current_nr_sectors <= 0) if (CURRENT->current_nr_sectors <= 0)
end_request(1); end_request(CURRENT, 1);
if (i > 0) { if (i > 0) {
SET_HANDLER(&read_intr); SET_HANDLER(&read_intr);
return; return;
...@@ -466,7 +466,7 @@ static void write_intr(void) ...@@ -466,7 +466,7 @@ static void write_intr(void)
--CURRENT->current_nr_sectors; --CURRENT->current_nr_sectors;
CURRENT->buffer += 512; CURRENT->buffer += 512;
if (!i || (CURRENT->bio && !SUBSECTOR(i))) if (!i || (CURRENT->bio && !SUBSECTOR(i)))
end_request(1); end_request(CURRENT, 1);
if (i > 0) { if (i > 0) {
SET_HANDLER(&write_intr); SET_HANDLER(&write_intr);
outsw(HD_DATA,CURRENT->buffer,256); outsw(HD_DATA,CURRENT->buffer,256);
...@@ -511,7 +511,7 @@ static void hd_times_out(unsigned long dummy) ...@@ -511,7 +511,7 @@ static void hd_times_out(unsigned long dummy)
#ifdef DEBUG #ifdef DEBUG
printk("hd%c: too many errors\n", dev+'a'); printk("hd%c: too many errors\n", dev+'a');
#endif #endif
end_request(0); end_request(CURRENT, 0);
} }
cli(); cli();
hd_request(); hd_request();
...@@ -527,7 +527,7 @@ int do_special_op (unsigned int dev) ...@@ -527,7 +527,7 @@ int do_special_op (unsigned int dev)
} }
if (hd_info[dev].head > 16) { if (hd_info[dev].head > 16) {
printk ("hd%c: cannot handle device with more than 16 heads - giving up\n", dev+'a'); printk ("hd%c: cannot handle device with more than 16 heads - giving up\n", dev+'a');
end_request(0); end_request(CURRENT, 0);
} }
special_op[dev] = 0; special_op[dev] = 0;
return 1; return 1;
...@@ -574,7 +574,7 @@ static void hd_request(void) ...@@ -574,7 +574,7 @@ static void hd_request(void)
else else
printk("hd%c: bad access: block=%d, count=%d\n", printk("hd%c: bad access: block=%d, count=%d\n",
(minor(CURRENT->rq_dev)>>6)+'a', block, nsect); (minor(CURRENT->rq_dev)>>6)+'a', block, nsect);
end_request(0); end_request(CURRENT, 0);
goto repeat; goto repeat;
} }
...@@ -612,7 +612,7 @@ static void hd_request(void) ...@@ -612,7 +612,7 @@ static void hd_request(void)
break; break;
default: default:
printk("unknown hd-command\n"); printk("unknown hd-command\n");
end_request(0); end_request(CURRENT, 0);
break; break;
} }
} }
......
...@@ -1228,7 +1228,7 @@ static void do_ftl_request(request_arg_t) ...@@ -1228,7 +1228,7 @@ static void do_ftl_request(request_arg_t)
CURRENT->sector += CURRENT->current_nr_sectors; CURRENT->sector += CURRENT->current_nr_sectors;
} }
end_request((ret == 0) ? 1 : 0); end_request(CURRENT, (ret == 0) ? 1 : 0);
} while (1); } while (1);
} /* do_ftl_request */ } /* do_ftl_request */
......
...@@ -926,7 +926,7 @@ void nftl_request(RQFUNC_ARG) ...@@ -926,7 +926,7 @@ void nftl_request(RQFUNC_ARG)
repeat: repeat:
DEBUG(MTD_DEBUG_LEVEL3, "end_request(%d)\n", res); DEBUG(MTD_DEBUG_LEVEL3, "end_request(%d)\n", res);
spin_lock_irq(QUEUE->queue_lock); spin_lock_irq(QUEUE->queue_lock);
end_request(res); end_request(CURRENT, res);
} }
} }
......
...@@ -693,7 +693,7 @@ void xpram_request(request_queue_t * queue) ...@@ -693,7 +693,7 @@ void xpram_request(request_queue_t * queue)
static int count = 0; static int count = 0;
if (count++ < 5) /* print the message at most five times */ if (count++ < 5) /* print the message at most five times */
PRINT_WARN(" request for unknown device\n"); PRINT_WARN(" request for unknown device\n");
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
...@@ -703,7 +703,7 @@ void xpram_request(request_queue_t * queue) ...@@ -703,7 +703,7 @@ void xpram_request(request_queue_t * queue)
/* does request exceed size of device ? */ /* does request exceed size of device ? */
if ( XPRAM_SEC2KB(sects_to_copy) > xpram_sizes[dev_no] ) { if ( XPRAM_SEC2KB(sects_to_copy) > xpram_sizes[dev_no] ) {
PRINT_WARN(" request past end of device\n"); PRINT_WARN(" request past end of device\n");
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
...@@ -717,20 +717,20 @@ void xpram_request(request_queue_t * queue) ...@@ -717,20 +717,20 @@ void xpram_request(request_queue_t * queue)
if ( current_req->sector & (XPRAM_SEC_IN_PG - 1) ) { if ( current_req->sector & (XPRAM_SEC_IN_PG - 1) ) {
PRINT_WARN(" request does not start at an expanded storage page boundery\n"); PRINT_WARN(" request does not start at an expanded storage page boundery\n");
PRINT_WARN(" referenced sector: %ld\n",current_req->sector); PRINT_WARN(" referenced sector: %ld\n",current_req->sector);
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
/* Does request refere to partial expanded storage pages? */ /* Does request refere to partial expanded storage pages? */
if ( sects_to_copy & (XPRAM_SEC_IN_PG - 1) ) { if ( sects_to_copy & (XPRAM_SEC_IN_PG - 1) ) {
PRINT_WARN(" request referes to a partial expanded storage page\n"); PRINT_WARN(" request referes to a partial expanded storage page\n");
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
#endif /* XPRAM_SEC_IN_PG != 1 */ #endif /* XPRAM_SEC_IN_PG != 1 */
/* Is request buffer aligned with kernel pages? */ /* Is request buffer aligned with kernel pages? */
if ( ((unsigned long)buffer) & (XPRAM_PGSIZE-1) ) { if ( ((unsigned long)buffer) & (XPRAM_PGSIZE-1) ) {
PRINT_WARN(" request buffer is not aligned with kernel pages\n"); PRINT_WARN(" request buffer is not aligned with kernel pages\n");
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
...@@ -768,11 +768,11 @@ void xpram_request(request_queue_t * queue) ...@@ -768,11 +768,11 @@ void xpram_request(request_queue_t * queue)
break; break;
default: default:
/* can't happen */ /* can't happen */
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if ( fault ) end_request(0); if ( fault ) end_request(CURRENT, 0);
else end_request(1); /* success */ else end_request(CURRENT, 1); /* success */
} }
} }
......
...@@ -213,7 +213,7 @@ static void jsfd_do_request(request_queue_t *q) ...@@ -213,7 +213,7 @@ static void jsfd_do_request(request_queue_t *q)
dev = MINOR(req->rq_dev); dev = MINOR(req->rq_dev);
if (dev >= JSF_MAX || (dev & JSF_PART_MASK) >= JSF_NPART) { if (dev >= JSF_MAX || (dev & JSF_PART_MASK) >= JSF_NPART) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
jdp = &jsf0.dv[dev & JSF_PART_MASK]; jdp = &jsf0.dv[dev & JSF_PART_MASK];
...@@ -221,31 +221,31 @@ static void jsfd_do_request(request_queue_t *q) ...@@ -221,31 +221,31 @@ static void jsfd_do_request(request_queue_t *q)
offset = req->sector << 9; offset = req->sector << 9;
len = req->current_nr_sectors << 9; len = req->current_nr_sectors << 9;
if ((offset + len) > jdp->dsize) { if ((offset + len) > jdp->dsize) {
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if (req->cmd == WRITE) { if (req->cmd == WRITE) {
printk(KERN_ERR "jsfd: write\n"); printk(KERN_ERR "jsfd: write\n");
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if (req->cmd != READ) { if (req->cmd != READ) {
printk(KERN_ERR "jsfd: bad req->cmd %d\n", req->cmd); printk(KERN_ERR "jsfd: bad req->cmd %d\n", req->cmd);
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
if ((jdp->dbase & 0xff000000) != 0x20000000) { if ((jdp->dbase & 0xff000000) != 0x20000000) {
printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase); printk(KERN_ERR "jsfd: bad base %x\n", (int)jdp->dbase);
end_request(0); end_request(CURRENT, 0);
continue; continue;
} }
/* printk("jsfd%d: read buf %p off %x len %x\n", dev, req->buffer, (int)offset, (int)len); */ /* P3 */ /* printk("jsfd%d: read buf %p off %x len %x\n", dev, req->buffer, (int)offset, (int)len); */ /* P3 */
jsfd_read(req->buffer, jdp->dbase + offset, len); jsfd_read(req->buffer, jdp->dbase + offset, len);
end_request(1); end_request(CURRENT, 1);
} }
} }
......
...@@ -114,11 +114,9 @@ extern inline struct request *elv_next_request(request_queue_t *q) ...@@ -114,11 +114,9 @@ extern inline struct request *elv_next_request(request_queue_t *q)
* If we have our own end_request, we do not want to include this mess * If we have our own end_request, we do not want to include this mess
*/ */
#ifndef LOCAL_END_REQUEST #ifndef LOCAL_END_REQUEST
static inline void end_request(int uptodate) static inline void end_request(struct request *req, int uptodate)
{ {
struct request *req = CURRENT; if (end_that_request_first(req, uptodate, req->hard_cur_sectors))
if (end_that_request_first(req, uptodate, CURRENT->hard_cur_sectors))
return; return;
add_blkdev_randomness(major(req->rq_dev)); add_blkdev_randomness(major(req->rq_dev));
......
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