Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
18fc8abd
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
18fc8abd
编写于
10月 28, 2016
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ceph: unify dentry_operations instances
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
7126bc2e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
33 deletion
+10
-33
fs/ceph/dir.c
fs/ceph/dir.c
+3
-27
fs/ceph/inode.c
fs/ceph/inode.c
+5
-4
fs/ceph/super.c
fs/ceph/super.c
+1
-0
fs/ceph/super.h
fs/ceph/super.h
+1
-2
未找到文件。
fs/ceph/dir.c
浏览文件 @
18fc8abd
...
@@ -50,13 +50,6 @@ int ceph_init_dentry(struct dentry *dentry)
...
@@ -50,13 +50,6 @@ int ceph_init_dentry(struct dentry *dentry)
goto
out_unlock
;
goto
out_unlock
;
}
}
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_NOSNAP
)
d_set_d_op
(
dentry
,
&
ceph_dentry_ops
);
else
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_SNAPDIR
)
d_set_d_op
(
dentry
,
&
ceph_snapdir_dentry_ops
);
else
d_set_d_op
(
dentry
,
&
ceph_snap_dentry_ops
);
di
->
dentry
=
dentry
;
di
->
dentry
=
dentry
;
di
->
lease_session
=
NULL
;
di
->
lease_session
=
NULL
;
di
->
time
=
jiffies
;
di
->
time
=
jiffies
;
...
@@ -1319,16 +1312,6 @@ static void ceph_d_release(struct dentry *dentry)
...
@@ -1319,16 +1312,6 @@ static void ceph_d_release(struct dentry *dentry)
kmem_cache_free
(
ceph_dentry_cachep
,
di
);
kmem_cache_free
(
ceph_dentry_cachep
,
di
);
}
}
static
int
ceph_snapdir_d_revalidate
(
struct
dentry
*
dentry
,
unsigned
int
flags
)
{
/*
* Eventually, we'll want to revalidate snapped metadata
* too... probably...
*/
return
1
;
}
/*
/*
* When the VFS prunes a dentry from the cache, we need to clear the
* When the VFS prunes a dentry from the cache, we need to clear the
* complete flag on the parent directory.
* complete flag on the parent directory.
...
@@ -1347,6 +1330,9 @@ static void ceph_d_prune(struct dentry *dentry)
...
@@ -1347,6 +1330,9 @@ static void ceph_d_prune(struct dentry *dentry)
if
(
d_unhashed
(
dentry
))
if
(
d_unhashed
(
dentry
))
return
;
return
;
if
(
ceph_snap
(
d_inode
(
dentry
->
d_parent
))
==
CEPH_SNAPDIR
)
return
;
/*
/*
* we hold d_lock, so d_parent is stable, and d_fsdata is never
* we hold d_lock, so d_parent is stable, and d_fsdata is never
* cleared until d_release
* cleared until d_release
...
@@ -1518,13 +1504,3 @@ const struct dentry_operations ceph_dentry_ops = {
...
@@ -1518,13 +1504,3 @@ const struct dentry_operations ceph_dentry_ops = {
.
d_release
=
ceph_d_release
,
.
d_release
=
ceph_d_release
,
.
d_prune
=
ceph_d_prune
,
.
d_prune
=
ceph_d_prune
,
};
};
const
struct
dentry_operations
ceph_snapdir_dentry_ops
=
{
.
d_revalidate
=
ceph_snapdir_d_revalidate
,
.
d_release
=
ceph_d_release
,
};
const
struct
dentry_operations
ceph_snap_dentry_ops
=
{
.
d_release
=
ceph_d_release
,
.
d_prune
=
ceph_d_prune
,
};
fs/ceph/inode.c
浏览文件 @
18fc8abd
...
@@ -1023,16 +1023,17 @@ static void update_dentry_lease(struct dentry *dentry,
...
@@ -1023,16 +1023,17 @@ static void update_dentry_lease(struct dentry *dentry,
long
unsigned
half_ttl
=
from_time
+
(
duration
*
HZ
/
2
)
/
1000
;
long
unsigned
half_ttl
=
from_time
+
(
duration
*
HZ
/
2
)
/
1000
;
struct
inode
*
dir
;
struct
inode
*
dir
;
/* only track leases on regular dentries */
if
(
dentry
->
d_op
!=
&
ceph_dentry_ops
)
return
;
spin_lock
(
&
dentry
->
d_lock
);
spin_lock
(
&
dentry
->
d_lock
);
dout
(
"update_dentry_lease %p duration %lu ms ttl %lu
\n
"
,
dout
(
"update_dentry_lease %p duration %lu ms ttl %lu
\n
"
,
dentry
,
duration
,
ttl
);
dentry
,
duration
,
ttl
);
/* make lease_rdcache_gen match directory */
/* make lease_rdcache_gen match directory */
dir
=
d_inode
(
dentry
->
d_parent
);
dir
=
d_inode
(
dentry
->
d_parent
);
/* only track leases on regular dentries */
if
(
ceph_snap
(
dir
)
!=
CEPH_NOSNAP
)
goto
out_unlock
;
di
->
lease_shared_gen
=
ceph_inode
(
dir
)
->
i_shared_gen
;
di
->
lease_shared_gen
=
ceph_inode
(
dir
)
->
i_shared_gen
;
if
(
duration
==
0
)
if
(
duration
==
0
)
...
...
fs/ceph/super.c
浏览文件 @
18fc8abd
...
@@ -877,6 +877,7 @@ static int ceph_set_super(struct super_block *s, void *data)
...
@@ -877,6 +877,7 @@ static int ceph_set_super(struct super_block *s, void *data)
fsc
->
sb
=
s
;
fsc
->
sb
=
s
;
s
->
s_op
=
&
ceph_super_ops
;
s
->
s_op
=
&
ceph_super_ops
;
s
->
s_d_op
=
&
ceph_dentry_ops
;
s
->
s_export_op
=
&
ceph_export_ops
;
s
->
s_export_op
=
&
ceph_export_ops
;
s
->
s_time_gran
=
1000
;
/* 1000 ns == 1 us */
s
->
s_time_gran
=
1000
;
/* 1000 ns == 1 us */
...
...
fs/ceph/super.h
浏览文件 @
18fc8abd
...
@@ -934,8 +934,7 @@ extern const struct file_operations ceph_dir_fops;
...
@@ -934,8 +934,7 @@ extern const struct file_operations ceph_dir_fops;
extern
const
struct
file_operations
ceph_snapdir_fops
;
extern
const
struct
file_operations
ceph_snapdir_fops
;
extern
const
struct
inode_operations
ceph_dir_iops
;
extern
const
struct
inode_operations
ceph_dir_iops
;
extern
const
struct
inode_operations
ceph_snapdir_iops
;
extern
const
struct
inode_operations
ceph_snapdir_iops
;
extern
const
struct
dentry_operations
ceph_dentry_ops
,
ceph_snap_dentry_ops
,
extern
const
struct
dentry_operations
ceph_dentry_ops
;
ceph_snapdir_dentry_ops
;
extern
loff_t
ceph_make_fpos
(
unsigned
high
,
unsigned
off
,
bool
hash_order
);
extern
loff_t
ceph_make_fpos
(
unsigned
high
,
unsigned
off
,
bool
hash_order
);
extern
int
ceph_handle_notrace_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
);
extern
int
ceph_handle_notrace_create
(
struct
inode
*
dir
,
struct
dentry
*
dentry
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录