[PATCH NFS 2/3] Lose second parameter of nfs_block_bits
Two of the three calls were passing a NULL pointer and we can simply
calculate the number of bits ourselves.
Signed-off-by: Rene Scharfe <[email protected]>
---
fs/nfs/inode.c | 17 ++++++++---------
1 files changed, 8 insertions(+), 9 deletions(-)
d81155b5789ac9d7e05261f5f4bf639e7982fa4b
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -187,17 +187,15 @@ nfs_umount_begin(struct super_block *sb)
static inline unsigned long
-nfs_block_bits(unsigned long bsize, unsigned char *nrbitsp)
+nfs_block_bits(unsigned long bsize)
{
/* make sure blocksize is a power of two */
- if ((bsize & (bsize - 1)) || nrbitsp) {
+ if (bsize & (bsize - 1)) {
unsigned char nrbits;
for (nrbits = 31; nrbits && !(bsize & (1 << nrbits)); nrbits--)
;
bsize = 1 << nrbits;
- if (nrbitsp)
- *nrbitsp = nrbits;
}
return bsize;
@@ -224,7 +222,7 @@ nfs_block_size(unsigned long bsize)
else if (bsize >= NFS_MAX_FILE_IO_BUFFER_SIZE)
bsize = NFS_MAX_FILE_IO_BUFFER_SIZE;
- return nfs_block_bits(bsize, NULL);
+ return nfs_block_bits(bsize);
}
/*
@@ -320,10 +318,11 @@ nfs_sb_init(struct super_block *sb, rpc_
server->wsize = server->wpages << PAGE_CACHE_SHIFT;
}
- if (sb->s_blocksize == 0)
- sb->s_blocksize = nfs_block_bits(server->wsize,
- &sb->s_blocksize_bits);
- server->wtmult = nfs_block_bits(fsinfo.wtmult, NULL);
+ if (sb->s_blocksize == 0) {
+ sb->s_blocksize = nfs_block_bits(server->wsize);
+ sb->s_blocksize_bits = fls(sb->s_blocksize - 1);
+ }
+ server->wtmult = nfs_block_bits(fsinfo.wtmult);
server->dtsize = nfs_block_size(fsinfo.dtpref);
if (server->dtsize > PAGE_CACHE_SIZE)
-
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]
|
|