Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
5fd96933
提交
5fd96933
2月 15, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
try to live without operator->()
上级
9c16a4ba
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
13 行增加
和
20 行删除
+13
-20
atomic_std.h
atomic_std.h
+0
-8
fs.cc
fs.cc
+9
-8
ns.hh
ns.hh
+2
-2
sysfile.cc
sysfile.cc
+2
-2
没有找到文件。
atomic_std.h
浏览文件 @
5fd96933
...
...
@@ -246,14 +246,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
return
__pointer_type
(
_M_b
);
}
__pointer_type
operator
->
()
const
{
return
__pointer_type
(
_M_b
);
}
__pointer_type
operator
->
()
const
volatile
{
return
__pointer_type
(
_M_b
);
}
__pointer_type
operator
=
(
__pointer_type
__p
)
{
return
_M_b
.
operator
=
(
__p
);
}
...
...
fs.cc
浏览文件 @
5fd96933
...
...
@@ -228,11 +228,12 @@ inode::inode()
inode
::~
inode
()
{
if
(
dir
)
{
dir
->
remove
(
strbuf
<
DIRSIZ
>
(
"."
));
dir
->
remove
(
strbuf
<
DIRSIZ
>
(
".."
));
gc_delayed
(
dir
);
dir
=
0
;
auto
d
=
dir
.
load
();
if
(
d
)
{
d
->
remove
(
strbuf
<
DIRSIZ
>
(
"."
));
d
->
remove
(
strbuf
<
DIRSIZ
>
(
".."
));
gc_delayed
(
d
);
assert
(
cmpxch
(
&
dir
,
d
,
(
decltype
(
d
))
0
));
}
destroylock
(
&
lock
);
...
...
@@ -659,7 +660,7 @@ dir_flush(struct inode *dp)
return
;
u32
off
=
0
;
dp
->
dir
->
enumerate
([
dp
,
&
off
](
const
strbuf
<
DIRSIZ
>
&
name
,
const
u32
&
inum
)
->
bool
{
dp
->
dir
.
load
()
->
enumerate
([
dp
,
&
off
](
const
strbuf
<
DIRSIZ
>
&
name
,
const
u32
&
inum
)
->
bool
{
struct
dirent
de
;
strncpy
(
de
.
name
,
name
.
_buf
,
DIRSIZ
);
de
.
inum
=
inum
;
...
...
@@ -676,7 +677,7 @@ dirlookup(struct inode *dp, char *name)
{
dir_init
(
dp
);
u32
inum
=
dp
->
dir
->
lookup
(
strbuf
<
DIRSIZ
>
(
name
));
u32
inum
=
dp
->
dir
.
load
()
->
lookup
(
strbuf
<
DIRSIZ
>
(
name
));
//cprintf("dirlookup: %x (%d): %s -> %d\n", dp, dp->inum, name, inum);
if
(
inum
==
0
)
...
...
@@ -692,7 +693,7 @@ dirlink(struct inode *dp, const char *name, u32 inum)
dir_init
(
dp
);
//cprintf("dirlink: %x (%d): %s -> %d\n", dp, dp->inum, name, inum);
return
dp
->
dir
->
insert
(
strbuf
<
DIRSIZ
>
(
name
),
inum
);
return
dp
->
dir
.
load
()
->
insert
(
strbuf
<
DIRSIZ
>
(
name
),
inum
);
}
// Paths
...
...
ns.hh
浏览文件 @
5fd96933
...
...
@@ -99,7 +99,7 @@ class xns : public rcu_freed {
u64
i
=
h
(
key
);
scoped_gc_epoch
gc
;
auto
e
=
table
[
i
].
chain
;
auto
e
=
table
[
i
].
chain
.
load
()
;
while
(
e
)
{
if
(
e
->
key
==
key
)
...
...
@@ -153,7 +153,7 @@ class xns : public rcu_freed {
void
enumerate
(
CB
cb
)
{
scoped_gc_epoch
gc
;
for
(
int
i
=
0
;
i
<
NHASH
;
i
++
)
{
auto
e
=
table
[
i
].
chain
;
auto
e
=
table
[
i
].
chain
.
load
()
;
while
(
e
)
{
if
(
cb
(
e
->
key
,
e
->
val
))
return
;
...
...
sysfile.cc
浏览文件 @
5fd96933
...
...
@@ -183,7 +183,7 @@ isdirempty(struct inode *dp)
{
dir_init
(
dp
);
int
empty
=
1
;
dp
->
dir
->
enumerate
([
&
empty
](
const
strbuf
<
DIRSIZ
>
&
name
,
u64
ino
)
->
bool
{
dp
->
dir
.
load
()
->
enumerate
([
&
empty
](
const
strbuf
<
DIRSIZ
>
&
name
,
u64
ino
)
->
bool
{
if
(
!
strcmp
(
name
.
_buf
,
"."
))
return
false
;
if
(
!
strcmp
(
name
.
_buf
,
".."
))
...
...
@@ -229,7 +229,7 @@ sys_unlink(void)
}
dir_init
(
dp
);
if
(
dp
->
dir
->
remove
(
strbuf
<
DIRSIZ
>
(
name
),
&
ip
->
inum
)
==
0
)
{
if
(
dp
->
dir
.
load
()
->
remove
(
strbuf
<
DIRSIZ
>
(
name
),
&
ip
->
inum
)
==
0
)
{
iunlockput
(
ip
);
goto
retry
;
}
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论