Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f21735d5 authored by Namjae Jeon's avatar Namjae Jeon Committed by Linus Torvalds
Browse files

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: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarRavishankar N <ravi.n1@samsung.com>
Signed-off-by: default avatarAmit Sahrawat <a.sahrawat@samsung.com>
Acked-by: default avatarOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2628b7a6
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -218,6 +218,20 @@ static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus)
		+ sbi->data_start;
		+ 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)
static inline void fat16_towchar(wchar_t *dst, const __u8 *src, size_t len)
{
{
#ifdef __BIG_ENDIAN
#ifdef __BIG_ENDIAN
+0 −14
Original line number Original line Diff line number Diff line
@@ -655,20 +655,6 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf)
	return 0;
	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)
static int __fat_write_inode(struct inode *inode, int wait)
{
{
	struct super_block *sb = inode->i_sb;
	struct super_block *sb = inode->i_sb;