aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-05-01 09:23:31 +0000
committerFlorian Fainelli <florian@openwrt.org>2009-05-01 09:23:31 +0000
commit35fd7d6d20706f62d8be6fe2e846049c1803d867 (patch)
tree16f82b47dfeb024e5eb1360a7775aa011cf46293 /target
parent6fa4734cde9e5f91a0ef6d008043f87e02758c11 (diff)
downloadupstream-35fd7d6d20706f62d8be6fe2e846049c1803d867.tar.gz
upstream-35fd7d6d20706f62d8be6fe2e846049c1803d867.tar.bz2
upstream-35fd7d6d20706f62d8be6fe2e846049c1803d867.zip
use vmalloc instead of kmalloc when reserving space for the lzma initramfs (#3488)
SVN-Revision: 15534
Diffstat (limited to 'target')
-rw-r--r--target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch30
1 files changed, 19 insertions, 11 deletions
diff --git a/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch b/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch
index dc49e1206f..c2acdeeca9 100644
--- a/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch
+++ b/target/linux/brcm47xx/patches-2.6.28/500-lzma_initramfs.patch
@@ -1,6 +1,14 @@
---- a/init/initramfs.c
-+++ b/init/initramfs.c
-@@ -475,6 +475,69 @@ static void __init flush_window(void)
+--- a/init/initramfs.c 2009-03-23 22:55:52.000000000 +0100
++++ b/init/initramfs.c 2009-05-01 11:15:46.000000000 +0200
+@@ -7,6 +7,7 @@
+ #include <linux/string.h>
+ #include <linux/syscalls.h>
+ #include <linux/utime.h>
++#include <linux/vmalloc.h>
+
+ static __initdata char *message;
+ static void __init error(char *x)
+@@ -475,6 +476,69 @@
outcnt = 0;
}
@@ -40,13 +48,13 @@
+ workspace_size = ((LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp))) * sizeof(CProb)) + 100;
+ printk( KERN_NOTICE "initramfs: LZMA lc=%d,lp=%d,pb=%d,origSize=%d\n",
+ lc,lp,pb,osize);
-+ outputbuffer = kmalloc(osize, GFP_KERNEL);
++ outputbuffer = vmalloc(osize);
+ if (outputbuffer == 0) {
+ printk(KERN_ERR "initramfs: Couldn't allocate lzma output buffer\n");
+ return -1;
+ }
+
-+ workspace = kmalloc(workspace_size, GFP_KERNEL);
++ workspace = vmalloc(workspace_size);
+ if (workspace == NULL) {
+ printk(KERN_ERR "initramfs: Couldn't allocate lzma workspace\n");
+ return -1;
@@ -61,8 +69,8 @@
+ flush_buffer(outputbuffer, outsizeProcessed);
+ inptr = insize;
+
-+ kfree(outputbuffer);
-+ kfree(workspace);
++ vfree(outputbuffer);
++ vfree(workspace);
+ state = Reset;
+ return 0;
+}
@@ -70,7 +78,7 @@
static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only)
{
int written;
-@@ -509,12 +572,28 @@ static char * __init unpack_to_rootfs(ch
+@@ -509,12 +573,28 @@
inptr = 0;
outcnt = 0; /* bytes in output buffer */
bytes_out = 0;
@@ -104,9 +112,9 @@
buf += inptr;
len -= inptr;
}
---- a/scripts/gen_initramfs_list.sh
-+++ b/scripts/gen_initramfs_list.sh
-@@ -287,7 +287,7 @@ if [ ! -z ${output_file} ]; then
+--- a/scripts/gen_initramfs_list.sh 2009-03-23 22:55:52.000000000 +0100
++++ b/scripts/gen_initramfs_list.sh 2009-05-01 11:12:45.000000000 +0200
+@@ -287,7 +287,7 @@
if [ "${is_cpio_compressed}" = "compressed" ]; then
cat ${cpio_tfile} > ${output_file}
else
65'>265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437