Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
230c6402
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
230c6402
编写于
4月 26, 2019
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ovl_lookup_real_one(): don't bother with strlen()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
1d8b29fd
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
13 addition
and
15 deletion
+13
-15
fs/dcache.c
fs/dcache.c
+6
-8
fs/debugfs/inode.c
fs/debugfs/inode.c
+1
-1
fs/namei.c
fs/namei.c
+1
-1
fs/notify/fsnotify.c
fs/notify/fsnotify.c
+2
-2
fs/overlayfs/export.c
fs/overlayfs/export.c
+1
-1
include/linux/dcache.h
include/linux/dcache.h
+1
-1
include/linux/fsnotify.h
include/linux/fsnotify.h
+1
-1
未找到文件。
fs/dcache.c
浏览文件 @
230c6402
...
...
@@ -284,25 +284,23 @@ static inline int dname_external(const struct dentry *dentry)
void
take_dentry_name_snapshot
(
struct
name_snapshot
*
name
,
struct
dentry
*
dentry
)
{
spin_lock
(
&
dentry
->
d_lock
);
name
->
name
=
dentry
->
d_name
;
if
(
unlikely
(
dname_external
(
dentry
)))
{
struct
external_name
*
p
=
external_name
(
dentry
);
atomic_inc
(
&
p
->
u
.
count
);
spin_unlock
(
&
dentry
->
d_lock
);
name
->
name
=
p
->
name
;
atomic_inc
(
&
external_name
(
dentry
)
->
u
.
count
);
}
else
{
memcpy
(
name
->
inline_name
,
dentry
->
d_iname
,
dentry
->
d_name
.
len
+
1
);
spin_unlock
(
&
dentry
->
d_lock
);
name
->
name
=
name
->
inline_name
;
name
->
name
.
name
=
name
->
inline_name
;
}
spin_unlock
(
&
dentry
->
d_lock
);
}
EXPORT_SYMBOL
(
take_dentry_name_snapshot
);
void
release_dentry_name_snapshot
(
struct
name_snapshot
*
name
)
{
if
(
unlikely
(
name
->
name
!=
name
->
inline_name
))
{
if
(
unlikely
(
name
->
name
.
name
!=
name
->
inline_name
))
{
struct
external_name
*
p
;
p
=
container_of
(
name
->
name
,
struct
external_name
,
name
[
0
]);
p
=
container_of
(
name
->
name
.
name
,
struct
external_name
,
name
[
0
]);
if
(
unlikely
(
atomic_dec_and_test
(
&
p
->
u
.
count
)))
kfree_rcu
(
p
,
u
.
head
);
}
...
...
fs/debugfs/inode.c
浏览文件 @
230c6402
...
...
@@ -819,7 +819,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
goto
exit
;
}
d_move
(
old_dentry
,
dentry
);
fsnotify_move
(
d_inode
(
old_dir
),
d_inode
(
new_dir
),
old_name
.
name
,
fsnotify_move
(
d_inode
(
old_dir
),
d_inode
(
new_dir
),
old_name
.
name
.
name
,
d_is_dir
(
old_dentry
),
NULL
,
old_dentry
);
release_dentry_name_snapshot
(
&
old_name
);
...
...
fs/namei.c
浏览文件 @
230c6402
...
...
@@ -4498,7 +4498,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
inode_unlock
(
target
);
dput
(
new_dentry
);
if
(
!
error
)
{
fsnotify_move
(
old_dir
,
new_dir
,
old_name
.
name
,
is_dir
,
fsnotify_move
(
old_dir
,
new_dir
,
old_name
.
name
.
name
,
is_dir
,
!
(
flags
&
RENAME_EXCHANGE
)
?
target
:
NULL
,
old_dentry
);
if
(
flags
&
RENAME_EXCHANGE
)
{
fsnotify_move
(
new_dir
,
old_dir
,
old_dentry
->
d_name
.
name
,
...
...
fs/notify/fsnotify.c
浏览文件 @
230c6402
...
...
@@ -179,10 +179,10 @@ int __fsnotify_parent(const struct path *path, struct dentry *dentry, __u32 mask
take_dentry_name_snapshot
(
&
name
,
dentry
);
if
(
path
)
ret
=
fsnotify
(
p_inode
,
mask
,
path
,
FSNOTIFY_EVENT_PATH
,
name
.
name
,
0
);
name
.
name
.
name
,
0
);
else
ret
=
fsnotify
(
p_inode
,
mask
,
dentry
->
d_inode
,
FSNOTIFY_EVENT_INODE
,
name
.
name
,
0
);
name
.
name
.
name
,
0
);
release_dentry_name_snapshot
(
&
name
);
}
...
...
fs/overlayfs/export.c
浏览文件 @
230c6402
...
...
@@ -398,7 +398,7 @@ static struct dentry *ovl_lookup_real_one(struct dentry *connected,
* pointer because we hold no lock on the real dentry.
*/
take_dentry_name_snapshot
(
&
name
,
real
);
this
=
lookup_one_len
(
name
.
name
,
connected
,
strlen
(
name
.
name
)
);
this
=
lookup_one_len
(
name
.
name
.
name
,
connected
,
name
.
name
.
len
);
err
=
PTR_ERR
(
this
);
if
(
IS_ERR
(
this
))
{
goto
fail
;
...
...
include/linux/dcache.h
浏览文件 @
230c6402
...
...
@@ -593,7 +593,7 @@ static inline struct inode *d_real_inode(const struct dentry *dentry)
}
struct
name_snapshot
{
const
unsigned
char
*
name
;
struct
qstr
name
;
unsigned
char
inline_name
[
DNAME_INLINE_LEN
];
};
void
take_dentry_name_snapshot
(
struct
name_snapshot
*
,
struct
dentry
*
);
...
...
include/linux/fsnotify.h
浏览文件 @
230c6402
...
...
@@ -178,7 +178,7 @@ static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
take_dentry_name_snapshot
(
&
name
,
dentry
);
fsnotify
(
d_inode
(
parent
),
mask
,
d_inode
(
dentry
),
FSNOTIFY_EVENT_INODE
,
name
.
name
,
0
);
name
.
name
.
name
,
0
);
release_dentry_name_snapshot
(
&
name
);
dput
(
parent
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录