From: Andrew Morton <akpm@linux-foundation.org>
To: Fabian Frederick <fabf@skynet.be>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2 linux-next] fs: add BLOCKSIZE(inode)
Date: Fri, 9 Dec 2016 12:03:27 -0800 [thread overview]
Message-ID: <20161209120327.1e75aaf0cc4c250d0a80f6b9@linux-foundation.org> (raw)
In-Reply-To: <1481312313-29680-1-git-send-email-fabf@skynet.be>
On Fri, 9 Dec 2016 20:38:33 +0100 Fabian Frederick <fabf@skynet.be> wrote:
> Add (1 << inode->i_blkbits) macro for more readability
> #define BLOCKSIZE(inode) (1 << inode->i_blkbits)
>
> This patch also fixes multiple checkpatch warnings:
> WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
>
> ...
>
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -543,6 +543,7 @@ is_uncached_acl(struct posix_acl *acl)
> #define IOP_LOOKUP 0x0002
> #define IOP_NOFOLLOW 0x0004
> #define IOP_XATTR 0x0008
> +#define BLOCKSIZE(inode) (1 << inode->i_blkbits)
>
> /*
> * Keep mostly read-only and often accessed (especially for
The name "BLOCKSIZE" is too generic. Why should inodes consume this
identifier kernel-wide rather than, say, struct bio?
The return type is `int', yes? I guess a 32-bit quantity is OK, but I
don't see why it should be signed.
So I'd suggest something along the lines of
static inline unsigned i_blocksize(const struct inode *inode)
{
...
}
prev parent reply other threads:[~2016-12-09 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-09 19:38 [PATCH V2 linux-next] fs: add BLOCKSIZE(inode) Fabian Frederick
2016-12-09 20:03 ` Andrew Morton [this message]
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=20161209120327.1e75aaf0cc4c250d0a80f6b9@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).