Changeset 15534


Ignore:
Timestamp:
2009-05-01T11:23:31+02:00 (9 years ago)
Author:
florian
Message:

[brcm47xx] use vmalloc instead of kmalloc when reserving space for the lzma initramfs (#3488)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch

    r14722 r15534  
    1 --- a/init/initramfs.c 
    2 +++ b/init/initramfs.c 
    3 @@ -475,6 +475,69 @@ static void __init flush_window(void) 
     1--- a/init/initramfs.c  2009-03-23 22:55:52.000000000 +0100 
     2+++ b/init/initramfs.c  2009-05-01 11:15:46.000000000 +0200 
     3@@ -7,6 +7,7 @@ 
     4 #include <linux/string.h> 
     5 #include <linux/syscalls.h> 
     6 #include <linux/utime.h> 
     7+#include <linux/vmalloc.h> 
     8  
     9 static __initdata char *message; 
     10 static void __init error(char *x) 
     11@@ -475,6 +476,69 @@ 
    412        outcnt = 0; 
    513 } 
     
    4149+       printk( KERN_NOTICE "initramfs: LZMA lc=%d,lp=%d,pb=%d,origSize=%d\n", 
    4250+       lc,lp,pb,osize); 
    43 +       outputbuffer = kmalloc(osize, GFP_KERNEL); 
     51+       outputbuffer = vmalloc(osize); 
    4452+       if (outputbuffer == 0) { 
    4553+               printk(KERN_ERR "initramfs: Couldn't allocate lzma output buffer\n"); 
     
    4755+       } 
    4856+ 
    49 +       workspace = kmalloc(workspace_size, GFP_KERNEL); 
     57+       workspace = vmalloc(workspace_size); 
    5058+       if (workspace == NULL) { 
    5159+               printk(KERN_ERR "initramfs: Couldn't allocate lzma workspace\n"); 
     
    6270+       inptr = insize; 
    6371+ 
    64 +       kfree(outputbuffer); 
    65 +       kfree(workspace); 
     72+       vfree(outputbuffer); 
     73+       vfree(workspace); 
    6674+       state = Reset; 
    6775+       return 0; 
     
    7179 { 
    7280        int written; 
    73 @@ -509,12 +572,28 @@ static char * __init unpack_to_rootfs(ch 
     81@@ -509,12 +573,28 @@ 
    7482                inptr = 0; 
    7583                outcnt = 0;             /* bytes in output buffer */ 
     
    105113                len -= inptr; 
    106114        } 
    107 --- a/scripts/gen_initramfs_list.sh 
    108 +++ b/scripts/gen_initramfs_list.sh 
    109 @@ -287,7 +287,7 @@ if [ ! -z ${output_file} ]; then 
     115--- a/scripts/gen_initramfs_list.sh     2009-03-23 22:55:52.000000000 +0100 
     116+++ b/scripts/gen_initramfs_list.sh     2009-05-01 11:12:45.000000000 +0200 
     117@@ -287,7 +287,7 @@ 
    110118        if [ "${is_cpio_compressed}" = "compressed" ]; then 
    111119                cat ${cpio_tfile} > ${output_file} 
Note: See TracChangeset for help on using the changeset viewer.