Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
d194f1aa
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
d194f1aa
编写于
5月 27, 2011
作者:
J
Joel Becker
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'move_extents' of
git://oss.oracle.com/git/tye/linux-2.6
into ocfs2-merge-window
上级
ece928df
ea5e1675
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
21 deletion
+20
-21
fs/ocfs2/move_extents.c
fs/ocfs2/move_extents.c
+20
-21
未找到文件。
fs/ocfs2/move_extents.c
浏览文件 @
d194f1aa
...
...
@@ -368,7 +368,7 @@ static int ocfs2_find_victim_alloc_group(struct inode *inode,
int
*
vict_bit
,
struct
buffer_head
**
ret_bh
)
{
int
ret
,
i
,
b
locks_per_unit
=
1
;
int
ret
,
i
,
b
its_per_unit
=
0
;
u64
blkno
;
char
namebuf
[
40
];
...
...
@@ -398,14 +398,14 @@ static int ocfs2_find_victim_alloc_group(struct inode *inode,
rec
=
&
(
cl
->
cl_recs
[
0
]);
if
(
type
==
GLOBAL_BITMAP_SYSTEM_INODE
)
b
locks_per_unit
<<=
(
osb
->
s_clustersize_bits
-
inode
->
i_sb
->
s_blocksize_bits
)
;
b
its_per_unit
=
osb
->
s_clustersize_bits
-
inode
->
i_sb
->
s_blocksize_bits
;
/*
* 'vict_blkno' was out of the valid range.
*/
if
((
vict_blkno
<
le64_to_cpu
(
rec
->
c_blkno
))
||
(
vict_blkno
>=
(
le32_to_cpu
(
ac_dinode
->
id1
.
bitmap1
.
i_total
)
*
b
lock
s_per_unit
)))
{
(
vict_blkno
>=
(
le32_to_cpu
(
ac_dinode
->
id1
.
bitmap1
.
i_total
)
<<
b
it
s_per_unit
)))
{
ret
=
-
EINVAL
;
goto
out
;
}
...
...
@@ -441,8 +441,8 @@ static int ocfs2_find_victim_alloc_group(struct inode *inode,
le16_to_cpu
(
bg
->
bg_bits
)))
{
*
ret_bh
=
gd_bh
;
*
vict_bit
=
(
vict_blkno
-
blkno
)
/
b
lock
s_per_unit
;
*
vict_bit
=
(
vict_blkno
-
blkno
)
>>
b
it
s_per_unit
;
mlog
(
0
,
"find the victim group: #%llu, "
"total_bits: %u, vict_bit: %u
\n
"
,
blkno
,
le16_to_cpu
(
bg
->
bg_bits
),
...
...
@@ -472,11 +472,23 @@ static int ocfs2_validate_and_adjust_move_goal(struct inode *inode,
int
ret
,
goal_bit
=
0
;
struct
buffer_head
*
gd_bh
=
NULL
;
struct
ocfs2_group_desc
*
bg
;
struct
ocfs2_group_desc
*
bg
=
NULL
;
struct
ocfs2_super
*
osb
=
OCFS2_SB
(
inode
->
i_sb
);
int
c_to_b
=
1
<<
(
osb
->
s_clustersize_bits
-
inode
->
i_sb
->
s_blocksize_bits
);
/*
* make goal become cluster aligned.
*/
range
->
me_goal
=
ocfs2_block_to_cluster_start
(
inode
->
i_sb
,
range
->
me_goal
);
/*
* moving goal is not allowd to start with a group desc blok(#0 blk)
* let's compromise to the latter cluster.
*/
if
(
range
->
me_goal
==
le64_to_cpu
(
bg
->
bg_blkno
))
range
->
me_goal
+=
c_to_b
;
/*
* validate goal sits within global_bitmap, and return the victim
* group desc
...
...
@@ -490,19 +502,6 @@ static int ocfs2_validate_and_adjust_move_goal(struct inode *inode,
bg
=
(
struct
ocfs2_group_desc
*
)
gd_bh
->
b_data
;
/*
* make goal become cluster aligned.
*/
if
(
range
->
me_goal
%
c_to_b
)
range
->
me_goal
=
range
->
me_goal
/
c_to_b
*
c_to_b
;
/*
* moving goal is not allowd to start with a group desc blok(#0 blk)
* let's compromise to the latter cluster.
*/
if
(
range
->
me_goal
==
le64_to_cpu
(
bg
->
bg_blkno
))
range
->
me_goal
+=
c_to_b
;
/*
* movement is not gonna cross two groups.
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录