Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146981
b: refs/heads/master
c: f06d9a2
h: refs/heads/master
i:
  146979: 3ceee30
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 28, 2009
1 parent a62512e commit 989d14c
Show file tree
Hide file tree
Showing 20 changed files with 129 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40cbbb781d3eba5d6ac0860db078af490e5c7c6b
refs/heads/master: f06d9a2b52e246a66b606130cea3f0d7b7be17a7
10 changes: 5 additions & 5 deletions trunk/drivers/block/amiflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ static void redo_fd_request(void)
#endif
block = CURRENT->sector + cnt;
if ((int)block > floppy->blocks) {
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}

Expand All @@ -1373,11 +1373,11 @@ static void redo_fd_request(void)

if ((rq_data_dir(CURRENT) != READ) && (rq_data_dir(CURRENT) != WRITE)) {
printk(KERN_WARNING "do_fd_request: unknown command\n");
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}
if (get_track(drive, track) == -1) {
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}

Expand All @@ -1391,7 +1391,7 @@ static void redo_fd_request(void)

/* keep the drive spinning while writes are scheduled */
if (!fd_motor_on(drive)) {
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}
/*
Expand All @@ -1410,7 +1410,7 @@ static void redo_fd_request(void)
CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors;

end_request(CURRENT, 1);
__blk_end_request_cur(CURRENT, 0);
goto repeat;
}

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/block/ataflop.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ static void fd_error( void )
CURRENT->errors++;
if (CURRENT->errors >= MAX_ERRORS) {
printk(KERN_ERR "fd%d: too many errors.\n", SelectedDrive );
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
}
else if (CURRENT->errors == RECALIBRATE_ERRORS) {
printk(KERN_WARNING "fd%d: recalibrating\n", SelectedDrive );
Expand Down Expand Up @@ -734,7 +734,7 @@ static void do_fd_action( int drive )
/* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors;
end_request(CURRENT, 1);
__blk_end_request_cur(CURRENT, 0);
redo_fd_request();
return;
}
Expand Down Expand Up @@ -1141,7 +1141,7 @@ static void fd_rwsec_done1(int status)
/* all sectors finished */
CURRENT->nr_sectors -= CURRENT->current_nr_sectors;
CURRENT->sector += CURRENT->current_nr_sectors;
end_request(CURRENT, 1);
__blk_end_request_cur(CURRENT, 0);
redo_fd_request();
}
return;
Expand Down Expand Up @@ -1414,7 +1414,7 @@ static void redo_fd_request(void)
if (!UD.connected) {
/* drive not connected */
printk(KERN_ERR "Unknown Device: fd%d\n", drive );
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}

Expand All @@ -1430,12 +1430,12 @@ static void redo_fd_request(void)
/* user supplied disk type */
if (--type >= NUM_DISK_MINORS) {
printk(KERN_WARNING "fd%d: invalid disk format", drive );
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}
if (minor2disktype[type].drive_types > DriveType) {
printk(KERN_WARNING "fd%d: unsupported disk format", drive );
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}
type = minor2disktype[type].index;
Expand All @@ -1445,7 +1445,7 @@ static void redo_fd_request(void)
}

if (CURRENT->sector + 1 > UDT->blocks) {
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
goto repeat;
}

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static void bad_rw_intr(void)
if (req != NULL) {
struct hd_i_struct *disk = req->rq_disk->private_data;
if (++req->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) {
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
disk->special_op = disk->recalibrate = 1;
} else if (req->errors % RESET_FREQ == 0)
reset = 1;
Expand Down Expand Up @@ -466,7 +466,7 @@ static void read_intr(void)
req->buffer+512);
#endif
if (req->current_nr_sectors <= 0)
end_request(req, 1);
__blk_end_request_cur(req, 0);
if (i > 0) {
SET_HANDLER(&read_intr);
return;
Expand Down Expand Up @@ -505,7 +505,7 @@ static void write_intr(void)
--req->current_nr_sectors;
req->buffer += 512;
if (!i || (req->bio && req->current_nr_sectors <= 0))
end_request(req, 1);
__blk_end_request_cur(req, 0);
if (i > 0) {
SET_HANDLER(&write_intr);
outsw(HD_DATA, req->buffer, 256);
Expand Down Expand Up @@ -548,7 +548,7 @@ static void hd_times_out(unsigned long dummy)
#ifdef DEBUG
printk("%s: too many errors\n", name);
#endif
end_request(CURRENT, 0);
__blk_end_request_cur(CURRENT, -EIO);
}
hd_request();
spin_unlock_irq(hd_queue->queue_lock);
Expand All @@ -563,7 +563,7 @@ static int do_special_op(struct hd_i_struct *disk, struct request *req)
}
if (disk->head > 16) {
printk("%s: cannot handle device with more than 16 heads - giving up\n", req->rq_disk->disk_name);
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
}
disk->special_op = 0;
return 1;
Expand Down Expand Up @@ -607,7 +607,7 @@ static void hd_request(void)
((block+nsect) > get_capacity(req->rq_disk))) {
printk("%s: bad access: block=%d, count=%d\n",
req->rq_disk->disk_name, block, nsect);
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
goto repeat;
}

Expand Down Expand Up @@ -647,7 +647,7 @@ static void hd_request(void)
break;
default:
printk("unknown hd-command\n");
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
break;
}
}
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/block/mg_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static void mg_bad_rw_intr(struct mg_host *host)
if (req != NULL)
if (++req->errors >= MG_MAX_ERRORS ||
host->error == MG_ERR_TIMEOUT)
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
}

static unsigned int mg_out(struct mg_host *host,
Expand Down Expand Up @@ -351,7 +351,7 @@ static void mg_read(struct request *req)

if (req->current_nr_sectors <= 0) {
MG_DBG("remain : %d sects\n", remains);
end_request(req, 1);
__blk_end_request_cur(req, 0);
if (remains > 0)
req = elv_next_request(host->breq);
}
Expand Down Expand Up @@ -395,7 +395,7 @@ static void mg_write(struct request *req)

if (req->current_nr_sectors <= 0) {
MG_DBG("remain : %d sects\n", remains);
end_request(req, 1);
__blk_end_request_cur(req, 0);
if (remains > 0)
req = elv_next_request(host->breq);
}
Expand Down Expand Up @@ -448,7 +448,7 @@ static void mg_read_intr(struct mg_host *host)

/* let know if current segment done */
if (req->current_nr_sectors <= 0)
end_request(req, 1);
__blk_end_request_cur(req, 0);

/* set handler if read remains */
if (i > 0) {
Expand Down Expand Up @@ -497,7 +497,7 @@ static void mg_write_intr(struct mg_host *host)

/* let know if current segment or all done */
if (!i || (req->bio && req->current_nr_sectors <= 0))
end_request(req, 1);
__blk_end_request_cur(req, 0);

/* write 1 sector and set handler if remains */
if (i > 0) {
Expand Down Expand Up @@ -563,7 +563,7 @@ static void mg_request_poll(struct request_queue *q)
default:
printk(KERN_WARNING "%s:%d unknown command\n",
__func__, __LINE__);
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
break;
}
}
Expand Down Expand Up @@ -617,7 +617,7 @@ static unsigned int mg_issue_req(struct request *req,
default:
printk(KERN_WARNING "%s:%d unknown command\n",
__func__, __LINE__);
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
break;
}
return MG_ERR_NONE;
Expand Down Expand Up @@ -655,7 +655,7 @@ static void mg_request(struct request_queue *q)
"%s: bad access: sector=%d, count=%d\n",
req->rq_disk->disk_name,
sect_num, sect_cnt);
end_request(req, 0);
__blk_end_request_cur(req, -EIO);
continue;
}

Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/block/paride/pcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,16 @@ static void do_pcd_request(struct request_queue * q)
ps_set_intr(do_pcd_read, NULL, 0, nice);
return;
} else
end_request(pcd_req, 0);
__blk_end_request_cur(pcd_req, -EIO);
}
}

static inline void next_request(int success)
static inline void next_request(int err)
{
unsigned long saved_flags;

spin_lock_irqsave(&pcd_lock, saved_flags);
end_request(pcd_req, success);
__blk_end_request_cur(pcd_req, err);
pcd_busy = 0;
do_pcd_request(pcd_queue);
spin_unlock_irqrestore(&pcd_lock, saved_flags);
Expand Down Expand Up @@ -781,7 +781,7 @@ static void pcd_start(void)

if (pcd_command(pcd_current, rd_cmd, 2048, "read block")) {
pcd_bufblk = -1;
next_request(0);
next_request(-EIO);
return;
}

Expand All @@ -796,7 +796,7 @@ static void do_pcd_read(void)
pcd_retries = 0;
pcd_transfer();
if (!pcd_count) {
next_request(1);
next_request(0);
return;
}

Expand All @@ -815,7 +815,7 @@ static void do_pcd_read_drq(void)
return;
}
pcd_bufblk = -1;
next_request(0);
next_request(-EIO);
return;
}

Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/block/paride/pd.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ static void run_fsm(void)
pd_claimed = 0;
phase = NULL;
spin_lock_irqsave(&pd_lock, saved_flags);
end_request(pd_req, res);
__blk_end_request_cur(pd_req,
res == Ok ? 0 : -EIO);
pd_req = elv_next_request(pd_queue);
if (!pd_req)
stop = 1;
Expand Down Expand Up @@ -477,7 +478,7 @@ static int pd_next_buf(void)
if (pd_count)
return 0;
spin_lock_irqsave(&pd_lock, saved_flags);
end_request(pd_req, 1);
__blk_end_request_cur(pd_req, 0);
pd_count = pd_req->current_nr_sectors;
pd_buf = pd_req->buffer;
spin_unlock_irqrestore(&pd_lock, saved_flags);
Expand Down
Loading

0 comments on commit 989d14c

Please sign in to comment.