From 6554217e6ef7f0663acb3fad057c7acb317ce87e Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 13 Jul 2009 09:45:52 -0400 Subject: [PATCH] --- yaml --- r: 155447 b: refs/heads/master c: 833576b362e15c38be3bfe43942cda693e56287c h: refs/heads/master i: 155445: 4da55d15d245b43e336b00627fbac1ce14d66ab6 155443: d4f6546fa073ad869ca0c3026031b3299cf7bb97 155439: c23d0c379f29ef03d60edd78b0a03a2f1f5eb7e1 v: v3 --- [refs] | 2 +- trunk/fs/ext4/mballoc.c | 20 ++------------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/[refs] b/[refs] index d5dfe1660c65..9e6c164331ee 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac046f1d6121ccdda6db66bd88acd52418f489b2 +refs/heads/master: 833576b362e15c38be3bfe43942cda693e56287c diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index 2fcaf286f1de..cd258463e2a9 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -4227,14 +4227,9 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac, ext4_get_group_no_and_offset(sb, goal, &group, &block); /* set up allocation goals */ + memset(ac, 0, sizeof(struct ext4_allocation_context)); ac->ac_b_ex.fe_logical = ar->logical; - ac->ac_b_ex.fe_group = 0; - ac->ac_b_ex.fe_start = 0; - ac->ac_b_ex.fe_len = 0; ac->ac_status = AC_STATUS_CONTINUE; - ac->ac_groups_scanned = 0; - ac->ac_ex_scanned = 0; - ac->ac_found = 0; ac->ac_sb = sb; ac->ac_inode = ar->inode; ac->ac_o_ex.fe_logical = ar->logical; @@ -4245,15 +4240,7 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac, ac->ac_g_ex.fe_group = group; ac->ac_g_ex.fe_start = block; ac->ac_g_ex.fe_len = len; - ac->ac_f_ex.fe_len = 0; ac->ac_flags = ar->flags; - ac->ac_2order = 0; - ac->ac_criteria = 0; - ac->ac_pa = NULL; - ac->ac_bitmap_page = NULL; - ac->ac_buddy_page = NULL; - ac->alloc_semp = NULL; - ac->ac_lg = NULL; /* we have to define context: we'll we work with a file or * locality group. this is a policy, actually */ @@ -4521,10 +4508,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, } ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); - if (ac) { - ac->ac_sb = sb; - ac->ac_inode = ar->inode; - } else { + if (!ac) { ar->len = 0; *errp = -ENOMEM; goto out1;