Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
bcfb84b6
提交
bcfb84b6
8月 24, 2006
创建
作者:
rtm
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
big directory test
上级
1be76685
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
59 行增加
和
3 行删除
+59
-3
Notes
Notes
+10
-2
fs.c
fs.c
+4
-1
fstests.c
fstests.c
+45
-0
没有找到文件。
Notes
浏览文件 @
bcfb84b6
...
@@ -115,6 +115,11 @@ why does shell often ignore first line of input?
...
@@ -115,6 +115,11 @@ why does shell often ignore first line of input?
test: one process unlinks a file while another links to it
test: one process unlinks a file while another links to it
test: one process opens a file while another deletes it
test: one process opens a file while another deletes it
test: mkdir. deadlock d/.. vs ../d
test: mkdir. deadlock d/.. vs ../d
test: sub-sub directories. mkdir("d1/d2")
test: dup() shared fd->off
test: indirect blocks. files and directories.
test: sbrk
test: does echo foo > x truncate x?
make proc[0] runnable
make proc[0] runnable
cpu early tss and gdt
cpu early tss and gdt
...
@@ -138,4 +143,8 @@ are the locks in the right place in keyboardintr?
...
@@ -138,4 +143,8 @@ are the locks in the right place in keyboardintr?
sh: support pipes? leave it for the class?
sh: support pipes? leave it for the class?
sh: dynamic memory allocation?
sh: dynamic memory allocation?
sh: should sh support ; () & --- need malloc
sh: should sh support ; () & --- need malloc
sh: stop stdin on ctrl-d (for cat > y)
sh: stop stdin on ctrl-d (for cat > y)
\ No newline at end of file
really should have bdwrite() for file content
and make some inode updates async
so soft updates make sense
fs.c
浏览文件 @
bcfb84b6
...
@@ -262,8 +262,8 @@ iunlink(struct inode *ip)
...
@@ -262,8 +262,8 @@ iunlink(struct inode *ip)
if
(
ip
->
addrs
[
i
]
!=
0
)
{
if
(
ip
->
addrs
[
i
]
!=
0
)
{
if
(
i
==
INDIRECT
)
{
if
(
i
==
INDIRECT
)
{
inbp
=
bread
(
ip
->
dev
,
ip
->
addrs
[
INDIRECT
]);
inbp
=
bread
(
ip
->
dev
,
ip
->
addrs
[
INDIRECT
]);
uint
*
a
=
(
uint
*
)
inbp
->
data
;
for
(
j
=
0
;
j
<
NINDIRECT
;
j
++
)
{
for
(
j
=
0
;
j
<
NINDIRECT
;
j
++
)
{
uint
*
a
=
(
uint
*
)
inbp
->
data
;
if
(
a
[
j
]
!=
0
)
{
if
(
a
[
j
]
!=
0
)
{
bfree
(
ip
->
dev
,
a
[
j
]);
bfree
(
ip
->
dev
,
a
[
j
]);
a
[
j
]
=
0
;
a
[
j
]
=
0
;
...
@@ -589,6 +589,9 @@ unlink(char *cp)
...
@@ -589,6 +589,9 @@ unlink(char *cp)
ip
=
iget
(
dev
,
inum
);
ip
=
iget
(
dev
,
inum
);
if
(
ip
->
nlink
<
1
)
panic
(
"unlink nlink < 1"
);
ip
->
nlink
--
;
ip
->
nlink
--
;
iupdate
(
ip
);
iupdate
(
ip
);
...
...
fstests.c
浏览文件 @
bcfb84b6
...
@@ -365,11 +365,56 @@ concreate()
...
@@ -365,11 +365,56 @@ concreate()
puts
(
"concreate ok
\n
"
);
puts
(
"concreate ok
\n
"
);
}
}
// directory that uses indirect blocks
void
bigdir
()
{
int
i
,
fd
;
char
name
[
10
];
unlink
(
"bd"
);
fd
=
open
(
"bd"
,
O_CREATE
);
if
(
fd
<
0
){
puts
(
"bigdir create failed
\n
"
);
exit
();
}
close
(
fd
);
for
(
i
=
0
;
i
<
500
;
i
++
){
name
[
0
]
=
'x'
;
name
[
1
]
=
'0'
+
(
i
/
64
);
name
[
2
]
=
'0'
+
(
i
%
64
);
name
[
3
]
=
'\0'
;
if
(
link
(
"bd"
,
name
)
!=
0
){
puts
(
"bigdir link failed
\n
"
);
exit
();
}
puts
(
"c"
);
}
unlink
(
"bd"
);
for
(
i
=
0
;
i
<
500
;
i
++
){
name
[
0
]
=
'x'
;
name
[
1
]
=
'0'
+
(
i
/
64
);
name
[
2
]
=
'0'
+
(
i
%
64
);
name
[
3
]
=
'\0'
;
if
(
unlink
(
name
)
!=
0
){
puts
(
"bigdir unlink failed"
);
exit
();
}
puts
(
"d"
);
}
puts
(
"bigdir ok
\n
"
);
}
int
int
main
(
int
argc
,
char
*
argv
[])
main
(
int
argc
,
char
*
argv
[])
{
{
puts
(
"fstests starting
\n
"
);
puts
(
"fstests starting
\n
"
);
bigdir
();
concreate
();
concreate
();
linktest
();
linktest
();
unlinkread
();
unlinkread
();
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论