Date: Thu, 3 Jun 2010 11:29:06 GMT From: Zheng Liu <lz@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 179138 for review Message-ID: <201006031129.o53BT6Br061803@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@179138?ac=10 Change 179138 by lz@gnehzuil-freebsd on 2010/06/03 11:28:32 Fix a bug. * When it find a window, rsv_alloc_hit's value is wrong. It reduce the accuracy at next allocation. Affected files ... .. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#20 edit Differences ... ==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_alloc.c#20 (text+ko) ==== @@ -252,7 +252,7 @@ if (RB_EMPTY(&fs->e2fs_rsv_tree)) { EXT2_TREE_UNLOCK(fs); - if (dtog(fs, bpref) != cg) + if (bpref < 0 || dtog(fs, bpref) != cg) bpref = 0; if (bpref != 0) { bpref = dtogd(fs, bpref); @@ -283,6 +283,9 @@ return (0); goto gotit; } else { + if (bpref < 0) + bpref = cg * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock; + search_rsv = ext2_search_rsv_win(&fs->e2fs_rsv_tree, bpref); repeat: @@ -324,7 +327,7 @@ start = cg * fs->e2fs->e2fs_fpg + fs->e2fs->e2fs_first_dblock + bpref; if (start >= rp->rsv_start && start < rp->rsv_end) { - rp->rsv_alloc_hit++; + rp->rsv_alloc_hit = start - rp->rsv_start + 1; goto allocated; } @@ -508,7 +511,7 @@ } EXT2_RSV_LOCK(ip); - bno = ext2_rsvalloc(fs, ip, cg, bp, bpref, size); + bno = ext2_rsvalloc(fs, ip, cg, bp, -1, size); EXT2_RSV_UNLOCK(ip); if (bno > 0) goto allocated;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006031129.o53BT6Br061803>