Skip to content

Commit f21735d

Browse files
Namjae Jeontorvalds
authored andcommitted
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 <namjae.jeon@samsung.com> Signed-off-by: Ravishankar N <ravi.n1@samsung.com> Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com> Acked-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2628b7a commit f21735d

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

‎fs/fat/fat.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,20 @@ static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus)
218218
+ sbi->data_start;
219219
}
220220

221+
static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
222+
struct inode *inode)
223+
{
224+
loff_t i_pos;
225+
#if BITS_PER_LONG == 32
226+
spin_lock(&sbi->inode_hash_lock);
227+
#endif
228+
i_pos = MSDOS_I(inode)->i_pos;
229+
#if BITS_PER_LONG == 32
230+
spin_unlock(&sbi->inode_hash_lock);
231+
#endif
232+
return i_pos;
233+
}
234+
221235
static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len)
222236
{
223237
#ifdef __BIG_ENDIAN

‎fs/fat/inode.c‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -655,20 +655,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
655655
return 0;
656656
}
657657

658-
static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
659-
struct inode *inode)
660-
{
661-
loff_t i_pos;
662-
#if BITS_PER_LONG == 32
663-
spin_lock(&sbi->inode_hash_lock);
664-
#endif
665-
i_pos = MSDOS_I(inode)->i_pos;
666-
#if BITS_PER_LONG == 32
667-
spin_unlock(&sbi->inode_hash_lock);
668-
#endif
669-
return i_pos;
670-
}
671-
672658
static int __fat_write_inode(struct inode *inode, int wait)
673659
{
674660
struct super_block *sb = inode->i_sb;

0 commit comments

Comments
 (0)