This is too ugly to live long term but will do for the moment while I figure
out the proper way to deal with this and avoid things like the double search.
Possibly we need a unified 'bread' related operation that gets the contents
of a buffer into user space, by any means needed.
Something like
bp = bfind(...)
if (bp || !user) {
if (bp == NULL)
bread_no_lookup()
update fields
copy to user
unlock
return
}
issue raw copy to user page
bp = bread(dev, pblk, 0);
if (bp == NULL)
break;
+ } else {
+ /* FIXME: this has to get sorted ASAP */
+ bp->bf_time = ++bufclock;
}
uputblk(bp, uoff(), amount);