linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geliang Tang <geliangtang@gmail.com>
To: Oleg Drokin <oleg.drokin@intel.com>,
	Andreas Dilger <andreas.dilger@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Geliang Tang <geliangtang@gmail.com>,
	lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] staging: lustre: use i_blocksize()
Date: Fri, 20 Jan 2017 22:29:53 +0800	[thread overview]
Message-ID: <b441c1f131ea37b0a1da3a4fba26d1b27058d983.1484894827.git.geliangtang@gmail.com> (raw)
In-Reply-To: <0a58b38c7ddfbbc8f56cb8d815114bd4357a6016.1484895399.git.geliangtang@gmail.com>

Since i_blocksize() helper has been defined in fs.h, use it instead
of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/staging/lustre/lustre/llite/file.c    | 2 +-
 drivers/staging/lustre/lustre/obdclass/obdo.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index d93f06a..3ee546f 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2967,7 +2967,7 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
 	stat->atime = inode->i_atime;
 	stat->mtime = inode->i_mtime;
 	stat->ctime = inode->i_ctime;
-	stat->blksize = 1 << inode->i_blkbits;
+	stat->blksize = i_blocksize(inode);
 
 	stat->nlink = inode->i_nlink;
 	stat->size = i_size_read(inode);
diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c
index b1dfa16..b9be7db 100644
--- a/drivers/staging/lustre/lustre/obdclass/obdo.c
+++ b/drivers/staging/lustre/lustre/obdclass/obdo.c
@@ -84,7 +84,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
 		newvalid |= OBD_MD_FLBLOCKS;
 	}
 	if (valid & OBD_MD_FLBLKSZ) {   /* optimal block size */
-		dst->o_blksize = 1 << src->i_blkbits;
+		dst->o_blksize = i_blocksize(src);
 		newvalid |= OBD_MD_FLBLKSZ;
 	}
 	if (valid & OBD_MD_FLTYPE) {
-- 
2.9.3

  parent reply	other threads:[~2017-01-20 14:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
2017-01-20 14:29 ` [PATCH] fs/buffer: " Geliang Tang
2017-01-20 14:29 ` [PATCH] isofs: " Geliang Tang
2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
2017-01-20 15:00   ` Coly Li
2017-01-21 18:13   ` Shaohua Li
2017-01-22  1:50     ` Geliang Tang
2017-05-02 14:33       ` Geliang Tang
2017-01-20 14:29 ` Geliang Tang [this message]
2017-01-20 23:34   ` [PATCH] staging: lustre: " James Simmons
2017-01-20 14:29 ` [PATCH] truncate: " Geliang Tang
2017-01-20 17:39   ` Ross Zwisler

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=b441c1f131ea37b0a1da3a4fba26d1b27058d983.1484894827.git.geliangtang@gmail.com \
    --to=geliangtang@gmail.com \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=oleg.drokin@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).