1. 10 2月, 2008 2 次提交
    • E
      ext4: allocate struct ext4_allocation_context from a kmem cache · 256bdb49
      Eric Sandeen 提交于
      struct ext4_allocation_context is rather large, and this bloats
      the stack of many functions which use it.  Allocating it from
      a named slab cache will alleviate this.
      
      For example, with this change (on top of the noinline patch sent earlier):
      
      -ext4_mb_new_blocks		200
      +ext4_mb_new_blocks		 40
      
      -ext4_mb_free_blocks		344
      +ext4_mb_free_blocks		168
      
      -ext4_mb_release_inode_pa	216
      +ext4_mb_release_inode_pa	 40
      
      -ext4_mb_release_group_pa	192
      +ext4_mb_release_group_pa	 24
      
      Most of these stack-allocated structs are actually used only for
      mballoc history; and in those cases often a smaller struct would do.
      So changing that may be another way around it, at least for those
      functions, if preferred.  For now, in those cases where the ac
      is only for history, an allocation failure simply skips the history
      recording, and does not cause any other failures.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      
      256bdb49
    • A
      ext4: Fix null bh pointer dereference in mballoc · 42a10add
      Aneesh Kumar K.V 提交于
      Repoted by Adrian Bunk <bunk@kernel.org>:
      
      The Coverity checker spotted the following NULL dereference:
      
      static int ext4_mb_mark_diskspace_used
      {
      	...
      	if (!bitmap_bh)
      		goto out_err;
      	...
      out_err:
      	sb->s_dirt = 1;
      	put_bh(bitmap_bh);
      	...
      Signed-off-by: NAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      42a10add
  2. 29 1月, 2008 1 次提交