diff options
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/file.c | 3 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 7 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 3 |
3 files changed, 4 insertions, 9 deletions
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 6526498949d8..970ecd9dbe69 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -317,12 +317,11 @@ static int reiserfs_allocate_blocks_for_region(struct reiserfs_transaction_handl | |||
317 | /* area filled with zeroes, to supply as list of zero blocknumbers | 317 | /* area filled with zeroes, to supply as list of zero blocknumbers |
318 | We allocate it outside of loop just in case loop would spin for | 318 | We allocate it outside of loop just in case loop would spin for |
319 | several iterations. */ | 319 | several iterations. */ |
320 | char *zeros = kmalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway. | 320 | char *zeros = kzalloc(to_paste * UNFM_P_SIZE, GFP_ATOMIC); // We cannot insert more than MAX_ITEM_LEN bytes anyway. |
321 | if (!zeros) { | 321 | if (!zeros) { |
322 | res = -ENOMEM; | 322 | res = -ENOMEM; |
323 | goto error_exit_free_blocks; | 323 | goto error_exit_free_blocks; |
324 | } | 324 | } |
325 | memset(zeros, 0, to_paste * UNFM_P_SIZE); | ||
326 | do { | 325 | do { |
327 | to_paste = | 326 | to_paste = |
328 | min_t(__u64, hole_size, | 327 | min_t(__u64, hole_size, |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index a625688de454..254239e6f9e3 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -929,15 +929,12 @@ int reiserfs_get_block(struct inode *inode, sector_t block, | |||
929 | if (blocks_needed == 1) { | 929 | if (blocks_needed == 1) { |
930 | un = &unf_single; | 930 | un = &unf_single; |
931 | } else { | 931 | } else { |
932 | un = kmalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling. | 932 | un = kzalloc(min(blocks_needed, max_to_insert) * UNFM_P_SIZE, GFP_ATOMIC); // We need to avoid scheduling. |
933 | if (!un) { | 933 | if (!un) { |
934 | un = &unf_single; | 934 | un = &unf_single; |
935 | blocks_needed = 1; | 935 | blocks_needed = 1; |
936 | max_to_insert = 0; | 936 | max_to_insert = 0; |
937 | } else | 937 | } |
938 | memset(un, 0, | ||
939 | UNFM_P_SIZE * min(blocks_needed, | ||
940 | max_to_insert)); | ||
941 | } | 938 | } |
942 | if (blocks_needed <= max_to_insert) { | 939 | if (blocks_needed <= max_to_insert) { |
943 | /* we are going to add target block to the file. Use allocated | 940 | /* we are going to add target block to the file. Use allocated |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index 745bc714ba91..7fb5fb036f90 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -1549,13 +1549,12 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1549 | struct reiserfs_sb_info *sbi; | 1549 | struct reiserfs_sb_info *sbi; |
1550 | int errval = -EINVAL; | 1550 | int errval = -EINVAL; |
1551 | 1551 | ||
1552 | sbi = kmalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL); | 1552 | sbi = kzalloc(sizeof(struct reiserfs_sb_info), GFP_KERNEL); |
1553 | if (!sbi) { | 1553 | if (!sbi) { |
1554 | errval = -ENOMEM; | 1554 | errval = -ENOMEM; |
1555 | goto error; | 1555 | goto error; |
1556 | } | 1556 | } |
1557 | s->s_fs_info = sbi; | 1557 | s->s_fs_info = sbi; |
1558 | memset(sbi, 0, sizeof(struct reiserfs_sb_info)); | ||
1559 | /* Set default values for options: non-aggressive tails, RO on errors */ | 1558 | /* Set default values for options: non-aggressive tails, RO on errors */ |
1560 | REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL); | 1559 | REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_SMALLTAIL); |
1561 | REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO); | 1560 | REISERFS_SB(s)->s_mount_opt |= (1 << REISERFS_ERROR_RO); |