Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10532
b: refs/heads/master
c: b6a47fd
h: refs/heads/master
v: v3
  • Loading branch information
Dave Kleikamp committed Oct 11, 2005
1 parent 7650ea8 commit 3aa5de5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ac17b8b57013a3e38d1958f66a218f15659e5752
refs/heads/master: b6a47fd8ff08a9d5cd279cdb8d97a619983575fa
19 changes: 14 additions & 5 deletions trunk/fs/jfs/jfs_dmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,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 int dbBackSplit(dmtree_t * tp, int leafno);
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,
Expand Down Expand Up @@ -2466,7 +2466,9 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
* that it is at the front of a binary buddy system.
*/
if (oldval == NOFREE) {
dbBackSplit((dmtree_t *) dcp, leafno);
rc = dbBackSplit((dmtree_t *) dcp, leafno);
if (rc)
return rc;
oldval = dcp->stree[ti];
}
dbSplit((dmtree_t *) dcp, leafno, dcp->budmin, newval);
Expand Down Expand Up @@ -2626,7 +2628,7 @@ static void dbSplit(dmtree_t * tp, int leafno, int splitsz, int newval)
*
* serialization: IREAD_LOCK(ipbmap) or IWRITE_LOCK(ipbmap) held on entry/exit;
*/
static void dbBackSplit(dmtree_t * tp, int leafno)
static int dbBackSplit(dmtree_t * tp, int leafno)
{
int budsz, bud, w, bsz, size;
int cursz;
Expand Down Expand Up @@ -2661,7 +2663,10 @@ static void dbBackSplit(dmtree_t * tp, int leafno)
*/
for (w = leafno, bsz = budsz;; bsz <<= 1,
w = (w < bud) ? w : bud) {
assert(bsz < le32_to_cpu(tp->dmt_nleafs));
if (bsz >= le32_to_cpu(tp->dmt_nleafs)) {
jfs_err("JFS: block map error in dbBackSplit");
return -EIO;
}

/* determine the buddy.
*/
Expand All @@ -2680,7 +2685,11 @@ static void dbBackSplit(dmtree_t * tp, int leafno)
}
}

assert(leaf[leafno] == size);
if (leaf[leafno] != size) {
jfs_err("JFS: wrong leaf value in dbBackSplit");
return -EIO;
}
return 0;
}


Expand Down

0 comments on commit 3aa5de5

Please sign in to comment.