aboutsummaryrefslogtreecommitdiffstats
path: root/fs/minix/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/minix/inode.c')
-rw-r--r--fs/minix/inode.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 330ff9fc7cf0..c11a4b9fb863 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -90,8 +90,7 @@ static int init_inodecache(void)
90 90
91static void destroy_inodecache(void) 91static void destroy_inodecache(void)
92{ 92{
93 if (kmem_cache_destroy(minix_inode_cachep)) 93 kmem_cache_destroy(minix_inode_cachep);
94 printk(KERN_INFO "minix_inode_cache: not all structures were freed\n");
95} 94}
96 95
97static struct super_operations minix_sops = { 96static struct super_operations minix_sops = {
@@ -145,11 +144,10 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
145 struct inode *root_inode; 144 struct inode *root_inode;
146 struct minix_sb_info *sbi; 145 struct minix_sb_info *sbi;
147 146
148 sbi = kmalloc(sizeof(struct minix_sb_info), GFP_KERNEL); 147 sbi = kzalloc(sizeof(struct minix_sb_info), GFP_KERNEL);
149 if (!sbi) 148 if (!sbi)
150 return -ENOMEM; 149 return -ENOMEM;
151 s->s_fs_info = sbi; 150 s->s_fs_info = sbi;
152 memset(sbi, 0, sizeof(struct minix_sb_info));
153 151
154 /* N.B. These should be compile-time tests. 152 /* N.B. These should be compile-time tests.
155 Unfortunately that is impossible. */ 153 Unfortunately that is impossible. */
@@ -207,10 +205,9 @@ static int minix_fill_super(struct super_block *s, void *data, int silent)
207 if (sbi->s_imap_blocks == 0 || sbi->s_zmap_blocks == 0) 205 if (sbi->s_imap_blocks == 0 || sbi->s_zmap_blocks == 0)
208 goto out_illegal_sb; 206 goto out_illegal_sb;
209 i = (sbi->s_imap_blocks + sbi->s_zmap_blocks) * sizeof(bh); 207 i = (sbi->s_imap_blocks + sbi->s_zmap_blocks) * sizeof(bh);
210 map = kmalloc(i, GFP_KERNEL); 208 map = kzalloc(i, GFP_KERNEL);
211 if (!map) 209 if (!map)
212 goto out_no_map; 210 goto out_no_map;
213 memset(map, 0, i);
214 sbi->s_imap = &map[0]; 211 sbi->s_imap = &map[0];
215 sbi->s_zmap = &map[sbi->s_imap_blocks]; 212 sbi->s_zmap = &map[sbi->s_imap_blocks];
216 213
@@ -399,7 +396,7 @@ static void V1_minix_read_inode(struct inode * inode)
399 inode->i_mtime.tv_nsec = 0; 396 inode->i_mtime.tv_nsec = 0;
400 inode->i_atime.tv_nsec = 0; 397 inode->i_atime.tv_nsec = 0;
401 inode->i_ctime.tv_nsec = 0; 398 inode->i_ctime.tv_nsec = 0;
402 inode->i_blocks = inode->i_blksize = 0; 399 inode->i_blocks = 0;
403 for (i = 0; i < 9; i++) 400 for (i = 0; i < 9; i++)
404 minix_inode->u.i1_data[i] = raw_inode->i_zone[i]; 401 minix_inode->u.i1_data[i] = raw_inode->i_zone[i];
405 minix_set_inode(inode, old_decode_dev(raw_inode->i_zone[0])); 402 minix_set_inode(inode, old_decode_dev(raw_inode->i_zone[0]));
@@ -432,7 +429,7 @@ static void V2_minix_read_inode(struct inode * inode)
432 inode->i_mtime.tv_nsec = 0; 429 inode->i_mtime.tv_nsec = 0;
433 inode->i_atime.tv_nsec = 0; 430 inode->i_atime.tv_nsec = 0;
434 inode->i_ctime.tv_nsec = 0; 431 inode->i_ctime.tv_nsec = 0;
435 inode->i_blocks = inode->i_blksize = 0; 432 inode->i_blocks = 0;
436 for (i = 0; i < 10; i++) 433 for (i = 0; i < 10; i++)
437 minix_inode->u.i2_data[i] = raw_inode->i_zone[i]; 434 minix_inode->u.i2_data[i] = raw_inode->i_zone[i];
438 minix_set_inode(inode, old_decode_dev(raw_inode->i_zone[0])); 435 minix_set_inode(inode, old_decode_dev(raw_inode->i_zone[0]));