From 3f7c2033cc226cb7fabc9eb3d16459db9965d9b9 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Wed, 27 Mar 2013 10:25:49 +1100 Subject: [PATCH] fat: move fat_i_pos_read to fat.h Move fat_i_pos_read to fat.h so that it can be called from nfs.c in the subsequent patches to encode the file handle. Signed-off-by: Namjae Jeon Signed-off-by: Ravishankar N Signed-off-by: Amit Sahrawat Acked-by: OGAWA Hirofumi 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 a7b1d86b37c7..f16948ed5bf8 100644 --- a/fs/fat/fat.h +++ b/fs/fat/fat.h @@ -218,6 +218,20 @@ static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus) + sbi->data_start; } +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 93fbc8a7f098..78e363c844cb 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -655,20 +655,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf) return 0; } -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 int __fat_write_inode(struct inode *inode, int wait) { struct super_block *sb = inode->i_sb; -- 2.39.5