Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
56d12549
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
56d12549
编写于
7月 15, 2005
作者:
D
Dave Kleikamp
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JFS: Remove assert statement in dbJoin & return -EIO instead
Signed-off-by:
N
Dave Kleikamp
<
shaggy@austin.ibm.com
>
上级
00be3e7e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
16 deletion
+30
-16
fs/jfs/jfs_dmap.c
fs/jfs/jfs_dmap.c
+30
-16
未找到文件。
fs/jfs/jfs_dmap.c
浏览文件 @
56d12549
...
...
@@ -75,7 +75,7 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
int
nblocks
);
static
void
dbSplit
(
dmtree_t
*
tp
,
int
leafno
,
int
splitsz
,
int
newval
);
static
void
dbBackSplit
(
dmtree_t
*
tp
,
int
leafno
);
static
void
dbJoin
(
dmtree_t
*
tp
,
int
leafno
,
int
newval
);
static
int
dbJoin
(
dmtree_t
*
tp
,
int
leafno
,
int
newval
);
static
void
dbAdjTree
(
dmtree_t
*
tp
,
int
leafno
,
int
newval
);
static
int
dbAdjCtl
(
struct
bmap
*
bmp
,
s64
blkno
,
int
newval
,
int
alloc
,
int
level
);
...
...
@@ -98,8 +98,8 @@ static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
static
int
dbFindBits
(
u32
word
,
int
l2nb
);
static
int
dbFindCtl
(
struct
bmap
*
bmp
,
int
l2nb
,
int
level
,
s64
*
blkno
);
static
int
dbFindLeaf
(
dmtree_t
*
tp
,
int
l2nb
,
int
*
leafidx
);
static
void
dbFreeBits
(
struct
bmap
*
bmp
,
struct
dmap
*
dp
,
s64
blkno
,
int
nblocks
);
static
int
dbFreeBits
(
struct
bmap
*
bmp
,
struct
dmap
*
dp
,
s64
blkno
,
int
nblocks
);
static
int
dbFreeDmap
(
struct
bmap
*
bmp
,
struct
dmap
*
dp
,
s64
blkno
,
int
nblocks
);
static
int
dbMaxBud
(
u8
*
cp
);
...
...
@@ -378,6 +378,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
/* free the blocks. */
if
((
rc
=
dbFreeDmap
(
bmp
,
dp
,
blkno
,
nb
)))
{
jfs_error
(
ip
->
i_sb
,
"dbFree: error in block map
\n
"
);
release_metapage
(
mp
);
IREAD_UNLOCK
(
ipbmap
);
return
(
rc
);
...
...
@@ -2020,7 +2021,7 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
int
nblocks
)
{
s8
oldroot
;
int
rc
,
word
;
int
rc
=
0
,
word
;
/* save the current value of the root (i.e. maximum free string)
* of the dmap tree.
...
...
@@ -2028,11 +2029,11 @@ static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
oldroot
=
dp
->
tree
.
stree
[
ROOT
];
/* free the specified (blocks) bits */
dbFreeBits
(
bmp
,
dp
,
blkno
,
nblocks
);
rc
=
dbFreeBits
(
bmp
,
dp
,
blkno
,
nblocks
);
/* if the root has not changed, done. */
if
(
dp
->
tree
.
stree
[
ROOT
]
==
oldroot
)
return
(
0
);
/* if
error or
the root has not changed, done. */
if
(
rc
||
(
dp
->
tree
.
stree
[
ROOT
]
==
oldroot
)
)
return
(
rc
);
/* root changed. bubble the change up to the dmap control pages.
* if the adjustment of the upper level control pages fails,
...
...
@@ -2221,15 +2222,16 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
* blkno - starting block number of the bits to be freed.
* nblocks - number of bits to be freed.
*
* RETURN VALUES:
none
* RETURN VALUES:
0 for success
*
* serialization: IREAD_LOCK(ipbmap) or IWRITE_LOCK(ipbmap) held on entry/exit;
*/
static
void
dbFreeBits
(
struct
bmap
*
bmp
,
struct
dmap
*
dp
,
s64
blkno
,
static
int
dbFreeBits
(
struct
bmap
*
bmp
,
struct
dmap
*
dp
,
s64
blkno
,
int
nblocks
)
{
int
dbitno
,
word
,
rembits
,
nb
,
nwords
,
wbitno
,
nw
,
agno
;
dmtree_t
*
tp
=
(
dmtree_t
*
)
&
dp
->
tree
;
int
rc
=
0
;
int
size
;
/* determine the bit number and word within the dmap of the
...
...
@@ -2278,8 +2280,10 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
/* update the leaf for this dmap word.
*/
dbJoin
(
tp
,
word
,
dbMaxBud
((
u8
*
)
&
dp
->
wmap
[
word
]));
rc
=
dbJoin
(
tp
,
word
,
dbMaxBud
((
u8
*
)
&
dp
->
wmap
[
word
]));
if
(
rc
)
return
rc
;
word
+=
1
;
}
else
{
...
...
@@ -2310,7 +2314,9 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
/* update the leaf.
*/
dbJoin
(
tp
,
word
,
size
);
rc
=
dbJoin
(
tp
,
word
,
size
);
if
(
rc
)
return
rc
;
/* get the number of dmap words handled.
*/
...
...
@@ -2357,6 +2363,8 @@ static void dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
}
BMAP_UNLOCK
(
bmp
);
return
0
;
}
...
...
@@ -2464,7 +2472,9 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
}
dbSplit
((
dmtree_t
*
)
dcp
,
leafno
,
dcp
->
budmin
,
newval
);
}
else
{
dbJoin
((
dmtree_t
*
)
dcp
,
leafno
,
newval
);
rc
=
dbJoin
((
dmtree_t
*
)
dcp
,
leafno
,
newval
);
if
(
rc
)
return
rc
;
}
/* check if the root of the current dmap control page changed due
...
...
@@ -2689,7 +2699,7 @@ static void dbBackSplit(dmtree_t * tp, int leafno)
*
* RETURN VALUES: none
*/
static
void
dbJoin
(
dmtree_t
*
tp
,
int
leafno
,
int
newval
)
static
int
dbJoin
(
dmtree_t
*
tp
,
int
leafno
,
int
newval
)
{
int
budsz
,
buddy
;
s8
*
leaf
;
...
...
@@ -2729,7 +2739,9 @@ static void dbJoin(dmtree_t * tp, int leafno, int newval)
if
(
newval
>
leaf
[
buddy
])
break
;
assert
(
newval
==
leaf
[
buddy
]);
/* It shouldn't be less */
if
(
newval
<
leaf
[
buddy
])
return
-
EIO
;
/* check which (leafno or buddy) is the left buddy.
* the left buddy gets to claim the blocks resulting
...
...
@@ -2761,6 +2773,8 @@ static void dbJoin(dmtree_t * tp, int leafno, int newval)
/* update the leaf value.
*/
dbAdjTree
(
tp
,
leafno
,
newval
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录