diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2009-04-23 08:54:02 +0100 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2009-04-23 10:07:16 +0100 |
commit | d8bd504ab800c8e9aadb983914a33e7166320bec (patch) | |
tree | 72b45fe08363441d53c5e464daa6886a6e11a8b8 /fs/gfs2 | |
parent | 952043ac12a117d8e94bddd9088338d7ad20ca7d (diff) |
GFS2: Fix bug in block allocation
The new bitfit algorithm was counting from the wrong end of
64 bit words in the bitfield. This fixes it by using __ffs64
instead of fls64
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/rgrp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index f03d024038ea..c9786a46cdfc 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -212,8 +212,7 @@ static u32 gfs2_bitfit(const u8 *buf, const unsigned int len, if (tmp == 0) return BFITNOENT; ptr--; - bit = fls64(tmp); - bit--; /* fls64 always adds one to the bit count */ + bit = __ffs64(tmp); bit /= 2; /* two bits per entry in the bitmap */ return (((const unsigned char *)ptr - buf) * GFS2_NBBY) + bit; } |