Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
871c0067
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
871c0067
编写于
10月 16, 2008
作者:
O
OGAWA Hirofumi
提交者:
Al Viro
10月 23, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT()
Signed-off-by:
N
OGAWA Hirofumi
<
hirofumi@mail.parknet.co.jp
>
上级
9fbb76ce
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
11 deletion
+14
-11
fs/dcache.c
fs/dcache.c
+12
-9
fs/namei.c
fs/namei.c
+2
-2
未找到文件。
fs/dcache.c
浏览文件 @
871c0067
...
@@ -174,9 +174,12 @@ static struct dentry *d_kill(struct dentry *dentry)
...
@@ -174,9 +174,12 @@ static struct dentry *d_kill(struct dentry *dentry)
dentry_stat
.
nr_dentry
--
;
/* For d_free, below */
dentry_stat
.
nr_dentry
--
;
/* For d_free, below */
/*drops the locks, at that point nobody can reach this dentry */
/*drops the locks, at that point nobody can reach this dentry */
dentry_iput
(
dentry
);
dentry_iput
(
dentry
);
parent
=
dentry
->
d_parent
;
if
(
IS_ROOT
(
dentry
))
parent
=
NULL
;
else
parent
=
dentry
->
d_parent
;
d_free
(
dentry
);
d_free
(
dentry
);
return
dentry
==
parent
?
NULL
:
parent
;
return
parent
;
}
}
/*
/*
...
@@ -666,11 +669,12 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
...
@@ -666,11 +669,12 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
BUG
();
BUG
();
}
}
parent
=
dentry
->
d_parent
;
if
(
IS_ROOT
(
dentry
))
if
(
parent
==
dentry
)
parent
=
NULL
;
parent
=
NULL
;
else
else
{
parent
=
dentry
->
d_parent
;
atomic_dec
(
&
parent
->
d_count
);
atomic_dec
(
&
parent
->
d_count
);
}
list_del
(
&
dentry
->
d_u
.
d_child
);
list_del
(
&
dentry
->
d_u
.
d_child
);
detached
++
;
detached
++
;
...
@@ -1723,7 +1727,7 @@ static int d_isparent(struct dentry *p1, struct dentry *p2)
...
@@ -1723,7 +1727,7 @@ static int d_isparent(struct dentry *p1, struct dentry *p2)
{
{
struct
dentry
*
p
;
struct
dentry
*
p
;
for
(
p
=
p2
;
p
->
d_parent
!=
p
;
p
=
p
->
d_parent
)
{
for
(
p
=
p2
;
!
IS_ROOT
(
p
)
;
p
=
p
->
d_parent
)
{
if
(
p
->
d_parent
==
p1
)
if
(
p
->
d_parent
==
p1
)
return
1
;
return
1
;
}
}
...
@@ -2168,10 +2172,9 @@ int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry)
...
@@ -2168,10 +2172,9 @@ int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry)
seq
=
read_seqbegin
(
&
rename_lock
);
seq
=
read_seqbegin
(
&
rename_lock
);
for
(;;)
{
for
(;;)
{
if
(
new_dentry
!=
old_dentry
)
{
if
(
new_dentry
!=
old_dentry
)
{
struct
dentry
*
parent
=
new_dentry
->
d_parent
;
if
(
IS_ROOT
(
new_dentry
))
if
(
parent
==
new_dentry
)
break
;
break
;
new_dentry
=
parent
;
new_dentry
=
new_dentry
->
d_
parent
;
continue
;
continue
;
}
}
result
=
1
;
result
=
1
;
...
...
fs/namei.c
浏览文件 @
871c0067
...
@@ -1454,7 +1454,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
...
@@ -1454,7 +1454,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
mutex_lock
(
&
p1
->
d_inode
->
i_sb
->
s_vfs_rename_mutex
);
mutex_lock
(
&
p1
->
d_inode
->
i_sb
->
s_vfs_rename_mutex
);
for
(
p
=
p1
;
p
->
d_parent
!=
p
;
p
=
p
->
d_parent
)
{
for
(
p
=
p1
;
!
IS_ROOT
(
p
)
;
p
=
p
->
d_parent
)
{
if
(
p
->
d_parent
==
p2
)
{
if
(
p
->
d_parent
==
p2
)
{
mutex_lock_nested
(
&
p2
->
d_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
p2
->
d_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
p1
->
d_inode
->
i_mutex
,
I_MUTEX_CHILD
);
mutex_lock_nested
(
&
p1
->
d_inode
->
i_mutex
,
I_MUTEX_CHILD
);
...
@@ -1462,7 +1462,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
...
@@ -1462,7 +1462,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
}
}
}
}
for
(
p
=
p2
;
p
->
d_parent
!=
p
;
p
=
p
->
d_parent
)
{
for
(
p
=
p2
;
!
IS_ROOT
(
p
)
;
p
=
p
->
d_parent
)
{
if
(
p
->
d_parent
==
p1
)
{
if
(
p
->
d_parent
==
p1
)
{
mutex_lock_nested
(
&
p1
->
d_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
p1
->
d_inode
->
i_mutex
,
I_MUTEX_PARENT
);
mutex_lock_nested
(
&
p2
->
d_inode
->
i_mutex
,
I_MUTEX_CHILD
);
mutex_lock_nested
(
&
p2
->
d_inode
->
i_mutex
,
I_MUTEX_CHILD
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录