Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146994
b: refs/heads/master
c: e091eb6
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 28, 2009
1 parent bd597c4 commit 2a7c311
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 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: f81f2f7c9fee307e371f37424577d46f9eaf8692
refs/heads/master: e091eb67af957bac4e4f7410c5d1aa263ee483a4
36 changes: 12 additions & 24 deletions trunk/drivers/block/hd.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,32 +452,25 @@ static void read_intr(void)
bad_rw_intr();
hd_request();
return;

ok_to_read:
req = CURRENT;
insw(HD_DATA, req->buffer, 256);
req->sector++;
req->buffer += 512;
req->errors = 0;
i = --req->nr_sectors;
--req->current_nr_sectors;
#ifdef DEBUG
printk("%s: read: sector %ld, remaining = %ld, buffer=%p\n",
req->rq_disk->disk_name, req->sector, req->nr_sectors,
req->rq_disk->disk_name, req->sector + 1, req->nr_sectors - 1,
req->buffer+512);
#endif
if (req->current_nr_sectors <= 0)
__blk_end_request_cur(req, 0);
if (i > 0) {
if (__blk_end_request(req, 0, 512)) {
SET_HANDLER(&read_intr);
return;
}

(void) inb_p(HD_STATUS);
#if (HD_DELAY > 0)
last_req = read_timer();
#endif
if (elv_next_request(QUEUE))
hd_request();
return;
hd_request();
}

static void write_intr(void)
Expand All @@ -499,23 +492,18 @@ static void write_intr(void)
bad_rw_intr();
hd_request();
return;

ok_to_write:
req->sector++;
i = --req->nr_sectors;
--req->current_nr_sectors;
req->buffer += 512;
if (!i || (req->bio && req->current_nr_sectors <= 0))
__blk_end_request_cur(req, 0);
if (i > 0) {
if (__blk_end_request(req, 0, 512)) {
SET_HANDLER(&write_intr);
outsw(HD_DATA, req->buffer, 256);
} else {
return;
}

#if (HD_DELAY > 0)
last_req = read_timer();
last_req = read_timer();
#endif
hd_request();
}
return;
hd_request();
}

static void recal_intr(void)
Expand Down

0 comments on commit 2a7c311

Please sign in to comment.