aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/cache.c2
-rw-r--r--fs/fat/dir.c4
-rw-r--r--fs/fat/fatent.c6
-rw-r--r--fs/fat/file.c2
-rw-r--r--fs/fat/inode.c10
5 files changed, 11 insertions, 13 deletions
diff --git a/fs/fat/cache.c b/fs/fat/cache.c
index 1acc941245fb..97b967b84fc6 100644
--- a/fs/fat/cache.c
+++ b/fs/fat/cache.c
@@ -49,7 +49,7 @@ int __init fat_cache_init(void)
49{ 49{
50 fat_cache_cachep = kmem_cache_create("fat_cache", 50 fat_cache_cachep = kmem_cache_create("fat_cache",
51 sizeof(struct fat_cache), 51 sizeof(struct fat_cache),
52 0, SLAB_RECLAIM_ACCOUNT, 52 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
53 init_once, NULL); 53 init_once, NULL);
54 if (fat_cache_cachep == NULL) 54 if (fat_cache_cachep == NULL)
55 return -ENOMEM; 55 return -ENOMEM;
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index db0de5c621c7..698b85bb1dd4 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -114,7 +114,7 @@ static inline int fat_get_entry(struct inode *dir, loff_t *pos,
114} 114}
115 115
116/* 116/*
117 * Convert Unicode 16 to UTF8, translated Unicode, or ASCII. 117 * Convert Unicode 16 to UTF-8, translated Unicode, or ASCII.
118 * If uni_xlate is enabled and we can't get a 1:1 conversion, use a 118 * If uni_xlate is enabled and we can't get a 1:1 conversion, use a
119 * colon as an escape character since it is normally invalid on the vfat 119 * colon as an escape character since it is normally invalid on the vfat
120 * filesystem. The following four characters are the hexadecimal digits 120 * filesystem. The following four characters are the hexadecimal digits
@@ -741,7 +741,7 @@ static int fat_dir_ioctl(struct inode * inode, struct file * filp,
741 return ret; 741 return ret;
742} 742}
743 743
744struct file_operations fat_dir_operations = { 744const struct file_operations fat_dir_operations = {
745 .read = generic_read_dir, 745 .read = generic_read_dir,
746 .readdir = fat_readdir, 746 .readdir = fat_readdir,
747 .ioctl = fat_dir_ioctl, 747 .ioctl = fat_dir_ioctl,
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index a1a9e0451217..ab171ea8e869 100644
--- a/fs/fat/fatent.c
+++ b/fs/fat/fatent.c
@@ -267,19 +267,19 @@ static struct fatent_operations fat32_ops = {
267 267
268static inline void lock_fat(struct msdos_sb_info *sbi) 268static inline void lock_fat(struct msdos_sb_info *sbi)
269{ 269{
270 down(&sbi->fat_lock); 270 mutex_lock(&sbi->fat_lock);
271} 271}
272 272
273static inline void unlock_fat(struct msdos_sb_info *sbi) 273static inline void unlock_fat(struct msdos_sb_info *sbi)
274{ 274{
275 up(&sbi->fat_lock); 275 mutex_unlock(&sbi->fat_lock);
276} 276}
277 277
278void fat_ent_access_init(struct super_block *sb) 278void fat_ent_access_init(struct super_block *sb)
279{ 279{
280 struct msdos_sb_info *sbi = MSDOS_SB(sb); 280 struct msdos_sb_info *sbi = MSDOS_SB(sb);
281 281
282 init_MUTEX(&sbi->fat_lock); 282 mutex_init(&sbi->fat_lock);
283 283
284 switch (sbi->fat_bits) { 284 switch (sbi->fat_bits) {
285 case 32: 285 case 32:
diff --git a/fs/fat/file.c b/fs/fat/file.c
index 88aa1ae13f9f..1ee25232e6af 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -112,7 +112,7 @@ int fat_generic_ioctl(struct inode *inode, struct file *filp,
112 } 112 }
113} 113}
114 114
115struct file_operations fat_file_operations = { 115const struct file_operations fat_file_operations = {
116 .llseek = generic_file_llseek, 116 .llseek = generic_file_llseek,
117 .read = do_sync_read, 117 .read = do_sync_read,
118 .write = do_sync_write, 118 .write = do_sync_write,
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index e7f4aa7fc686..c1ce284f8a94 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -101,11 +101,11 @@ static int __fat_get_blocks(struct inode *inode, sector_t iblock,
101} 101}
102 102
103static int fat_get_blocks(struct inode *inode, sector_t iblock, 103static int fat_get_blocks(struct inode *inode, sector_t iblock,
104 unsigned long max_blocks,
105 struct buffer_head *bh_result, int create) 104 struct buffer_head *bh_result, int create)
106{ 105{
107 struct super_block *sb = inode->i_sb; 106 struct super_block *sb = inode->i_sb;
108 int err; 107 int err;
108 unsigned long max_blocks = bh_result->b_size >> inode->i_blkbits;
109 109
110 err = __fat_get_blocks(inode, iblock, &max_blocks, bh_result, create); 110 err = __fat_get_blocks(inode, iblock, &max_blocks, bh_result, create);
111 if (err) 111 if (err)
@@ -518,7 +518,8 @@ static int __init fat_init_inodecache(void)
518{ 518{
519 fat_inode_cachep = kmem_cache_create("fat_inode_cache", 519 fat_inode_cachep = kmem_cache_create("fat_inode_cache",
520 sizeof(struct msdos_inode_info), 520 sizeof(struct msdos_inode_info),
521 0, SLAB_RECLAIM_ACCOUNT, 521 0, (SLAB_RECLAIM_ACCOUNT|
522 SLAB_MEM_SPREAD),
522 init_once, NULL); 523 init_once, NULL);
523 if (fat_inode_cachep == NULL) 524 if (fat_inode_cachep == NULL)
524 return -ENOMEM; 525 return -ENOMEM;
@@ -1101,7 +1102,7 @@ static int parse_options(char *options, int is_vfat, int silent, int *debug,
1101 return -EINVAL; 1102 return -EINVAL;
1102 } 1103 }
1103 } 1104 }
1104 /* UTF8 doesn't provide FAT semantics */ 1105 /* UTF-8 doesn't provide FAT semantics */
1105 if (!strcmp(opts->iocharset, "utf8")) { 1106 if (!strcmp(opts->iocharset, "utf8")) {
1106 printk(KERN_ERR "FAT: utf8 is not a recommended IO charset" 1107 printk(KERN_ERR "FAT: utf8 is not a recommended IO charset"
1107 " for FAT filesystems, filesystem will be case sensitive!\n"); 1108 " for FAT filesystems, filesystem will be case sensitive!\n");
@@ -1434,9 +1435,6 @@ out_fail:
1434 1435
1435EXPORT_SYMBOL_GPL(fat_fill_super); 1436EXPORT_SYMBOL_GPL(fat_fill_super);
1436 1437
1437int __init fat_cache_init(void);
1438void fat_cache_destroy(void);
1439
1440static int __init init_fat_fs(void) 1438static int __init init_fat_fs(void)
1441{ 1439{
1442 int err; 1440 int err;