Add missing brelse(bp). Without it the cache grows and we have a n^2
lookup. I'm not entirely sure why we read the block before we write it
back out, since the only side effect of that is to allocate memory,
clear the memory, read it in from disk, throw it away with the contents
of the file being written out. We likely should just do a getblk() here
instead, but even with all that, this takes the time it takes to create
a 150MB msdos fs image down from 5 minutes to 30 seconds.
Before:
317.663u 0.685s 5:18.34 100.0% 198+360k 0+19io 1009pf+0w
After:
7.330u 23.841s 0:31.17 100.0% 198+360k 0+250522io 4pf+0w
Sponsored by: Netflix