Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 118468
b: refs/heads/master
c: 9ca59f4
h: refs/heads/master
v: v3
  • Loading branch information
OGAWA Hirofumi authored and Linus Torvalds committed Nov 6, 2008
1 parent 61f5825 commit 4978b3b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2bdf67eb1631f30e2f3f5d49e4007c76e88877a8
refs/heads/master: 9ca59f4c3d28df14a1545a1e2832f34a0a50e3ed
21 changes: 19 additions & 2 deletions trunk/fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,20 @@ 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 All @@ -551,9 +565,12 @@ static int fat_write_inode(struct inode *inode, int wait)
loff_t i_pos;
int err;

if (inode->i_ino == MSDOS_ROOT_INO)
return 0;

retry:
i_pos = MSDOS_I(inode)->i_pos;
if (inode->i_ino == MSDOS_ROOT_INO || !i_pos)
i_pos = fat_i_pos_read(sbi, inode);
if (!i_pos)
return 0;

bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits);
Expand Down

0 comments on commit 4978b3b

Please sign in to comment.