Skip to content

Commit

Permalink
* misc: updated the sources to compile with linux kernels
Browse files Browse the repository at this point in the history
  of version 3.13.0
  • Loading branch information
jens-maus committed Aug 26, 2014
1 parent e49be77 commit eeb9e10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/fat.h
Expand Up @@ -345,6 +345,7 @@ struct msdos_sb_info {
struct hlist_head dir_hashtable[FAT_HASH_SIZE];

unsigned int dirty; /* fs state before mount */
struct rcu_head rcu;
};

#define FAT_CACHE_VALID 0 /* special case for valid cache */
Expand Down
21 changes: 12 additions & 9 deletions src/inode.c
Expand Up @@ -177,7 +177,7 @@ static void fat_write_failed(struct address_space *mapping, loff_t to)
struct inode *inode = mapping->host;

if (to > inode->i_size) {
truncate_pagecache(inode, to, inode->i_size);
truncate_pagecache(inode, inode->i_size);
fat_truncate_blocks(inode, inode->i_size);
}
}
Expand Down Expand Up @@ -593,6 +593,16 @@ static void fat_set_state(struct super_block *sb,
brelse(bh);
}

static void delayed_free(struct rcu_head *p)
{
struct msdos_sb_info *sbi = container_of(p, struct msdos_sb_info, rcu);
unload_nls(sbi->nls_disk);
unload_nls(sbi->nls_io);
if (sbi->options.iocharset != fat_default_iocharset)
kfree(sbi->options.iocharset);
kfree(sbi);
}

static void fat_put_super(struct super_block *sb)
{
struct msdos_sb_info *sbi = MSDOS_SB(sb);
Expand All @@ -602,14 +612,7 @@ static void fat_put_super(struct super_block *sb)
iput(sbi->fsinfo_inode);
iput(sbi->fat_inode);

unload_nls(sbi->nls_disk);
unload_nls(sbi->nls_io);

if (sbi->options.iocharset != fat_default_iocharset)
kfree(sbi->options.iocharset);

sb->s_fs_info = NULL;
kfree(sbi);
call_rcu(&sbi->rcu, delayed_free);
}

static struct kmem_cache *fat_inode_cachep;
Expand Down

0 comments on commit eeb9e10

Please sign in to comment.