Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309723
b: refs/heads/master
c: 020ac5b
h: refs/heads/master
i:
  309721: 8a93389
  309719: f80a8ae
v: v3
  • Loading branch information
Artem Bityutskiy authored and Linus Torvalds committed Jun 1, 2012
1 parent 7a5af4d commit bc8c33c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 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: 7bc1bac77a69011550ce0613f4a23712a002d7ad
refs/heads/master: 020ac5b6bef15785f9dde9de89d2734ff97da733
1 change: 1 addition & 0 deletions trunk/fs/fat/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct msdos_sb_info {
int fatent_shift;
struct fatent_operations *fatent_ops;
struct inode *fat_inode;
struct inode *fsinfo_inode;

struct ratelimit_state ratelimit;

Expand Down
12 changes: 12 additions & 0 deletions trunk/fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ static void fat_put_super(struct super_block *sb)
if (sb->s_dirt)
fat_write_super(sb);

iput(sbi->fsinfo_inode);
iput(sbi->fat_inode);

unload_nls(sbi->nls_disk);
Expand Down Expand Up @@ -1244,6 +1245,7 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
void (*setup)(struct super_block *))
{
struct inode *root_inode = NULL, *fat_inode = NULL;
struct inode *fsinfo_inode = NULL;
struct buffer_head *bh;
struct fat_boot_sector *b;
struct msdos_sb_info *sbi;
Expand Down Expand Up @@ -1490,6 +1492,14 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
goto out_fail;
MSDOS_I(fat_inode)->i_pos = 0;
sbi->fat_inode = fat_inode;

fsinfo_inode = new_inode(sb);
if (!fsinfo_inode)
goto out_fail;
fsinfo_inode->i_ino = MSDOS_FSINFO_INO;
sbi->fsinfo_inode = fsinfo_inode;
insert_inode_hash(fsinfo_inode);

root_inode = new_inode(sb);
if (!root_inode)
goto out_fail;
Expand All @@ -1516,6 +1526,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat,
fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem");

out_fail:
if (fsinfo_inode)
iput(fsinfo_inode);
if (fat_inode)
iput(fat_inode);
unload_nls(sbi->nls_io);
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/msdos_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
#define CT_LE_W(v) cpu_to_le16(v)
#define CT_LE_L(v) cpu_to_le32(v)

#define MSDOS_ROOT_INO 1 /* The root inode number */
#define MSDOS_FSINFO_INO 2 /* Used for managing the FSINFO block */

#define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */
#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */

/* directory limit */
Expand Down

0 comments on commit bc8c33c

Please sign in to comment.