Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
a81cb88b
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看板
提交
a81cb88b
编写于
10月 07, 2008
作者:
M
Mark Fasheh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ocfs2: Don't check for NULL before brelse()
This is pointless as brelse() already does the check. Signed-off-by: Mark Fasheh
上级
fd8351f8
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
74 addition
and
147 deletion
+74
-147
fs/ocfs2/alloc.c
fs/ocfs2/alloc.c
+11
-22
fs/ocfs2/aops.c
fs/ocfs2/aops.c
+1
-2
fs/ocfs2/dir.c
fs/ocfs2/dir.c
+8
-16
fs/ocfs2/file.c
fs/ocfs2/file.c
+3
-6
fs/ocfs2/inode.c
fs/ocfs2/inode.c
+3
-4
fs/ocfs2/ioctl.c
fs/ocfs2/ioctl.c
+1
-2
fs/ocfs2/journal.c
fs/ocfs2/journal.c
+3
-6
fs/ocfs2/localalloc.c
fs/ocfs2/localalloc.c
+5
-10
fs/ocfs2/namei.c
fs/ocfs2/namei.c
+26
-57
fs/ocfs2/suballoc.c
fs/ocfs2/suballoc.c
+11
-18
fs/ocfs2/super.c
fs/ocfs2/super.c
+1
-2
fs/ocfs2/symlink.c
fs/ocfs2/symlink.c
+1
-2
未找到文件。
fs/ocfs2/alloc.c
浏览文件 @
a81cb88b
...
...
@@ -719,8 +719,7 @@ int ocfs2_num_free_extents(struct ocfs2_super *osb,
retval
=
le16_to_cpu
(
el
->
l_count
)
-
le16_to_cpu
(
el
->
l_next_free_rec
);
bail:
if
(
eb_bh
)
brelse
(
eb_bh
);
brelse
(
eb_bh
);
mlog_exit
(
retval
);
return
retval
;
...
...
@@ -806,8 +805,7 @@ static int ocfs2_create_new_meta_bhs(struct ocfs2_super *osb,
bail:
if
(
status
<
0
)
{
for
(
i
=
0
;
i
<
wanted
;
i
++
)
{
if
(
bhs
[
i
])
brelse
(
bhs
[
i
]);
brelse
(
bhs
[
i
]);
bhs
[
i
]
=
NULL
;
}
}
...
...
@@ -1017,8 +1015,7 @@ static int ocfs2_add_branch(struct ocfs2_super *osb,
bail:
if
(
new_eb_bhs
)
{
for
(
i
=
0
;
i
<
new_blocks
;
i
++
)
if
(
new_eb_bhs
[
i
])
brelse
(
new_eb_bhs
[
i
]);
brelse
(
new_eb_bhs
[
i
]);
kfree
(
new_eb_bhs
);
}
...
...
@@ -1116,8 +1113,7 @@ static int ocfs2_shift_tree_depth(struct ocfs2_super *osb,
new_eb_bh
=
NULL
;
status
=
0
;
bail:
if
(
new_eb_bh
)
brelse
(
new_eb_bh
);
brelse
(
new_eb_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1177,10 +1173,8 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
goto
bail
;
}
if
(
bh
)
{
brelse
(
bh
);
bh
=
NULL
;
}
brelse
(
bh
);
bh
=
NULL
;
status
=
ocfs2_read_block
(
osb
,
blkno
,
&
bh
,
OCFS2_BH_CACHED
,
inode
);
...
...
@@ -1199,8 +1193,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
if
(
le16_to_cpu
(
el
->
l_next_free_rec
)
<
le16_to_cpu
(
el
->
l_count
))
{
if
(
lowest_bh
)
brelse
(
lowest_bh
);
brelse
(
lowest_bh
);
lowest_bh
=
bh
;
get_bh
(
lowest_bh
);
}
...
...
@@ -1214,8 +1207,7 @@ static int ocfs2_find_branch_target(struct ocfs2_super *osb,
*
target_bh
=
lowest_bh
;
bail:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -4471,8 +4463,7 @@ int ocfs2_insert_extent(struct ocfs2_super *osb,
ocfs2_extent_map_insert_rec
(
inode
,
&
rec
);
bail:
if
(
last_eb_bh
)
brelse
(
last_eb_bh
);
brelse
(
last_eb_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -5677,8 +5668,7 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
bail:
if
(
tl_inode
)
iput
(
tl_inode
);
if
(
tl_bh
)
brelse
(
tl_bh
);
brelse
(
tl_bh
);
if
(
status
<
0
&&
(
*
tl_copy
))
{
kfree
(
*
tl_copy
);
...
...
@@ -7115,8 +7105,7 @@ static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc)
mlog
(
ML_NOTICE
,
"Truncate completion has non-empty dealloc context
\n
"
);
if
(
tc
->
tc_last_eb_bh
)
brelse
(
tc
->
tc_last_eb_bh
);
brelse
(
tc
->
tc_last_eb_bh
);
kfree
(
tc
);
}
fs/ocfs2/aops.c
浏览文件 @
a81cb88b
...
...
@@ -128,8 +128,7 @@ static int ocfs2_symlink_get_block(struct inode *inode, sector_t iblock,
err
=
0
;
bail:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
err
);
return
err
;
...
...
fs/ocfs2/dir.c
浏览文件 @
a81cb88b
...
...
@@ -716,8 +716,7 @@ static int ocfs2_dir_foreach_blk_el(struct inode *inode,
for
(
i
=
ra_sectors
>>
(
sb
->
s_blocksize_bits
-
9
);
i
>
0
;
i
--
)
{
tmp
=
ocfs2_bread
(
inode
,
++
blk
,
&
err
,
1
);
if
(
tmp
)
brelse
(
tmp
);
brelse
(
tmp
);
}
last_ra_blk
=
blk
;
ra_sectors
=
8
;
...
...
@@ -899,10 +898,8 @@ int ocfs2_find_files_on_disk(const char *name,
leave:
if
(
status
<
0
)
{
*
dirent
=
NULL
;
if
(
*
dirent_bh
)
{
brelse
(
*
dirent_bh
);
*
dirent_bh
=
NULL
;
}
brelse
(
*
dirent_bh
);
*
dirent_bh
=
NULL
;
}
mlog_exit
(
status
);
...
...
@@ -951,8 +948,7 @@ int ocfs2_check_dir_for_entry(struct inode *dir,
ret
=
0
;
bail:
if
(
dirent_bh
)
brelse
(
dirent_bh
);
brelse
(
dirent_bh
);
mlog_exit
(
ret
);
return
ret
;
...
...
@@ -1127,8 +1123,7 @@ static int ocfs2_fill_new_dir_el(struct ocfs2_super *osb,
status
=
0
;
bail:
if
(
new_bh
)
brelse
(
new_bh
);
brelse
(
new_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1574,8 +1569,7 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb,
if
(
meta_ac
)
ocfs2_free_alloc_context
(
meta_ac
);
if
(
new_bh
)
brelse
(
new_bh
);
brelse
(
new_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1702,8 +1696,7 @@ static int ocfs2_find_dir_space_el(struct inode *dir, const char *name,
status
=
0
;
bail:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1762,7 +1755,6 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb,
*
ret_de_bh
=
bh
;
bh
=
NULL
;
out:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
return
ret
;
}
fs/ocfs2/file.c
浏览文件 @
a81cb88b
...
...
@@ -671,10 +671,8 @@ static int __ocfs2_extend_allocation(struct inode *inode, u32 logical_start,
restart_func
=
0
;
goto
restart_all
;
}
if
(
bh
)
{
brelse
(
bh
);
bh
=
NULL
;
}
brelse
(
bh
);
bh
=
NULL
;
mlog_exit
(
status
);
return
status
;
...
...
@@ -991,8 +989,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
if
(
size_change
)
ocfs2_rw_unlock
(
inode
,
1
);
bail:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
fs/ocfs2/inode.c
浏览文件 @
a81cb88b
...
...
@@ -1174,10 +1174,9 @@ struct buffer_head *ocfs2_bread(struct inode *inode,
return
bh
;
fail:
if
(
bh
)
{
brelse
(
bh
);
bh
=
NULL
;
}
brelse
(
bh
);
bh
=
NULL
;
*
err
=
-
EIO
;
return
NULL
;
}
...
...
fs/ocfs2/ioctl.c
浏览文件 @
a81cb88b
...
...
@@ -102,8 +102,7 @@ static int ocfs2_set_inode_attr(struct inode *inode, unsigned flags,
bail:
mutex_unlock
(
&
inode
->
i_mutex
);
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
fs/ocfs2/journal.c
浏览文件 @
a81cb88b
...
...
@@ -554,8 +554,7 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
if
(
status
<
0
)
{
if
(
inode_lock
)
ocfs2_inode_unlock
(
inode
,
1
);
if
(
bh
!=
NULL
)
brelse
(
bh
);
brelse
(
bh
);
if
(
inode
)
{
OCFS2_I
(
inode
)
->
ip_open_count
--
;
iput
(
inode
);
...
...
@@ -869,8 +868,7 @@ static int ocfs2_force_read_journal(struct inode *inode)
bail:
for
(
i
=
0
;
i
<
CONCURRENT_JOURNAL_FILL
;
i
++
)
if
(
bhs
[
i
])
brelse
(
bhs
[
i
]);
brelse
(
bhs
[
i
]);
mlog_exit
(
status
);
return
status
;
}
...
...
@@ -1286,8 +1284,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
if
(
inode
)
iput
(
inode
);
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
fs/ocfs2/localalloc.c
浏览文件 @
a81cb88b
...
...
@@ -294,8 +294,7 @@ int ocfs2_load_local_alloc(struct ocfs2_super *osb)
bail:
if
(
status
<
0
)
if
(
alloc_bh
)
brelse
(
alloc_bh
);
brelse
(
alloc_bh
);
if
(
inode
)
iput
(
inode
);
...
...
@@ -411,8 +410,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb)
ocfs2_commit_trans
(
osb
,
handle
);
out_unlock:
if
(
main_bm_bh
)
brelse
(
main_bm_bh
);
brelse
(
main_bm_bh
);
ocfs2_inode_unlock
(
main_bm_inode
,
1
);
...
...
@@ -488,8 +486,7 @@ int ocfs2_begin_local_alloc_recovery(struct ocfs2_super *osb,
*
alloc_copy
=
NULL
;
}
if
(
alloc_bh
)
brelse
(
alloc_bh
);
brelse
(
alloc_bh
);
if
(
inode
)
{
mutex_unlock
(
&
inode
->
i_mutex
);
...
...
@@ -557,8 +554,7 @@ int ocfs2_complete_local_alloc_recovery(struct ocfs2_super *osb,
out_mutex:
mutex_unlock
(
&
main_bm_inode
->
i_mutex
);
if
(
main_bm_bh
)
brelse
(
main_bm_bh
);
brelse
(
main_bm_bh
);
iput
(
main_bm_inode
);
...
...
@@ -1281,8 +1277,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb,
if
(
handle
)
ocfs2_commit_trans
(
osb
,
handle
);
if
(
main_bm_bh
)
brelse
(
main_bm_bh
);
brelse
(
main_bm_bh
);
if
(
main_bm_inode
)
iput
(
main_bm_inode
);
...
...
fs/ocfs2/namei.c
浏览文件 @
a81cb88b
...
...
@@ -328,14 +328,9 @@ static int ocfs2_mknod(struct inode *dir,
if
(
status
==
-
ENOSPC
)
mlog
(
0
,
"Disk is full
\n
"
);
if
(
new_fe_bh
)
brelse
(
new_fe_bh
);
if
(
de_bh
)
brelse
(
de_bh
);
if
(
parent_fe_bh
)
brelse
(
parent_fe_bh
);
brelse
(
new_fe_bh
);
brelse
(
de_bh
);
brelse
(
parent_fe_bh
);
if
((
status
<
0
)
&&
inode
)
iput
(
inode
);
...
...
@@ -648,12 +643,9 @@ static int ocfs2_link(struct dentry *old_dentry,
out:
ocfs2_inode_unlock
(
dir
,
1
);
if
(
de_bh
)
brelse
(
de_bh
);
if
(
fe_bh
)
brelse
(
fe_bh
);
if
(
parent_fe_bh
)
brelse
(
parent_fe_bh
);
brelse
(
de_bh
);
brelse
(
fe_bh
);
brelse
(
parent_fe_bh
);
mlog_exit
(
err
);
...
...
@@ -852,17 +844,10 @@ static int ocfs2_unlink(struct inode *dir,
iput
(
orphan_dir
);
}
if
(
fe_bh
)
brelse
(
fe_bh
);
if
(
dirent_bh
)
brelse
(
dirent_bh
);
if
(
parent_node_bh
)
brelse
(
parent_node_bh
);
if
(
orphan_entry_bh
)
brelse
(
orphan_entry_bh
);
brelse
(
fe_bh
);
brelse
(
dirent_bh
);
brelse
(
parent_node_bh
);
brelse
(
orphan_entry_bh
);
mlog_exit
(
status
);
...
...
@@ -1373,24 +1358,15 @@ static int ocfs2_rename(struct inode *old_dir,
if
(
new_inode
)
iput
(
new_inode
);
if
(
newfe_bh
)
brelse
(
newfe_bh
);
if
(
old_inode_bh
)
brelse
(
old_inode_bh
);
if
(
old_dir_bh
)
brelse
(
old_dir_bh
);
if
(
new_dir_bh
)
brelse
(
new_dir_bh
);
if
(
new_de_bh
)
brelse
(
new_de_bh
);
if
(
old_de_bh
)
brelse
(
old_de_bh
);
if
(
old_inode_de_bh
)
brelse
(
old_inode_de_bh
);
if
(
orphan_entry_bh
)
brelse
(
orphan_entry_bh
);
if
(
insert_entry_bh
)
brelse
(
insert_entry_bh
);
brelse
(
newfe_bh
);
brelse
(
old_inode_bh
);
brelse
(
old_dir_bh
);
brelse
(
new_dir_bh
);
brelse
(
new_de_bh
);
brelse
(
old_de_bh
);
brelse
(
old_inode_de_bh
);
brelse
(
orphan_entry_bh
);
brelse
(
insert_entry_bh
);
mlog_exit
(
status
);
...
...
@@ -1493,8 +1469,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb,
if
(
bhs
)
{
for
(
i
=
0
;
i
<
blocks
;
i
++
)
if
(
bhs
[
i
])
brelse
(
bhs
[
i
]);
brelse
(
bhs
[
i
]);
kfree
(
bhs
);
}
...
...
@@ -1660,12 +1635,9 @@ static int ocfs2_symlink(struct inode *dir,
ocfs2_inode_unlock
(
dir
,
1
);
if
(
new_fe_bh
)
brelse
(
new_fe_bh
);
if
(
parent_fe_bh
)
brelse
(
parent_fe_bh
);
if
(
de_bh
)
brelse
(
de_bh
);
brelse
(
new_fe_bh
);
brelse
(
parent_fe_bh
);
brelse
(
de_bh
);
if
(
inode_ac
)
ocfs2_free_alloc_context
(
inode_ac
);
if
(
data_ac
)
...
...
@@ -1760,8 +1732,7 @@ static int ocfs2_prepare_orphan_dir(struct ocfs2_super *osb,
iput
(
orphan_dir_inode
);
}
if
(
orphan_dir_bh
)
brelse
(
orphan_dir_bh
);
brelse
(
orphan_dir_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1830,8 +1801,7 @@ static int ocfs2_orphan_add(struct ocfs2_super *osb,
(
unsigned
long
long
)
OCFS2_I
(
inode
)
->
ip_blkno
,
osb
->
slot_num
);
leave:
if
(
orphan_dir_bh
)
brelse
(
orphan_dir_bh
);
brelse
(
orphan_dir_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1899,8 +1869,7 @@ int ocfs2_orphan_del(struct ocfs2_super *osb,
}
leave:
if
(
target_de_bh
)
brelse
(
target_de_bh
);
brelse
(
target_de_bh
);
mlog_exit
(
status
);
return
status
;
...
...
fs/ocfs2/suballoc.c
浏览文件 @
a81cb88b
...
...
@@ -130,10 +130,8 @@ void ocfs2_free_ac_resource(struct ocfs2_alloc_context *ac)
iput
(
inode
);
ac
->
ac_inode
=
NULL
;
}
if
(
ac
->
ac_bh
)
{
brelse
(
ac
->
ac_bh
);
ac
->
ac_bh
=
NULL
;
}
brelse
(
ac
->
ac_bh
);
ac
->
ac_bh
=
NULL
;
}
void
ocfs2_free_alloc_context
(
struct
ocfs2_alloc_context
*
ac
)
...
...
@@ -401,8 +399,7 @@ static int ocfs2_block_group_alloc(struct ocfs2_super *osb,
if
(
ac
)
ocfs2_free_alloc_context
(
ac
);
if
(
bg_bh
)
brelse
(
bg_bh
);
brelse
(
bg_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -494,8 +491,7 @@ static int ocfs2_reserve_suballoc_bits(struct ocfs2_super *osb,
get_bh
(
bh
);
ac
->
ac_bh
=
bh
;
bail:
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1269,10 +1265,10 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
&
tmp_bits
))
==
-
ENOSPC
)
{
if
(
!
bg
->
bg_next_group
)
break
;
if
(
prev_group_bh
)
{
brelse
(
prev_group_bh
);
prev_group_bh
=
NULL
;
}
brelse
(
prev_group_bh
);
prev_group_bh
=
NULL
;
next_group
=
le64_to_cpu
(
bg
->
bg_next_group
);
prev_group_bh
=
group_bh
;
group_bh
=
NULL
;
...
...
@@ -1367,10 +1363,8 @@ static int ocfs2_search_chain(struct ocfs2_alloc_context *ac,
*
bg_blkno
=
le64_to_cpu
(
bg
->
bg_blkno
);
*
bits_left
=
le16_to_cpu
(
bg
->
bg_free_bits_count
);
bail:
if
(
group_bh
)
brelse
(
group_bh
);
if
(
prev_group_bh
)
brelse
(
prev_group_bh
);
brelse
(
group_bh
);
brelse
(
prev_group_bh
);
mlog_exit
(
status
);
return
status
;
...
...
@@ -1844,8 +1838,7 @@ int ocfs2_free_suballoc_bits(handle_t *handle,
}
bail:
if
(
group_bh
)
brelse
(
group_bh
);
brelse
(
group_bh
);
mlog_exit
(
status
);
return
status
;
...
...
fs/ocfs2/super.c
浏览文件 @
a81cb88b
...
...
@@ -762,8 +762,7 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
return
status
;
read_super_error:
if
(
bh
!=
NULL
)
brelse
(
bh
);
brelse
(
bh
);
if
(
inode
)
iput
(
inode
);
...
...
fs/ocfs2/symlink.c
浏览文件 @
a81cb88b
...
...
@@ -158,8 +158,7 @@ static void *ocfs2_follow_link(struct dentry *dentry,
kunmap
(
page
);
page_cache_release
(
page
);
}
if
(
bh
)
brelse
(
bh
);
brelse
(
bh
);
return
ERR_PTR
(
status
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录