aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/journal.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/journal.c')
-rw-r--r--fs/reiserfs/journal.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index a159ba5a35e7..eb711060a6f2 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -291,14 +291,13 @@ int reiserfs_allocate_list_bitmaps(struct super_block *sb,
291 for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) { 291 for (i = 0; i < JOURNAL_NUM_BITMAPS; i++) {
292 jb = jb_array + i; 292 jb = jb_array + i;
293 jb->journal_list = NULL; 293 jb->journal_list = NULL;
294 jb->bitmaps = vmalloc(mem); 294 jb->bitmaps = vzalloc(mem);
295 if (!jb->bitmaps) { 295 if (!jb->bitmaps) {
296 reiserfs_warning(sb, "clm-2000", "unable to " 296 reiserfs_warning(sb, "clm-2000", "unable to "
297 "allocate bitmaps for journal lists"); 297 "allocate bitmaps for journal lists");
298 failed = 1; 298 failed = 1;
299 break; 299 break;
300 } 300 }
301 memset(jb->bitmaps, 0, mem);
302 } 301 }
303 if (failed) { 302 if (failed) {
304 free_list_bitmaps(sb, jb_array); 303 free_list_bitmaps(sb, jb_array);
@@ -353,11 +352,10 @@ static struct reiserfs_journal_cnode *allocate_cnodes(int num_cnodes)
353 if (num_cnodes <= 0) { 352 if (num_cnodes <= 0) {
354 return NULL; 353 return NULL;
355 } 354 }
356 head = vmalloc(num_cnodes * sizeof(struct reiserfs_journal_cnode)); 355 head = vzalloc(num_cnodes * sizeof(struct reiserfs_journal_cnode));
357 if (!head) { 356 if (!head) {
358 return NULL; 357 return NULL;
359 } 358 }
360 memset(head, 0, num_cnodes * sizeof(struct reiserfs_journal_cnode));
361 head[0].prev = NULL; 359 head[0].prev = NULL;
362 head[0].next = head + 1; 360 head[0].next = head + 1;
363 for (i = 1; i < num_cnodes; i++) { 361 for (i = 1; i < num_cnodes; i++) {
@@ -2685,14 +2683,13 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
2685 * dependency inversion warnings. 2683 * dependency inversion warnings.
2686 */ 2684 */
2687 reiserfs_write_unlock(sb); 2685 reiserfs_write_unlock(sb);
2688 journal = SB_JOURNAL(sb) = vmalloc(sizeof(struct reiserfs_journal)); 2686 journal = SB_JOURNAL(sb) = vzalloc(sizeof(struct reiserfs_journal));
2689 if (!journal) { 2687 if (!journal) {
2690 reiserfs_warning(sb, "journal-1256", 2688 reiserfs_warning(sb, "journal-1256",
2691 "unable to get memory for journal structure"); 2689 "unable to get memory for journal structure");
2692 reiserfs_write_lock(sb); 2690 reiserfs_write_lock(sb);
2693 return 1; 2691 return 1;
2694 } 2692 }
2695 memset(journal, 0, sizeof(struct reiserfs_journal));
2696 INIT_LIST_HEAD(&journal->j_bitmap_nodes); 2693 INIT_LIST_HEAD(&journal->j_bitmap_nodes);
2697 INIT_LIST_HEAD(&journal->j_prealloc_list); 2694 INIT_LIST_HEAD(&journal->j_prealloc_list);
2698 INIT_LIST_HEAD(&journal->j_working_list); 2695 INIT_LIST_HEAD(&journal->j_working_list);