summaryrefslogtreecommitdiffstats
path: root/fs/fat/fat.h
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2013-04-30 01:21:10 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 03:28:40 +0200
commite22a444275d1e7c80db5d8bec08fb8d0d79617ad (patch)
treeb69291b4b24a733f6d5ec6178e1cc9059e5dc5bf /fs/fat/fat.h
parentfat: move fat_i_pos_read to fat.h (diff)
downloadlinux-e22a444275d1e7c80db5d8bec08fb8d0d79617ad.tar.xz
linux-e22a444275d1e7c80db5d8bec08fb8d0d79617ad.zip
fat: introduce a helper fat_get_blknr_offset()
Introduce helper function to get the block number and offset for a given i_pos value. Use it in __fat_write_inode() now and later on in nfs.c 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>
Diffstat (limited to 'fs/fat/fat.h')
-rw-r--r--fs/fat/fat.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fat/fat.h b/fs/fat/fat.h
index f16948ed5bf8..980c0346c168 100644
--- a/fs/fat/fat.h
+++ b/fs/fat/fat.h
@@ -218,6 +218,13 @@ static inline sector_t fat_clus_to_blknr(struct msdos_sb_info *sbi, int clus)
+ sbi->data_start;
}
+static inline void fat_get_blknr_offset(struct msdos_sb_info *sbi,
+ loff_t i_pos, sector_t *blknr, int *offset)
+{
+ *blknr = i_pos >> sbi->dir_per_block_bits;
+ *offset = i_pos & (sbi->dir_per_block - 1);
+}
+
static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi,
struct inode *inode)
{