Skip to content

Commit

Permalink
fat: move fat_i_pos_read to fat.h
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ravishankar N <[email protected]>
Signed-off-by: Amit Sahrawat <[email protected]>
Acked-by: OGAWA Hirofumi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
namjaejeon authored and torvalds committed Apr 30, 2013
1 parent 2628b7a commit f21735d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 14 additions & 0 deletions fs/fat/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 0 additions & 14 deletions fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f21735d

Please sign in to comment.