diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-09-05 12:56:57 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-09-05 12:56:57 -0400 |
| commit | 616ad8c44281c0c6711a72b560e01ec335ff27e0 (patch) | |
| tree | 0a20453ffedb09db6fb41a0c2208ccc2c7751d3a /fs/xfs/xfs_rtalloc.c | |
| parent | 99809963c99e1ed868d9ebeb4a5e7ee1cbe0309f (diff) | |
| parent | b380b0d4f7dffcc235c0facefa537d4655619101 (diff) | |
Merge branch 'linus' into x86/defconfig
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index bf87a5913504..e2f68de16159 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
| @@ -74,18 +74,6 @@ STATIC int xfs_rtmodify_summary(xfs_mount_t *, xfs_trans_t *, int, | |||
| 74 | */ | 74 | */ |
| 75 | 75 | ||
| 76 | /* | 76 | /* |
| 77 | * xfs_lowbit32: get low bit set out of 32-bit argument, -1 if none set. | ||
| 78 | */ | ||
| 79 | STATIC int | ||
| 80 | xfs_lowbit32( | ||
| 81 | __uint32_t v) | ||
| 82 | { | ||
| 83 | if (v) | ||
| 84 | return ffs(v) - 1; | ||
| 85 | return -1; | ||
| 86 | } | ||
| 87 | |||
| 88 | /* | ||
| 89 | * Allocate space to the bitmap or summary file, and zero it, for growfs. | 77 | * Allocate space to the bitmap or summary file, and zero it, for growfs. |
| 90 | */ | 78 | */ |
| 91 | STATIC int /* error */ | 79 | STATIC int /* error */ |
| @@ -450,6 +438,7 @@ xfs_rtallocate_extent_near( | |||
| 450 | } | 438 | } |
| 451 | bbno = XFS_BITTOBLOCK(mp, bno); | 439 | bbno = XFS_BITTOBLOCK(mp, bno); |
| 452 | i = 0; | 440 | i = 0; |
| 441 | ASSERT(minlen != 0); | ||
| 453 | log2len = xfs_highbit32(minlen); | 442 | log2len = xfs_highbit32(minlen); |
| 454 | /* | 443 | /* |
| 455 | * Loop over all bitmap blocks (bbno + i is current block). | 444 | * Loop over all bitmap blocks (bbno + i is current block). |
| @@ -618,6 +607,8 @@ xfs_rtallocate_extent_size( | |||
| 618 | xfs_suminfo_t sum; /* summary information for extents */ | 607 | xfs_suminfo_t sum; /* summary information for extents */ |
| 619 | 608 | ||
| 620 | ASSERT(minlen % prod == 0 && maxlen % prod == 0); | 609 | ASSERT(minlen % prod == 0 && maxlen % prod == 0); |
| 610 | ASSERT(maxlen != 0); | ||
| 611 | |||
| 621 | /* | 612 | /* |
| 622 | * Loop over all the levels starting with maxlen. | 613 | * Loop over all the levels starting with maxlen. |
| 623 | * At each level, look at all the bitmap blocks, to see if there | 614 | * At each level, look at all the bitmap blocks, to see if there |
| @@ -675,6 +666,9 @@ xfs_rtallocate_extent_size( | |||
| 675 | *rtblock = NULLRTBLOCK; | 666 | *rtblock = NULLRTBLOCK; |
| 676 | return 0; | 667 | return 0; |
| 677 | } | 668 | } |
| 669 | ASSERT(minlen != 0); | ||
| 670 | ASSERT(maxlen != 0); | ||
| 671 | |||
| 678 | /* | 672 | /* |
| 679 | * Loop over sizes, from maxlen down to minlen. | 673 | * Loop over sizes, from maxlen down to minlen. |
| 680 | * This time, when we do the allocations, allow smaller ones | 674 | * This time, when we do the allocations, allow smaller ones |
| @@ -1961,6 +1955,7 @@ xfs_growfs_rt( | |||
| 1961 | nsbp->sb_blocksize * nsbp->sb_rextsize); | 1955 | nsbp->sb_blocksize * nsbp->sb_rextsize); |
| 1962 | nsbp->sb_rextents = nsbp->sb_rblocks; | 1956 | nsbp->sb_rextents = nsbp->sb_rblocks; |
| 1963 | do_div(nsbp->sb_rextents, nsbp->sb_rextsize); | 1957 | do_div(nsbp->sb_rextents, nsbp->sb_rextsize); |
| 1958 | ASSERT(nsbp->sb_rextents != 0); | ||
| 1964 | nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents); | 1959 | nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents); |
| 1965 | nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1; | 1960 | nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1; |
| 1966 | nrsumsize = | 1961 | nrsumsize = |
