mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH NFS 2/3] Lose second parameter of nfs_block_bits
@ 2005-07-24 14:36 Rene Scharfe
  0 siblings, 0 replies; only message in thread
From: Rene Scharfe @ 2005-07-24 14:36 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-kernel

[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 <rene.scharfe@lsrfire.ath.cx>
---

 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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-24 14:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-24 14:36 [PATCH NFS 2/3] Lose second parameter of nfs_block_bits Rene Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®