Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ad5cb123
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
ad5cb123
编写于
10月 28, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ceph: switch to use of ->d_init()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
18fc8abd
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
5 addition
and
67 deletion
+5
-67
fs/ceph/dir.c
fs/ceph/dir.c
+2
-19
fs/ceph/export.c
fs/ceph/export.c
+2
-24
fs/ceph/file.c
fs/ceph/file.c
+0
-4
fs/ceph/inode.c
fs/ceph/inode.c
+1
-12
fs/ceph/super.c
fs/ceph/super.c
+0
-1
fs/ceph/super.h
fs/ceph/super.h
+0
-7
未找到文件。
fs/ceph/dir.c
浏览文件 @
ad5cb123
...
...
@@ -32,33 +32,19 @@ const struct dentry_operations ceph_dentry_ops;
/*
* Initialize ceph dentry state.
*/
int
ceph_init_dentry
(
struct
dentry
*
dentry
)
static
int
ceph_d_init
(
struct
dentry
*
dentry
)
{
struct
ceph_dentry_info
*
di
;
if
(
dentry
->
d_fsdata
)
return
0
;
di
=
kmem_cache_zalloc
(
ceph_dentry_cachep
,
GFP_KERNEL
);
if
(
!
di
)
return
-
ENOMEM
;
/* oh well */
spin_lock
(
&
dentry
->
d_lock
);
if
(
dentry
->
d_fsdata
)
{
/* lost a race */
kmem_cache_free
(
ceph_dentry_cachep
,
di
);
goto
out_unlock
;
}
di
->
dentry
=
dentry
;
di
->
lease_session
=
NULL
;
di
->
time
=
jiffies
;
/* avoid reordering d_fsdata setup so that the check above is safe */
smp_mb
();
dentry
->
d_fsdata
=
di
;
ceph_dentry_lru_add
(
dentry
);
out_unlock:
spin_unlock
(
&
dentry
->
d_lock
);
return
0
;
}
...
...
@@ -730,10 +716,6 @@ static struct dentry *ceph_lookup(struct inode *dir, struct dentry *dentry,
if
(
dentry
->
d_name
.
len
>
NAME_MAX
)
return
ERR_PTR
(
-
ENAMETOOLONG
);
err
=
ceph_init_dentry
(
dentry
);
if
(
err
<
0
)
return
ERR_PTR
(
err
);
/* can we conclude ENOENT locally? */
if
(
d_really_is_negative
(
dentry
))
{
struct
ceph_inode_info
*
ci
=
ceph_inode
(
dir
);
...
...
@@ -1503,4 +1485,5 @@ const struct dentry_operations ceph_dentry_ops = {
.
d_revalidate
=
ceph_d_revalidate
,
.
d_release
=
ceph_d_release
,
.
d_prune
=
ceph_d_prune
,
.
d_init
=
ceph_d_init
,
};
fs/ceph/export.c
浏览文件 @
ad5cb123
...
...
@@ -62,7 +62,6 @@ static struct dentry *__fh_to_dentry(struct super_block *sb, u64 ino)
{
struct
ceph_mds_client
*
mdsc
=
ceph_sb_to_client
(
sb
)
->
mdsc
;
struct
inode
*
inode
;
struct
dentry
*
dentry
;
struct
ceph_vino
vino
;
int
err
;
...
...
@@ -94,16 +93,7 @@ static struct dentry *__fh_to_dentry(struct super_block *sb, u64 ino)
return
ERR_PTR
(
-
ESTALE
);
}
dentry
=
d_obtain_alias
(
inode
);
if
(
IS_ERR
(
dentry
))
return
dentry
;
err
=
ceph_init_dentry
(
dentry
);
if
(
err
<
0
)
{
dput
(
dentry
);
return
ERR_PTR
(
err
);
}
dout
(
"__fh_to_dentry %llx %p dentry %p
\n
"
,
ino
,
inode
,
dentry
);
return
dentry
;
return
d_obtain_alias
(
inode
);
}
/*
...
...
@@ -131,7 +121,6 @@ static struct dentry *__get_parent(struct super_block *sb,
struct
ceph_mds_client
*
mdsc
=
ceph_sb_to_client
(
sb
)
->
mdsc
;
struct
ceph_mds_request
*
req
;
struct
inode
*
inode
;
struct
dentry
*
dentry
;
int
mask
;
int
err
;
...
...
@@ -164,18 +153,7 @@ static struct dentry *__get_parent(struct super_block *sb,
if
(
!
inode
)
return
ERR_PTR
(
-
ENOENT
);
dentry
=
d_obtain_alias
(
inode
);
if
(
IS_ERR
(
dentry
))
return
dentry
;
err
=
ceph_init_dentry
(
dentry
);
if
(
err
<
0
)
{
dput
(
dentry
);
return
ERR_PTR
(
err
);
}
dout
(
"__get_parent ino %llx parent %p ino %llx.%llx
\n
"
,
child
?
ceph_ino
(
d_inode
(
child
))
:
ino
,
dentry
,
ceph_vinop
(
inode
));
return
dentry
;
return
d_obtain_alias
(
inode
);
}
static
struct
dentry
*
ceph_get_parent
(
struct
dentry
*
child
)
...
...
fs/ceph/file.c
浏览文件 @
ad5cb123
...
...
@@ -351,10 +351,6 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
if
(
dentry
->
d_name
.
len
>
NAME_MAX
)
return
-
ENAMETOOLONG
;
err
=
ceph_init_dentry
(
dentry
);
if
(
err
<
0
)
return
err
;
if
(
flags
&
O_CREAT
)
{
err
=
ceph_pre_init_acls
(
dir
,
&
mode
,
&
acls
);
if
(
err
<
0
)
...
...
fs/ceph/inode.c
浏览文件 @
ad5cb123
...
...
@@ -1203,12 +1203,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
err
=
-
ENOMEM
;
goto
done
;
}
err
=
ceph_init_dentry
(
dn
);
if
(
err
<
0
)
{
dput
(
dn
);
dput
(
parent
);
goto
done
;
}
err
=
0
;
}
else
if
(
d_really_is_positive
(
dn
)
&&
(
ceph_ino
(
d_inode
(
dn
))
!=
vino
.
ino
||
ceph_snap
(
d_inode
(
dn
))
!=
vino
.
snap
))
{
...
...
@@ -1561,12 +1556,6 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
err
=
-
ENOMEM
;
goto
out
;
}
ret
=
ceph_init_dentry
(
dn
);
if
(
ret
<
0
)
{
dput
(
dn
);
err
=
ret
;
goto
out
;
}
}
else
if
(
d_really_is_positive
(
dn
)
&&
(
ceph_ino
(
d_inode
(
dn
))
!=
vino
.
ino
||
ceph_snap
(
d_inode
(
dn
))
!=
vino
.
snap
))
{
...
...
fs/ceph/super.c
浏览文件 @
ad5cb123
...
...
@@ -795,7 +795,6 @@ static struct dentry *open_root_dentry(struct ceph_fs_client *fsc,
root
=
ERR_PTR
(
-
ENOMEM
);
goto
out
;
}
ceph_init_dentry
(
root
);
dout
(
"open_root_inode success, root dentry is %p
\n
"
,
root
);
}
else
{
root
=
ERR_PTR
(
err
);
...
...
fs/ceph/super.h
浏览文件 @
ad5cb123
...
...
@@ -950,13 +950,6 @@ extern void ceph_invalidate_dentry_lease(struct dentry *dentry);
extern
unsigned
ceph_dentry_hash
(
struct
inode
*
dir
,
struct
dentry
*
dn
);
extern
void
ceph_readdir_cache_release
(
struct
ceph_readdir_cache_control
*
ctl
);
/*
* our d_ops vary depending on whether the inode is live,
* snapshotted (read-only), or a virtual ".snap" directory.
*/
int
ceph_init_dentry
(
struct
dentry
*
dentry
);
/* ioctl.c */
extern
long
ceph_ioctl
(
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录