mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH NFS 2/3] Lose second parameter of nfs_block_bits
Date: Sun, 24 Jul 2005 16:36:38 +0200	[thread overview]
Message-ID: <20050724143638.GA19928@lsrfire.ath.cx> (raw)

[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)

                 reply	other threads:[~2005-07-24 14:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050724143638.GA19928@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®