PERFORCE change 178650 for review
Zheng Liu
lz at FreeBSD.org
Sun May 23 10:59:15 UTC 2010
http://p4web.freebsd.org/@@178650?ac=10
Change 178650 by lz at gnehzuil-freebsd on 2010/05/23 10:59:02
Clean some code.
Affected files ...
.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#14 edit
Differences ...
==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#14 (text+ko) ====
@@ -293,7 +293,7 @@
ret = ext2_find_next_rsv_win(search_rsv, rp, fs, bpref, cg);
if (ret < 0) {
- if (rp != NULL && rp->rsv_end != EXT2_RSV_NOT_ALLOCATED)
+ if (rp->rsv_end != EXT2_RSV_NOT_ALLOCATED)
ext2_remove_rsv_win(fs, rp);
EXT2_TREE_UNLOCK(fs);
@@ -331,7 +331,7 @@
if (loc == end) {
EXT2_TREE_LOCK(fs);
- if (rp != NULL && rp->rsv_end != EXT2_RSV_NOT_ALLOCATED)
+ if (rp->rsv_end != EXT2_RSV_NOT_ALLOCATED)
ext2_remove_rsv_win(fs, rp);
EXT2_TREE_UNLOCK(fs);
@@ -379,7 +379,7 @@
ump = ip->i_ump;
bbp = (char *)bp->b_data;
- if (rp != NULL && rp->rsv_end != EXT2_RSV_NOT_ALLOCATED) {
+ if (rp->rsv_end != EXT2_RSV_NOT_ALLOCATED) {
start = dtogd(fs, rp->rsv_start + rp->rsv_alloc_hit);
} else
goto find;
@@ -390,22 +390,21 @@
start = dtogd(fs, start);
if (isclr(bbp, start)) {
bno = start;
+ rp->rsv_alloc_hit++;
goto gotit;
}
find:
EXT2_TREE_LOCK(fs);
- if (rp != NULL && rp->rsv_end != EXT2_RSV_NOT_ALLOCATED);
+ if (rp->rsv_end != EXT2_RSV_NOT_ALLOCATED);
ext2_remove_rsv_win(fs, rp);
EXT2_TREE_UNLOCK(fs);
bno = ext2_mapsearch(fs, bbp, bpref);
if (bno < 0)
return 0;
- goto allocated;
+
gotit:
- rp->rsv_alloc_hit++;
-allocated:
setbit(bbp, (daddr_t)bno);
EXT2_LOCK(ump);
fs->e2fs->e2fs_fbcount--;
@@ -427,8 +426,8 @@
rp = ip->i_rsv;
- if (ip->i_rsv == NULL)
- return ext2_alloc_blk(fs, ip, cg, bp, bpref, rp);
+ /*if (ip->i_rsv == NULL)*/
+ /*return ext2_alloc_blk(fs, ip, cg, bp, bpref, rp);*/
/* If window is empty or bpref is not in reservation window,
* we will try to allocate a new reservation window.
@@ -1411,9 +1410,11 @@
start = 0;
loc = skpc(0xff, len, &bbp[start]);
if (loc == 0) {
- printf("start = %d, len = %d, fs = %s\n",
- start, len, fs->e2fs_fsmnt);
- panic("ext2fs_alloccg: map corrupted");
+ /* XXX: just for reservation window */
+ return -1;
+ /*printf("start = %d, len = %d, fs = %s\n",*/
+ /*start, len, fs->e2fs_fsmnt);*/
+ /*panic("ext2fs_alloccg: map corrupted");*/
/* NOTREACHED */
}
}
More information about the p4-projects
mailing list