When will getblk() return NULL?

Song Jianping (song.jpg@263.net)
Sun, 26 Sep 1999 22:13:11 +0800


Hello all,

In getblk()( in buffer.c ), there are just two "return" statement:
if (bh) {
if (!buffer_dirty(bh)) {
if (buffer_uptodate(bh)) //最近访问过,如果不脏,且uptodate,放入表末尾
put_last_lru(bh);
bh->b_flushtime = 0;
}
return bh;
^^^^^^^^^^
}
and
if( !bh )
goto refill;
// bh can not be NULL now
....
return bh;
^^^^^^^^

So it can not return NULL.
But in block_read of block_dev.c,it assumes getblk() can return
NULL, and in this case it will copy zero to user space "buf".

Can anyone tell me when getblk() will return NULL?

Many thanks,
Song mailto:song.jpg@263.net:.炈洷殊m珉a娚b策靭wm呴b濓顬藳笔鈓閎烄戧鐉_鉃豝n噐■侂h櫒璀&{鄗侩贺辷沐y澏瓎踚鹈砘璁鍜i