Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
70705966
提交
70705966
8月 09, 2017
创建
作者:
Robert Morris
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comment fixes
上级
da3b931d
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
9 行删除
+12
-9
bio.c
bio.c
+3
-3
fs.c
fs.c
+9
-6
没有找到文件。
bio.c
浏览文件 @
70705966
...
...
@@ -75,9 +75,9 @@ bget(uint dev, uint blockno)
}
}
// Not cached; recycle
some unused buffer and clean buffer
//
"clean" because B_DIRTY and not locked means log.c
//
hasn't yet committed the changes to the buffer
.
// Not cached; recycle
an unused buffer.
//
Even if refcnt==0, B_DIRTY indicates a buffer is in use
//
because log.c has modified it but not yet committed it
.
for
(
b
=
bcache
.
head
.
prev
;
b
!=
&
bcache
.
head
;
b
=
b
->
prev
){
if
(
b
->
refcnt
==
0
&&
(
b
->
flags
&
B_DIRTY
)
==
0
)
{
b
->
dev
=
dev
;
...
...
fs.c
浏览文件 @
70705966
...
...
@@ -155,10 +155,10 @@ bfree(int dev, uint b)
// have locked the inodes involved; this lets callers create
// multi-step atomic operations.
//
// The icache.lock spin-lock defends
ip->ref, ip->dev, and ip->inum.
//
Since ip->ref indicates whether an icache entry is free, the
//
icache.lock defends icache allocation. icache.lock also defends
//
all fields of an unallocated icache entry, during allocation
.
// The icache.lock spin-lock defends
the allocation of icache
//
entries. Since ip->ref indicates whether an entry is free,
//
and ip->dev and ip->inum indicate which i-node an entry
//
holds, one must hold icache.lock while using any of those fields
.
//
// An ip->lock sleep-lock defends all ip-> fields other than ref,
// dev, and inum. One must hold ip->lock in order to
...
...
@@ -189,8 +189,9 @@ iinit(int dev)
static
struct
inode
*
iget
(
uint
dev
,
uint
inum
);
//PAGEBREAK!
// Allocate a new inode with the given type on device dev.
// A free inode has a type of zero.
// Allocate an inode on device dev.
// Give it type type.
// Returns an unlocked but allocated and referenced inode.
struct
inode
*
ialloc
(
uint
dev
,
short
type
)
{
...
...
@@ -214,6 +215,8 @@ ialloc(uint dev, short type)
}
// Copy a modified in-memory inode to disk.
// Must be called after every change to an ip->xxx field
// that lives on disk, since i-node cache is write-through.
// Caller must hold ip->lock.
void
iupdate
(
struct
inode
*
ip
)
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论