Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f8b3b59d
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看板
提交
f8b3b59d
编写于
8月 29, 2014
作者:
T
Theodore Ts'o
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ext4: convert do_split() to use the ERR_PTR convention
Signed-off-by:
N
Theodore Ts'o
<
tytso@mit.edu
>
上级
dd73b5d5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
12 deletion
+11
-12
fs/ext4/namei.c
fs/ext4/namei.c
+11
-12
未找到文件。
fs/ext4/namei.c
浏览文件 @
f8b3b59d
...
@@ -1509,7 +1509,7 @@ static struct ext4_dir_entry_2* dx_pack_dirents(char *base, unsigned blocksize)
...
@@ -1509,7 +1509,7 @@ static struct ext4_dir_entry_2* dx_pack_dirents(char *base, unsigned blocksize)
*/
*/
static
struct
ext4_dir_entry_2
*
do_split
(
handle_t
*
handle
,
struct
inode
*
dir
,
static
struct
ext4_dir_entry_2
*
do_split
(
handle_t
*
handle
,
struct
inode
*
dir
,
struct
buffer_head
**
bh
,
struct
dx_frame
*
frame
,
struct
buffer_head
**
bh
,
struct
dx_frame
*
frame
,
struct
dx_hash_info
*
hinfo
,
int
*
error
)
struct
dx_hash_info
*
hinfo
)
{
{
unsigned
blocksize
=
dir
->
i_sb
->
s_blocksize
;
unsigned
blocksize
=
dir
->
i_sb
->
s_blocksize
;
unsigned
count
,
continued
;
unsigned
count
,
continued
;
...
@@ -1532,8 +1532,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
...
@@ -1532,8 +1532,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
if
(
IS_ERR
(
bh2
))
{
if
(
IS_ERR
(
bh2
))
{
brelse
(
*
bh
);
brelse
(
*
bh
);
*
bh
=
NULL
;
*
bh
=
NULL
;
*
error
=
PTR_ERR
(
bh2
);
return
(
struct
ext4_dir_entry_2
*
)
bh2
;
return
NULL
;
}
}
BUFFER_TRACE
(
*
bh
,
"get_write_access"
);
BUFFER_TRACE
(
*
bh
,
"get_write_access"
);
...
@@ -1593,8 +1592,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
...
@@ -1593,8 +1592,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
dxtrace
(
dx_show_leaf
(
hinfo
,
(
struct
ext4_dir_entry_2
*
)
data2
,
blocksize
,
1
));
dxtrace
(
dx_show_leaf
(
hinfo
,
(
struct
ext4_dir_entry_2
*
)
data2
,
blocksize
,
1
));
/* Which block gets the new entry? */
/* Which block gets the new entry? */
if
(
hinfo
->
hash
>=
hash2
)
if
(
hinfo
->
hash
>=
hash2
)
{
{
swap
(
*
bh
,
bh2
);
swap
(
*
bh
,
bh2
);
de
=
de2
;
de
=
de2
;
}
}
...
@@ -1614,8 +1612,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
...
@@ -1614,8 +1612,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
brelse
(
bh2
);
brelse
(
bh2
);
*
bh
=
NULL
;
*
bh
=
NULL
;
ext4_std_error
(
dir
->
i_sb
,
err
);
ext4_std_error
(
dir
->
i_sb
,
err
);
*
error
=
err
;
return
ERR_PTR
(
err
);
return
NULL
;
}
}
int
ext4_find_dest_de
(
struct
inode
*
dir
,
struct
inode
*
inode
,
int
ext4_find_dest_de
(
struct
inode
*
dir
,
struct
inode
*
inode
,
...
@@ -1838,8 +1835,8 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
...
@@ -1838,8 +1835,8 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
ext4_handle_dirty_dx_node
(
handle
,
dir
,
frame
->
bh
);
ext4_handle_dirty_dx_node
(
handle
,
dir
,
frame
->
bh
);
ext4_handle_dirty_dirent_node
(
handle
,
dir
,
bh
);
ext4_handle_dirty_dirent_node
(
handle
,
dir
,
bh
);
de
=
do_split
(
handle
,
dir
,
&
bh
,
frame
,
&
hinfo
,
&
retval
);
de
=
do_split
(
handle
,
dir
,
&
bh
,
frame
,
&
hinfo
);
if
(
!
de
)
{
if
(
IS_ERR
(
de
)
)
{
/*
/*
* Even if the block split failed, we have to properly write
* Even if the block split failed, we have to properly write
* out all the changes we did so far. Otherwise we can end up
* out all the changes we did so far. Otherwise we can end up
...
@@ -1847,7 +1844,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
...
@@ -1847,7 +1844,7 @@ static int make_indexed_dir(handle_t *handle, struct dentry *dentry,
*/
*/
ext4_mark_inode_dirty
(
handle
,
dir
);
ext4_mark_inode_dirty
(
handle
,
dir
);
dx_release
(
frames
);
dx_release
(
frames
);
return
retval
;
return
PTR_ERR
(
de
)
;
}
}
dx_release
(
frames
);
dx_release
(
frames
);
...
@@ -2071,9 +2068,11 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
...
@@ -2071,9 +2068,11 @@ static int ext4_dx_add_entry(handle_t *handle, struct dentry *dentry,
goto
cleanup
;
goto
cleanup
;
}
}
}
}
de
=
do_split
(
handle
,
dir
,
&
bh
,
frame
,
&
hinfo
,
&
err
);
de
=
do_split
(
handle
,
dir
,
&
bh
,
frame
,
&
hinfo
);
if
(
!
de
)
if
(
IS_ERR
(
de
))
{
err
=
PTR_ERR
(
de
);
goto
cleanup
;
goto
cleanup
;
}
err
=
add_dirent_to_buf
(
handle
,
dentry
,
inode
,
de
,
bh
);
err
=
add_dirent_to_buf
(
handle
,
dentry
,
inode
,
de
,
bh
);
goto
cleanup
;
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录