diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-07 13:44:36 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:12 -0400 |
commit | b522412aeabadbb302fd4338eaabf09d10e2d29c (patch) | |
tree | 6b6b73686bc77e10a3a8275e84bc545ddf7755b6 /fs/fat/inode.c | |
parent | 964f5369667b342994fe3f384e9ba41d404ee796 (diff) | |
download | kernel_samsung_aries-b522412aeabadbb302fd4338eaabf09d10e2d29c.zip kernel_samsung_aries-b522412aeabadbb302fd4338eaabf09d10e2d29c.tar.gz kernel_samsung_aries-b522412aeabadbb302fd4338eaabf09d10e2d29c.tar.bz2 |
Sanitize ->fsync() for FAT
* mark directory data blocks as assoc. metadata
* add new inode to deal with FAT, mark FAT blocks as assoc. metadata of that
* now ->fsync() is trivial both for files and directories
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fat/inode.c')
-rw-r--r-- | fs/fat/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 2292cbf..476f80b 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c @@ -458,6 +458,8 @@ static void fat_put_super(struct super_block *sb) if (sb->s_dirt) fat_write_super(sb); + iput(sbi->fat_inode); + if (sbi->nls_disk) { unload_nls(sbi->nls_disk); sbi->nls_disk = NULL; @@ -1183,7 +1185,7 @@ static int fat_read_root(struct inode *inode) int fat_fill_super(struct super_block *sb, void *data, int silent, const struct inode_operations *fs_dir_inode_ops, int isvfat) { - struct inode *root_inode = NULL; + struct inode *root_inode = NULL, *fat_inode = NULL; struct buffer_head *bh; struct fat_boot_sector *b; struct msdos_sb_info *sbi; @@ -1423,6 +1425,11 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, } error = -ENOMEM; + fat_inode = new_inode(sb); + if (!fat_inode) + goto out_fail; + MSDOS_I(fat_inode)->i_pos = 0; + sbi->fat_inode = fat_inode; root_inode = new_inode(sb); if (!root_inode) goto out_fail; @@ -1448,6 +1455,8 @@ out_invalid: " on dev %s.\n", sb->s_id); out_fail: + if (fat_inode) + iput(fat_inode); if (root_inode) iput(root_inode); if (sbi->nls_io) |