diff options
author | Fabian Frederick <fabf@skynet.be> | 2017-02-08 10:43:40 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-02-09 17:01:27 +1100 |
commit | 8b2a6a61f5d3cf9ad32eaf5a1ffdf642dc5f8142 (patch) | |
tree | dd7af13950cb50fa09f2ca4972b0dad201a7d2f4 /include | |
parent | a9be5a59553a6b5d424d8ed37f058edfcc09a7d9 (diff) |
fs: add i_blocksize()
Replace all 1 << inode->i_blkbits and (1 << inode->i_blkbits) in fs branch
This patch also fixes multiple checkpatch warnings: WARNING: Prefer
'unsigned int' to bare use of 'unsigned'
Thanks to Andrew Morton for suggesting more appropriate function instead
of macro.
Link: http://lkml.kernel.org/r/1481319905-10126-1-git-send-email-fabf@skynet.be
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 00d2fc2e14f1..de8ed0bd6465 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -656,6 +656,11 @@ struct inode { void *i_private; /* fs or device private pointer */ }; +static inline unsigned int i_blocksize(const struct inode *node) +{ + return (1 << node->i_blkbits); +} + static inline int inode_unhashed(struct inode *inode) { return hlist_unhashed(&inode->i_hash); |