|
/usr/src/linux/drivers/block/ll_rw_blk.c中
int end_that_request_first (struct request *req, int uptodate, char *name)
{
struct buffer_head * bh;
int nsect;
req->errors = 0;
if (!uptodate)
printk("end_request: I/O error, dev %s (%s), sector %lu\n",
kdevname(req->rq_dev), name, req->sector);
if ((bh = req->bh) != NULL) {
nsect = bh->b_size >> 9;
blk_finished_io(nsect);
req->bh = bh->b_reqnext;
bh->b_reqnext = NULL;
bh->b_end_io(bh, uptodate);
if ((bh = req->bh) != NULL) {
req->hard_sector += nsect;
req->hard_nr_sectors -= nsect;
req->sector = req->hard_sector;
req->nr_sectors = req->hard_nr_sectors;
req->current_nr_sectors = bh->b_size >> 9;
req->hard_cur_sectors = req->current_nr_sectors;
if (req->nr_sectors < req->current_nr_sectors) {//??????
req->nr_sectors = req->current_nr_sectors;
printk("end_request: buffer-list destroyed\n");
}
req->buffer = bh->b_data;
return 1;
}
}
return 0;
}
为什么在if (req->nr_sectors < req->current_nr_sectors) {//??????
req->nr_sectors = req->current_nr_sectors;
printk("end_request: buffer-list destroyed\n");
}就说破坏了缓冲区链呢?
request结构中的hard_sector ,hard_nr_sectors,hard_cur_sectors 是指什么呢? |
|