Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
1390334b
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看板
提交
1390334b
编写于
18年前
作者:
M
Mark Fasheh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ocfs2: Remove the dentry vote
This is unused now. Signed-off-by:
N
Mark Fasheh
<
mark.fasheh@oracle.com
>
上级
379dfe9d
无相关合并请求
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
183 deletion
+2
-183
fs/ocfs2/vote.c
fs/ocfs2/vote.c
+2
-178
fs/ocfs2/vote.h
fs/ocfs2/vote.h
+0
-5
未找到文件。
fs/ocfs2/vote.c
浏览文件 @
1390334b
...
...
@@ -74,9 +74,6 @@ struct ocfs2_vote_msg
__be32
v_orphaned_slot
;
/* Used during delete votes */
__be32
v_nlink
;
/* Used during unlink votes */
}
md1
;
/* Message type dependant 1 */
__be32
v_unlink_namelen
;
__be64
v_unlink_parent
;
u8
v_unlink_dirent
[
OCFS2_VOTE_FILENAME_LEN
];
};
/* Responses are given these values to maintain backwards
...
...
@@ -100,8 +97,6 @@ struct ocfs2_vote_work {
enum
ocfs2_vote_request
{
OCFS2_VOTE_REQ_INVALID
=
0
,
OCFS2_VOTE_REQ_DELETE
,
OCFS2_VOTE_REQ_UNLINK
,
OCFS2_VOTE_REQ_RENAME
,
OCFS2_VOTE_REQ_MOUNT
,
OCFS2_VOTE_REQ_UMOUNT
,
OCFS2_VOTE_REQ_LAST
...
...
@@ -261,103 +256,13 @@ static int ocfs2_process_delete_request(struct inode *inode,
return
response
;
}
static
int
ocfs2_match_dentry
(
struct
dentry
*
dentry
,
u64
parent_blkno
,
unsigned
int
namelen
,
const
char
*
name
)
{
struct
inode
*
parent
;
if
(
!
dentry
->
d_parent
)
{
mlog
(
0
,
"Detached from parent.
\n
"
);
return
0
;
}
parent
=
dentry
->
d_parent
->
d_inode
;
/* Negative parent dentry? */
if
(
!
parent
)
return
0
;
/* Name is in a different directory. */
if
(
OCFS2_I
(
parent
)
->
ip_blkno
!=
parent_blkno
)
return
0
;
if
(
dentry
->
d_name
.
len
!=
namelen
)
return
0
;
/* comparison above guarantees this is safe. */
if
(
memcmp
(
dentry
->
d_name
.
name
,
name
,
namelen
))
return
0
;
return
1
;
}
static
void
ocfs2_process_dentry_request
(
struct
inode
*
inode
,
int
rename
,
unsigned
int
new_nlink
,
u64
parent_blkno
,
unsigned
int
namelen
,
const
char
*
name
)
{
struct
dentry
*
dentry
=
NULL
;
struct
list_head
*
p
;
struct
ocfs2_inode_info
*
oi
=
OCFS2_I
(
inode
);
mlog
(
0
,
"parent %llu, namelen = %u, name = %.*s
\n
"
,
(
unsigned
long
long
)
parent_blkno
,
namelen
,
namelen
,
name
);
spin_lock
(
&
dcache_lock
);
/* Another node is removing this name from the system. It is
* up to us to find the corresponding dentry and if it exists,
* unhash it from the dcache. */
list_for_each
(
p
,
&
inode
->
i_dentry
)
{
dentry
=
list_entry
(
p
,
struct
dentry
,
d_alias
);
if
(
ocfs2_match_dentry
(
dentry
,
parent_blkno
,
namelen
,
name
))
{
mlog
(
0
,
"dentry found: %.*s
\n
"
,
dentry
->
d_name
.
len
,
dentry
->
d_name
.
name
);
dget_locked
(
dentry
);
break
;
}
dentry
=
NULL
;
}
spin_unlock
(
&
dcache_lock
);
if
(
dentry
)
{
d_delete
(
dentry
);
dput
(
dentry
);
}
/* rename votes don't send link counts */
if
(
!
rename
)
{
mlog
(
0
,
"new_nlink = %u
\n
"
,
new_nlink
);
/* We don't have the proper locks here to directly
* change i_nlink and besides, the vote is sent
* *before* the operation so it may have failed on the
* other node. This passes a hint to ocfs2_drop_inode
* to force ocfs2_delete_inode, who will take the
* proper cluster locks to sort things out. */
if
(
new_nlink
==
0
)
{
spin_lock
(
&
oi
->
ip_lock
);
oi
->
ip_flags
|=
OCFS2_INODE_MAYBE_ORPHANED
;
spin_unlock
(
&
OCFS2_I
(
inode
)
->
ip_lock
);
}
}
}
static
void
ocfs2_process_vote
(
struct
ocfs2_super
*
osb
,
struct
ocfs2_vote_msg
*
msg
)
{
int
net_status
,
vote_response
;
int
orphaned_slot
=
0
;
int
rename
=
0
;
unsigned
int
node_num
,
generation
,
new_nlink
,
namelen
;
u64
blkno
,
parent_blkno
;
unsigned
int
node_num
,
generation
;
u64
blkno
;
enum
ocfs2_vote_request
request
;
struct
inode
*
inode
=
NULL
;
struct
ocfs2_msg_hdr
*
hdr
=
&
msg
->
v_hdr
;
...
...
@@ -437,18 +342,6 @@ static void ocfs2_process_vote(struct ocfs2_super *osb,
vote_response
=
ocfs2_process_delete_request
(
inode
,
&
orphaned_slot
);
break
;
case
OCFS2_VOTE_REQ_RENAME
:
rename
=
1
;
/* fall through */
case
OCFS2_VOTE_REQ_UNLINK
:
parent_blkno
=
be64_to_cpu
(
msg
->
v_unlink_parent
);
namelen
=
be32_to_cpu
(
msg
->
v_unlink_namelen
);
/* new_nlink will be ignored in case of a rename vote */
new_nlink
=
be32_to_cpu
(
msg
->
md1
.
v_nlink
);
ocfs2_process_dentry_request
(
inode
,
rename
,
new_nlink
,
parent_blkno
,
namelen
,
msg
->
v_unlink_dirent
);
break
;
default:
mlog
(
ML_ERROR
,
"node %u, invalid request: %u
\n
"
,
node_num
,
request
);
...
...
@@ -889,75 +782,6 @@ int ocfs2_request_delete_vote(struct inode *inode)
return
status
;
}
static
void
ocfs2_setup_unlink_vote
(
struct
ocfs2_vote_msg
*
request
,
struct
dentry
*
dentry
)
{
struct
inode
*
parent
=
dentry
->
d_parent
->
d_inode
;
/* We need some values which will uniquely identify a dentry
* on the other nodes so that they can find it and run
* d_delete against it. Parent directory block and full name
* should suffice. */
mlog
(
0
,
"unlink/rename request: parent: %llu name: %.*s
\n
"
,
(
unsigned
long
long
)
OCFS2_I
(
parent
)
->
ip_blkno
,
dentry
->
d_name
.
len
,
dentry
->
d_name
.
name
);
request
->
v_unlink_parent
=
cpu_to_be64
(
OCFS2_I
(
parent
)
->
ip_blkno
);
request
->
v_unlink_namelen
=
cpu_to_be32
(
dentry
->
d_name
.
len
);
memcpy
(
request
->
v_unlink_dirent
,
dentry
->
d_name
.
name
,
dentry
->
d_name
.
len
);
}
int
ocfs2_request_unlink_vote
(
struct
inode
*
inode
,
struct
dentry
*
dentry
,
unsigned
int
nlink
)
{
int
status
;
struct
ocfs2_super
*
osb
=
OCFS2_SB
(
inode
->
i_sb
);
struct
ocfs2_vote_msg
*
request
;
if
(
dentry
->
d_name
.
len
>
OCFS2_VOTE_FILENAME_LEN
)
return
-
ENAMETOOLONG
;
status
=
-
ENOMEM
;
request
=
ocfs2_new_vote_request
(
osb
,
OCFS2_I
(
inode
)
->
ip_blkno
,
inode
->
i_generation
,
OCFS2_VOTE_REQ_UNLINK
,
nlink
);
if
(
request
)
{
ocfs2_setup_unlink_vote
(
request
,
dentry
);
status
=
ocfs2_request_vote
(
inode
,
request
,
NULL
);
kfree
(
request
);
}
return
status
;
}
int
ocfs2_request_rename_vote
(
struct
inode
*
inode
,
struct
dentry
*
dentry
)
{
int
status
;
struct
ocfs2_super
*
osb
=
OCFS2_SB
(
inode
->
i_sb
);
struct
ocfs2_vote_msg
*
request
;
if
(
dentry
->
d_name
.
len
>
OCFS2_VOTE_FILENAME_LEN
)
return
-
ENAMETOOLONG
;
status
=
-
ENOMEM
;
request
=
ocfs2_new_vote_request
(
osb
,
OCFS2_I
(
inode
)
->
ip_blkno
,
inode
->
i_generation
,
OCFS2_VOTE_REQ_RENAME
,
0
);
if
(
request
)
{
ocfs2_setup_unlink_vote
(
request
,
dentry
);
status
=
ocfs2_request_vote
(
inode
,
request
,
NULL
);
kfree
(
request
);
}
return
status
;
}
int
ocfs2_request_mount_vote
(
struct
ocfs2_super
*
osb
)
{
int
status
;
...
...
This diff is collapsed.
Click to expand it.
fs/ocfs2/vote.h
浏览文件 @
1390334b
...
...
@@ -39,11 +39,6 @@ static inline void ocfs2_kick_vote_thread(struct ocfs2_super *osb)
}
int
ocfs2_request_delete_vote
(
struct
inode
*
inode
);
int
ocfs2_request_unlink_vote
(
struct
inode
*
inode
,
struct
dentry
*
dentry
,
unsigned
int
nlink
);
int
ocfs2_request_rename_vote
(
struct
inode
*
inode
,
struct
dentry
*
dentry
);
int
ocfs2_request_mount_vote
(
struct
ocfs2_super
*
osb
);
int
ocfs2_request_umount_vote
(
struct
ocfs2_super
*
osb
);
int
ocfs2_register_net_handlers
(
struct
ocfs2_super
*
osb
);
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
反馈
建议
客服
返回
顶部