Replace v9fs_block_bits() with fls()
Originally from Rene Scharfe.
Signed-off-by: Eric Van Hensbergen <[email protected]>
---
commit f2a177d5cc8ba35ac8473961def629890d30a2f7
tree d81534c54698cb502bf7810488b03be36f36a528
parent 76ebbc7869a06014e638ad72148c375cf6644655
author Eric Van Hensbergen <[email protected]> Tue, 19 Jul 2005 09:29:15 -0500
committer Eric Van Hensbergen <[email protected]> Tue, 19 Jul 2005 09:29:15 -0500
fs/9p/vfs_super.c | 33 +++------------------------------
1 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -25,6 +25,7 @@
*
*/
+#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
@@ -74,34 +75,6 @@ static int v9fs_set_super(struct super_b
}
/**
- * v9fs_block_bits - Determine bits in blocksize (from NFS Code)
- * @bsize: blocksize
- * @nrbitsp: number of bits
- *
- * this bit from linux/fs/nfs/inode.c
- * Copyright (C) 1992 Rick Sladkey
- * XXX - shouldn't there be a global linux function for this?
- *
- */
-
-static inline unsigned long
-v9fs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
-{
- /* make sure blocksize is a power of two */
- if ((bsize & (bsize - 1)) || nrbitsp) {
- unsigned char nrbits;
-
- for (nrbits = 31; nrbits && !(bsize & (1 << nrbits));
- nrbits--) ;
- bsize = 1 << nrbits;
- if (nrbitsp)
- *nrbitsp = nrbits;
- }
-
- return bsize;
-}
-
-/**
* v9fs_fill_super - populate superblock with info
* @sb: superblock
* @v9ses: session information
@@ -113,8 +86,8 @@ v9fs_fill_super(struct super_block *sb,
int flags)
{
sb->s_maxbytes = MAX_LFS_FILESIZE;
- sb->s_blocksize =
- v9fs_block_bits(v9ses->maxdata, &sb->s_blocksize_bits);
+ sb->s_blocksize_bits = fls(v9ses->maxdata - 1);
+ sb->s_blocksize = 1 << sb->s_blocksize_bits;
sb->s_magic = V9FS_MAGIC;
sb->s_op = &v9fs_super_ops;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|