Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
dc3f4198
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dc3f4198
编写于
5月 18, 2015
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make simple_positive() public
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
5d754ced
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
25 addition
and
60 deletion
+25
-60
arch/powerpc/platforms/cell/spufs/inode.c
arch/powerpc/platforms/cell/spufs/inode.c
+1
-1
arch/s390/hypfs/inode.c
arch/s390/hypfs/inode.c
+1
-6
drivers/block/drbd/drbd_debugfs.c
drivers/block/drbd/drbd_debugfs.c
+1
-9
drivers/infiniband/hw/ipath/ipath_fs.c
drivers/infiniband/hw/ipath/ipath_fs.c
+1
-1
drivers/infiniband/hw/qib/qib_fs.c
drivers/infiniband/hw/qib/qib_fs.c
+1
-1
fs/autofs4/autofs_i.h
fs/autofs4/autofs_i.h
+0
-5
fs/ceph/dir.c
fs/ceph/dir.c
+1
-1
fs/configfs/inode.c
fs/configfs/inode.c
+1
-1
fs/debugfs/inode.c
fs/debugfs/inode.c
+3
-8
fs/libfs.c
fs/libfs.c
+0
-5
fs/nfs/dir.c
fs/nfs/dir.c
+1
-1
fs/tracefs/inode.c
fs/tracefs/inode.c
+3
-8
include/linux/dcache.h
include/linux/dcache.h
+5
-0
security/inode.c
security/inode.c
+6
-13
未找到文件。
arch/powerpc/platforms/cell/spufs/inode.c
浏览文件 @
dc3f4198
...
...
@@ -166,7 +166,7 @@ static void spufs_prune_dir(struct dentry *dir)
mutex_lock
(
&
d_inode
(
dir
)
->
i_mutex
);
list_for_each_entry_safe
(
dentry
,
tmp
,
&
dir
->
d_subdirs
,
d_child
)
{
spin_lock
(
&
dentry
->
d_lock
);
if
(
!
(
d_unhashed
(
dentry
))
&&
d_really_is
_positive
(
dentry
))
{
if
(
simple
_positive
(
dentry
))
{
dget_dlock
(
dentry
);
__d_drop
(
dentry
);
spin_unlock
(
&
dentry
->
d_lock
);
...
...
arch/s390/hypfs/inode.c
浏览文件 @
dc3f4198
...
...
@@ -62,18 +62,13 @@ static void hypfs_add_dentry(struct dentry *dentry)
hypfs_last_dentry
=
dentry
;
}
static
inline
int
hypfs_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
static
void
hypfs_remove
(
struct
dentry
*
dentry
)
{
struct
dentry
*
parent
;
parent
=
dentry
->
d_parent
;
mutex_lock
(
&
d_inode
(
parent
)
->
i_mutex
);
if
(
hypfs
_positive
(
dentry
))
{
if
(
simple
_positive
(
dentry
))
{
if
(
d_is_dir
(
dentry
))
simple_rmdir
(
d_inode
(
parent
),
dentry
);
else
...
...
drivers/block/drbd/drbd_debugfs.c
浏览文件 @
dc3f4198
...
...
@@ -419,14 +419,6 @@ static int in_flight_summary_show(struct seq_file *m, void *pos)
return
0
;
}
/* simple_positive(file->f_path.dentry) respectively debugfs_positive(),
* but neither is "reachable" from here.
* So we have our own inline version of it above. :-( */
static
inline
int
debugfs_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
/* make sure at *open* time that the respective object won't go away. */
static
int
drbd_single_open
(
struct
file
*
file
,
int
(
*
show
)(
struct
seq_file
*
,
void
*
),
void
*
data
,
struct
kref
*
kref
,
...
...
@@ -444,7 +436,7 @@ static int drbd_single_open(struct file *file, int (*show)(struct seq_file *, vo
/* serialize with d_delete() */
mutex_lock
(
&
d_inode
(
parent
)
->
i_mutex
);
/* Make sure the object is still alive */
if
(
debugfs
_positive
(
file
->
f_path
.
dentry
)
if
(
simple
_positive
(
file
->
f_path
.
dentry
)
&&
kref_get_unless_zero
(
kref
))
ret
=
0
;
mutex_unlock
(
&
d_inode
(
parent
)
->
i_mutex
);
...
...
drivers/infiniband/hw/ipath/ipath_fs.c
浏览文件 @
dc3f4198
...
...
@@ -277,7 +277,7 @@ static int remove_file(struct dentry *parent, char *name)
}
spin_lock
(
&
tmp
->
d_lock
);
if
(
!
d_unhashed
(
tmp
)
&&
d_really_is
_positive
(
tmp
))
{
if
(
simple
_positive
(
tmp
))
{
dget_dlock
(
tmp
);
__d_drop
(
tmp
);
spin_unlock
(
&
tmp
->
d_lock
);
...
...
drivers/infiniband/hw/qib/qib_fs.c
浏览文件 @
dc3f4198
...
...
@@ -455,7 +455,7 @@ static int remove_file(struct dentry *parent, char *name)
}
spin_lock
(
&
tmp
->
d_lock
);
if
(
!
d_unhashed
(
tmp
)
&&
d_really_is
_positive
(
tmp
))
{
if
(
simple
_positive
(
tmp
))
{
__d_drop
(
tmp
);
spin_unlock
(
&
tmp
->
d_lock
);
simple_unlink
(
d_inode
(
parent
),
tmp
);
...
...
fs/autofs4/autofs_i.h
浏览文件 @
dc3f4198
...
...
@@ -238,11 +238,6 @@ static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
return
d_inode
(
sbi
->
sb
->
s_root
)
->
i_ino
;
}
static
inline
int
simple_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
static
inline
void
__autofs4_add_expiring
(
struct
dentry
*
dentry
)
{
struct
autofs_sb_info
*
sbi
=
autofs4_sbi
(
dentry
->
d_sb
);
...
...
fs/ceph/dir.c
浏览文件 @
dc3f4198
...
...
@@ -161,7 +161,7 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
}
spin_lock_nested
(
&
dentry
->
d_lock
,
DENTRY_D_LOCK_NESTED
);
if
(
di
->
lease_shared_gen
==
shared_gen
&&
!
d_unhashed
(
dentry
)
&&
d_really_is
_positive
(
dentry
)
&&
simple
_positive
(
dentry
)
&&
ceph_snap
(
d_inode
(
dentry
))
!=
CEPH_SNAPDIR
&&
ceph_ino
(
d_inode
(
dentry
))
!=
CEPH_INO_CEPH
&&
fpos_cmp
(
ctx
->
pos
,
di
->
offset
)
<=
0
)
...
...
fs/configfs/inode.c
浏览文件 @
dc3f4198
...
...
@@ -236,7 +236,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
if
(
dentry
)
{
spin_lock
(
&
dentry
->
d_lock
);
if
(
!
d_unhashed
(
dentry
)
&&
d_really_is
_positive
(
dentry
))
{
if
(
simple
_positive
(
dentry
))
{
dget_dlock
(
dentry
);
__d_drop
(
dentry
);
spin_unlock
(
&
dentry
->
d_lock
);
...
...
fs/debugfs/inode.c
浏览文件 @
dc3f4198
...
...
@@ -44,11 +44,6 @@ static struct inode *debugfs_get_inode(struct super_block *sb)
return
inode
;
}
static
inline
int
debugfs_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
struct
debugfs_mount_opts
{
kuid_t
uid
;
kgid_t
gid
;
...
...
@@ -522,7 +517,7 @@ static int __debugfs_remove(struct dentry *dentry, struct dentry *parent)
{
int
ret
=
0
;
if
(
debugfs
_positive
(
dentry
))
{
if
(
simple
_positive
(
dentry
))
{
dget
(
dentry
);
if
(
d_is_dir
(
dentry
))
ret
=
simple_rmdir
(
d_inode
(
parent
),
dentry
);
...
...
@@ -602,7 +597,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
*/
spin_lock
(
&
parent
->
d_lock
);
list_for_each_entry
(
child
,
&
parent
->
d_subdirs
,
d_child
)
{
if
(
!
debugfs
_positive
(
child
))
if
(
!
simple
_positive
(
child
))
continue
;
/* perhaps simple_empty(child) makes more sense */
...
...
@@ -623,7 +618,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
* from d_subdirs. When releasing the parent->d_lock we can
* no longer trust that the next pointer is valid.
* Restart the loop. We'll skip this one with the
*
debugfs
_positive() check.
*
simple
_positive() check.
*/
goto
loop
;
}
...
...
fs/libfs.c
浏览文件 @
dc3f4198
...
...
@@ -20,11 +20,6 @@
#include "internal.h"
static
inline
int
simple_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
int
simple_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
,
struct
kstat
*
stat
)
{
...
...
fs/nfs/dir.c
浏览文件 @
dc3f4198
...
...
@@ -1771,7 +1771,7 @@ EXPORT_SYMBOL_GPL(nfs_mkdir);
static
void
nfs_dentry_handle_enoent
(
struct
dentry
*
dentry
)
{
if
(
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
))
if
(
simple_positive
(
dentry
))
d_delete
(
dentry
);
}
...
...
fs/tracefs/inode.c
浏览文件 @
dc3f4198
...
...
@@ -496,16 +496,11 @@ struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *pare
return
dentry
;
}
static
inline
int
tracefs_positive
(
struct
dentry
*
dentry
)
{
return
dentry
->
d_inode
&&
!
d_unhashed
(
dentry
);
}
static
int
__tracefs_remove
(
struct
dentry
*
dentry
,
struct
dentry
*
parent
)
{
int
ret
=
0
;
if
(
tracefs
_positive
(
dentry
))
{
if
(
simple
_positive
(
dentry
))
{
if
(
dentry
->
d_inode
)
{
dget
(
dentry
);
switch
(
dentry
->
d_inode
->
i_mode
&
S_IFMT
)
{
...
...
@@ -582,7 +577,7 @@ void tracefs_remove_recursive(struct dentry *dentry)
*/
spin_lock
(
&
parent
->
d_lock
);
list_for_each_entry
(
child
,
&
parent
->
d_subdirs
,
d_child
)
{
if
(
!
tracefs
_positive
(
child
))
if
(
!
simple
_positive
(
child
))
continue
;
/* perhaps simple_empty(child) makes more sense */
...
...
@@ -603,7 +598,7 @@ void tracefs_remove_recursive(struct dentry *dentry)
* from d_subdirs. When releasing the parent->d_lock we can
* no longer trust that the next pointer is valid.
* Restart the loop. We'll skip this one with the
*
tracefs
_positive() check.
*
simple
_positive() check.
*/
goto
loop
;
}
...
...
include/linux/dcache.h
浏览文件 @
dc3f4198
...
...
@@ -507,6 +507,11 @@ static inline bool d_really_is_positive(const struct dentry *dentry)
return
dentry
->
d_inode
!=
NULL
;
}
static
inline
int
simple_positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
extern
void
d_set_fallthru
(
struct
dentry
*
dentry
);
static
inline
bool
d_is_fallthru
(
const
struct
dentry
*
dentry
)
...
...
security/inode.c
浏览文件 @
dc3f4198
...
...
@@ -25,11 +25,6 @@
static
struct
vfsmount
*
mount
;
static
int
mount_count
;
static
inline
int
positive
(
struct
dentry
*
dentry
)
{
return
d_really_is_positive
(
dentry
)
&&
!
d_unhashed
(
dentry
);
}
static
int
fill_super
(
struct
super_block
*
sb
,
void
*
data
,
int
silent
)
{
static
struct
tree_descr
files
[]
=
{{
""
}};
...
...
@@ -201,14 +196,12 @@ void securityfs_remove(struct dentry *dentry)
return
;
mutex_lock
(
&
d_inode
(
parent
)
->
i_mutex
);
if
(
positive
(
dentry
))
{
if
(
d_really_is_positive
(
dentry
))
{
if
(
d_is_dir
(
dentry
))
simple_rmdir
(
d_inode
(
parent
),
dentry
);
else
simple_unlink
(
d_inode
(
parent
),
dentry
);
dput
(
dentry
);
}
if
(
simple_positive
(
dentry
))
{
if
(
d_is_dir
(
dentry
))
simple_rmdir
(
d_inode
(
parent
),
dentry
);
else
simple_unlink
(
d_inode
(
parent
),
dentry
);
dput
(
dentry
);
}
mutex_unlock
(
&
d_inode
(
parent
)
->
i_mutex
);
simple_release_fs
(
&
mount
,
&
mount_count
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录