diff options
Diffstat (limited to 'fs/jfs/super.c')
-rw-r--r-- | fs/jfs/super.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 2234c73fc577..b66832ac33ac 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/buffer_head.h> | 30 | #include <linux/buffer_head.h> |
31 | #include <linux/exportfs.h> | 31 | #include <linux/exportfs.h> |
32 | #include <linux/crc32.h> | 32 | #include <linux/crc32.h> |
33 | #include <linux/slab.h> | ||
33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
34 | #include <linux/seq_file.h> | 35 | #include <linux/seq_file.h> |
35 | #include <linux/smp_lock.h> | 36 | #include <linux/smp_lock.h> |
@@ -131,6 +132,11 @@ static void jfs_destroy_inode(struct inode *inode) | |||
131 | kmem_cache_free(jfs_inode_cachep, ji); | 132 | kmem_cache_free(jfs_inode_cachep, ji); |
132 | } | 133 | } |
133 | 134 | ||
135 | static void jfs_clear_inode(struct inode *inode) | ||
136 | { | ||
137 | dquot_drop(inode); | ||
138 | } | ||
139 | |||
134 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) | 140 | static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) |
135 | { | 141 | { |
136 | struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb); | 142 | struct jfs_sb_info *sbi = JFS_SBI(dentry->d_sb); |
@@ -440,10 +446,8 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) | |||
440 | /* initialize the mount flag and determine the default error handler */ | 446 | /* initialize the mount flag and determine the default error handler */ |
441 | flag = JFS_ERR_REMOUNT_RO; | 447 | flag = JFS_ERR_REMOUNT_RO; |
442 | 448 | ||
443 | if (!parse_options((char *) data, sb, &newLVSize, &flag)) { | 449 | if (!parse_options((char *) data, sb, &newLVSize, &flag)) |
444 | kfree(sbi); | 450 | goto out_kfree; |
445 | return -EINVAL; | ||
446 | } | ||
447 | sbi->flag = flag; | 451 | sbi->flag = flag; |
448 | 452 | ||
449 | #ifdef CONFIG_JFS_POSIX_ACL | 453 | #ifdef CONFIG_JFS_POSIX_ACL |
@@ -452,7 +456,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) | |||
452 | 456 | ||
453 | if (newLVSize) { | 457 | if (newLVSize) { |
454 | printk(KERN_ERR "resize option for remount only\n"); | 458 | printk(KERN_ERR "resize option for remount only\n"); |
455 | return -EINVAL; | 459 | goto out_kfree; |
456 | } | 460 | } |
457 | 461 | ||
458 | /* | 462 | /* |
@@ -472,7 +476,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) | |||
472 | inode = new_inode(sb); | 476 | inode = new_inode(sb); |
473 | if (inode == NULL) { | 477 | if (inode == NULL) { |
474 | ret = -ENOMEM; | 478 | ret = -ENOMEM; |
475 | goto out_kfree; | 479 | goto out_unload; |
476 | } | 480 | } |
477 | inode->i_ino = 0; | 481 | inode->i_ino = 0; |
478 | inode->i_nlink = 1; | 482 | inode->i_nlink = 1; |
@@ -524,7 +528,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent) | |||
524 | * Page cache is indexed by long. | 528 | * Page cache is indexed by long. |
525 | * I would use MAX_LFS_FILESIZE, but it's only half as big | 529 | * I would use MAX_LFS_FILESIZE, but it's only half as big |
526 | */ | 530 | */ |
527 | sb->s_maxbytes = min(((u64) PAGE_CACHE_SIZE << 32) - 1, sb->s_maxbytes); | 531 | sb->s_maxbytes = min(((u64) PAGE_CACHE_SIZE << 32) - 1, (u64)sb->s_maxbytes); |
528 | #endif | 532 | #endif |
529 | sb->s_time_gran = 1; | 533 | sb->s_time_gran = 1; |
530 | return 0; | 534 | return 0; |
@@ -544,9 +548,10 @@ out_mount_failed: | |||
544 | make_bad_inode(sbi->direct_inode); | 548 | make_bad_inode(sbi->direct_inode); |
545 | iput(sbi->direct_inode); | 549 | iput(sbi->direct_inode); |
546 | sbi->direct_inode = NULL; | 550 | sbi->direct_inode = NULL; |
547 | out_kfree: | 551 | out_unload: |
548 | if (sbi->nls_tab) | 552 | if (sbi->nls_tab) |
549 | unload_nls(sbi->nls_tab); | 553 | unload_nls(sbi->nls_tab); |
554 | out_kfree: | ||
550 | kfree(sbi); | 555 | kfree(sbi); |
551 | return ret; | 556 | return ret; |
552 | } | 557 | } |
@@ -745,6 +750,7 @@ static const struct super_operations jfs_super_operations = { | |||
745 | .dirty_inode = jfs_dirty_inode, | 750 | .dirty_inode = jfs_dirty_inode, |
746 | .write_inode = jfs_write_inode, | 751 | .write_inode = jfs_write_inode, |
747 | .delete_inode = jfs_delete_inode, | 752 | .delete_inode = jfs_delete_inode, |
753 | .clear_inode = jfs_clear_inode, | ||
748 | .put_super = jfs_put_super, | 754 | .put_super = jfs_put_super, |
749 | .sync_fs = jfs_sync_fs, | 755 | .sync_fs = jfs_sync_fs, |
750 | .freeze_fs = jfs_freeze, | 756 | .freeze_fs = jfs_freeze, |