diff options
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
| -rw-r--r-- | fs/xfs/xfs_rtalloc.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index ca83ddf72af4..47082c01872d 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c | |||
| @@ -73,6 +73,18 @@ STATIC int xfs_rtmodify_summary(xfs_mount_t *, xfs_trans_t *, int, | |||
| 73 | */ | 73 | */ |
| 74 | 74 | ||
| 75 | /* | 75 | /* |
| 76 | * xfs_lowbit32: get low bit set out of 32-bit argument, -1 if none set. | ||
| 77 | */ | ||
| 78 | STATIC int | ||
| 79 | xfs_lowbit32( | ||
| 80 | __uint32_t v) | ||
| 81 | { | ||
| 82 | if (v) | ||
| 83 | return ffs(v) - 1; | ||
| 84 | return -1; | ||
| 85 | } | ||
| 86 | |||
| 87 | /* | ||
| 76 | * Allocate space to the bitmap or summary file, and zero it, for growfs. | 88 | * Allocate space to the bitmap or summary file, and zero it, for growfs. |
| 77 | */ | 89 | */ |
| 78 | STATIC int /* error */ | 90 | STATIC int /* error */ |
| @@ -432,7 +444,6 @@ xfs_rtallocate_extent_near( | |||
| 432 | } | 444 | } |
| 433 | bbno = XFS_BITTOBLOCK(mp, bno); | 445 | bbno = XFS_BITTOBLOCK(mp, bno); |
| 434 | i = 0; | 446 | i = 0; |
| 435 | ASSERT(minlen != 0); | ||
| 436 | log2len = xfs_highbit32(minlen); | 447 | log2len = xfs_highbit32(minlen); |
| 437 | /* | 448 | /* |
| 438 | * Loop over all bitmap blocks (bbno + i is current block). | 449 | * Loop over all bitmap blocks (bbno + i is current block). |
| @@ -601,8 +612,6 @@ xfs_rtallocate_extent_size( | |||
| 601 | xfs_suminfo_t sum; /* summary information for extents */ | 612 | xfs_suminfo_t sum; /* summary information for extents */ |
| 602 | 613 | ||
| 603 | ASSERT(minlen % prod == 0 && maxlen % prod == 0); | 614 | ASSERT(minlen % prod == 0 && maxlen % prod == 0); |
| 604 | ASSERT(maxlen != 0); | ||
| 605 | |||
| 606 | /* | 615 | /* |
| 607 | * Loop over all the levels starting with maxlen. | 616 | * Loop over all the levels starting with maxlen. |
| 608 | * At each level, look at all the bitmap blocks, to see if there | 617 | * At each level, look at all the bitmap blocks, to see if there |
| @@ -660,9 +669,6 @@ xfs_rtallocate_extent_size( | |||
| 660 | *rtblock = NULLRTBLOCK; | 669 | *rtblock = NULLRTBLOCK; |
| 661 | return 0; | 670 | return 0; |
| 662 | } | 671 | } |
| 663 | ASSERT(minlen != 0); | ||
| 664 | ASSERT(maxlen != 0); | ||
| 665 | |||
| 666 | /* | 672 | /* |
| 667 | * Loop over sizes, from maxlen down to minlen. | 673 | * Loop over sizes, from maxlen down to minlen. |
| 668 | * This time, when we do the allocations, allow smaller ones | 674 | * This time, when we do the allocations, allow smaller ones |
| @@ -1948,7 +1954,6 @@ xfs_growfs_rt( | |||
| 1948 | nsbp->sb_blocksize * nsbp->sb_rextsize); | 1954 | nsbp->sb_blocksize * nsbp->sb_rextsize); |
| 1949 | nsbp->sb_rextents = nsbp->sb_rblocks; | 1955 | nsbp->sb_rextents = nsbp->sb_rblocks; |
| 1950 | do_div(nsbp->sb_rextents, nsbp->sb_rextsize); | 1956 | do_div(nsbp->sb_rextents, nsbp->sb_rextsize); |
| 1951 | ASSERT(nsbp->sb_rextents != 0); | ||
| 1952 | nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents); | 1957 | nsbp->sb_rextslog = xfs_highbit32(nsbp->sb_rextents); |
| 1953 | nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1; | 1958 | nrsumlevels = nmp->m_rsumlevels = nsbp->sb_rextslog + 1; |
| 1954 | nrsumsize = | 1959 | nrsumsize = |
