aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r--fs/fat/inode.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index a3d81ebf6d86..0038b32cb362 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -738,22 +738,21 @@ static int
738fat_encode_fh(struct inode *inode, __u32 *fh, int *lenp, struct inode *parent) 738fat_encode_fh(struct inode *inode, __u32 *fh, int *lenp, struct inode *parent)
739{ 739{
740 int len = *lenp; 740 int len = *lenp;
741 u32 ipos_h, ipos_m, ipos_l; 741 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);
742 loff_t i_pos;
742 743
743 if (len < 5) { 744 if (len < 5) {
744 *lenp = 5; 745 *lenp = 5;
745 return 255; /* no room */ 746 return 255; /* no room */
746 } 747 }
747 748
748 ipos_h = MSDOS_I(inode)->i_pos >> 8; 749 i_pos = fat_i_pos_read(sbi, inode);
749 ipos_m = (MSDOS_I(inode)->i_pos & 0xf0) << 24;
750 ipos_l = (MSDOS_I(inode)->i_pos & 0x0f) << 28;
751 *lenp = 5; 750 *lenp = 5;
752 fh[0] = inode->i_ino; 751 fh[0] = inode->i_ino;
753 fh[1] = inode->i_generation; 752 fh[1] = inode->i_generation;
754 fh[2] = ipos_h; 753 fh[2] = i_pos >> 8;
755 fh[3] = ipos_m | MSDOS_I(inode)->i_logstart; 754 fh[3] = ((i_pos & 0xf0) << 24) | MSDOS_I(inode)->i_logstart;
756 fh[4] = ipos_l; 755 fh[4] = (i_pos & 0x0f) << 28;
757 if (parent) 756 if (parent)
758 fh[4] |= MSDOS_I(parent)->i_logstart; 757 fh[4] |= MSDOS_I(parent)->i_logstart;
759 return 3; 758 return 3;