提交 82638c01 创建 作者: Dan Cross's avatar Dan Cross 提交者: Frans Kaashoek

Avoid rereading the superblock in bfree

The superblock is read when the first process returns to userspace (via the call to `iinit` from the first invocation of `forkret`, when `first` is still set to 1) and cached in a global; it is treated as immutable from that point on. There is no reason to re-read it in bfree. Removing this call seems to have simply been missed in 8320d61b when this general area was last touched. Remove it now to avoid potential confusion. Signed-off-by: 's avatarDan Cross <cross@gajendra.net>
上级 0581c37b
...@@ -84,7 +84,6 @@ bfree(int dev, uint b) ...@@ -84,7 +84,6 @@ bfree(int dev, uint b)
struct buf *bp; struct buf *bp;
int bi, m; int bi, m;
readsb(dev, &sb);
bp = bread(dev, BBLOCK(b, sb)); bp = bread(dev, BBLOCK(b, sb));
bi = b % BPB; bi = b % BPB;
m = 1 << (bi % 8); m = 1 << (bi % 8);
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论