From 27a78306fbe292a85818fe1f91ec4928ae74094b Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Sat, 3 Nov 2012 11:43:00 +1100 Subject: [PATCH] fat: move fat_i_pos_read to fat.h Originally, fat_i_pos_read() was a static inline function in inode.c. The static keyword was removed so that it could be accessed from other files. However it is better to make it a static inline function in fat.h as suggested by Ogawa. Signed-off-by: Namjae Jeon Signed-off-by: Ravishankar N Signed-off-by: Amit Sahrawat Cc: OGAWA Hirofumi Cc: "J. Bruce Fields" Signed-off-by: Andrew Morton --- fs/fat/fat.h | 14 ++++++++++++++ fs/fat/inode.c | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/fs/fat/fat.h b/fs/fat/fat.h index 65f9149bed79..177e94e51277 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h @@ -222,6 +222,20 @@ static inline void fat_get_blknr_offset(struct msdos_sb_info *sbi, *offset = i_pos & (sbi->dir_per_block - 1); } +static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi, + struct inode *inode) +{ + loff_t i_pos; +#if BITS_PER_LONG == 32 + spin_lock(&sbi->inode_hash_lock); +#endif + i_pos = MSDOS_I(inode)->i_pos; +#if BITS_PER_LONG == 32 + spin_unlock(&sbi->inode_hash_lock); +#endif + return i_pos; +} + static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len) { #ifdef __BIG_ENDIAN diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 34253dc08aa3..63e08839984c 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -595,20 +595,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf) return 0; } -loff_t fat_i_pos_read(struct msdos_sb_info *sbi, - struct inode *inode) -{ - loff_t i_pos; -#if BITS_PER_LONG == 32 - spin_lock(&sbi->inode_hash_lock); -#endif - i_pos = MSDOS_I(inode)->i_pos; -#if BITS_PER_LONG == 32 - spin_unlock(&sbi->inode_hash_lock); -#endif - return i_pos; -} - static int __fat_write_inode(struct inode *inode, int wait) { struct super_block *sb = inode->i_sb; -- 2.39.5