diff options
author | Alan Cox <alc@FreeBSD.org> | 2017-06-05 17:14:16 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2017-06-05 17:14:16 +0000 |
commit | 064650c180bfb2bcb9f347218675443bf6a73706 (patch) | |
tree | b8c222b864ae32aa22c87fe4b367bc9da8e7c2b8 /sys/kern/subr_blist.c | |
parent | dc09cfbf0813249d7a11ad180061318dffe0116c (diff) | |
download | src-064650c180bfb2bcb9f347218675443bf6a73706.tar.gz src-064650c180bfb2bcb9f347218675443bf6a73706.zip |
Halve the memory being internally allocated by the blist allocator. In
short, half of the memory that is allocated to implement the radix tree is
wasted because we did not change "u_daddr_t" to be a 64-bit unsigned int
when we changed "daddr_t" to be a 64-bit (signed) int. (See r96849 and
r96851.)
Reviewed by: kib, markj
Tested by: pho
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D11028
Notes
Notes:
svn path=/head/; revision=319604
Diffstat (limited to 'sys/kern/subr_blist.c')
-rw-r--r-- | sys/kern/subr_blist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/subr_blist.c b/sys/kern/subr_blist.c index 39b0ce3951b2..7b2fe3d98f92 100644 --- a/sys/kern/subr_blist.c +++ b/sys/kern/subr_blist.c @@ -366,7 +366,7 @@ blst_leaf_alloc( j >>= 1; mask >>= j; } - scan->u.bmu_bitmap &= ~(1 << r); + scan->u.bmu_bitmap &= ~((u_daddr_t)1 << r); return(blk + r); } if (count <= BLIST_BMAP_RADIX) { @@ -658,7 +658,7 @@ static void blst_copy( int i; for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { - if (v & (1 << i)) + if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } } |