Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async-for-30

* git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async-for-30:
fastboot: remove duplicate unpack_to_rootfs()
ide/net: flip the order of SATA and network init
async: remove the temporary (2.6.29) "async is off by default" code

Fix up conflicts in init/initramfs.c manually

+64 -30
+3 -2
drivers/Makefile
··· 36 36 37 37 obj-y += serial/ 38 38 obj-$(CONFIG_PARPORT) += parport/ 39 - obj-y += base/ block/ misc/ mfd/ net/ media/ 39 + obj-y += base/ block/ misc/ mfd/ media/ 40 40 obj-$(CONFIG_NUBUS) += nubus/ 41 - obj-$(CONFIG_ATM) += atm/ 42 41 obj-y += macintosh/ 43 42 obj-$(CONFIG_IDE) += ide/ 44 43 obj-$(CONFIG_SCSI) += scsi/ 45 44 obj-$(CONFIG_ATA) += ata/ 45 + obj-y += net/ 46 + obj-$(CONFIG_ATM) += atm/ 46 47 obj-$(CONFIG_FUSION) += message/ 47 48 obj-$(CONFIG_FIREWIRE) += firewire/ 48 49 obj-y += ieee1394/
+56 -15
init/initramfs.c
··· 5 5 #include <linux/fcntl.h> 6 6 #include <linux/delay.h> 7 7 #include <linux/string.h> 8 + #include <linux/dirent.h> 8 9 #include <linux/syscalls.h> 9 10 #include <linux/utime.h> 10 11 ··· 167 166 static __initdata unsigned count; 168 167 static __initdata loff_t this_header, next_header; 169 168 170 - static __initdata int dry_run; 171 - 172 169 static inline void __init eat(unsigned n) 173 170 { 174 171 victim += n; ··· 228 229 parse_header(collected); 229 230 next_header = this_header + N_ALIGN(name_len) + body_len; 230 231 next_header = (next_header + 3) & ~3; 231 - if (dry_run) { 232 - read_into(name_buf, N_ALIGN(name_len), GotName); 233 - return 0; 234 - } 235 232 state = SkipIt; 236 233 if (name_len <= 0 || name_len > PATH_MAX) 237 234 return 0; ··· 298 303 free_hash(); 299 304 return 0; 300 305 } 301 - if (dry_run) 302 - return 0; 303 306 clean_path(collected, mode); 304 307 if (S_ISREG(mode)) { 305 308 int ml = maybe_link(); ··· 410 417 411 418 #include <linux/decompress/generic.h> 412 419 413 - static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) 420 + static char * __init unpack_to_rootfs(char *buf, unsigned len) 414 421 { 415 422 int written; 416 423 decompress_fn decompress; 417 424 const char *compress_name; 418 425 static __initdata char msg_buf[64]; 419 426 420 - dry_run = check_only; 421 427 header_buf = kmalloc(110, GFP_KERNEL); 422 428 symlink_buf = kmalloc(PATH_MAX + N_ALIGN(PATH_MAX) + 1, GFP_KERNEL); 423 429 name_buf = kmalloc(N_ALIGN(PATH_MAX), GFP_KERNEL); ··· 515 523 initrd_end = 0; 516 524 } 517 525 526 + #define BUF_SIZE 1024 527 + static void __init clean_rootfs(void) 528 + { 529 + int fd; 530 + void *buf; 531 + struct linux_dirent64 *dirp; 532 + int count; 533 + 534 + fd = sys_open("/", O_RDONLY, 0); 535 + WARN_ON(fd < 0); 536 + if (fd < 0) 537 + return; 538 + buf = kzalloc(BUF_SIZE, GFP_KERNEL); 539 + WARN_ON(!buf); 540 + if (!buf) { 541 + sys_close(fd); 542 + return; 543 + } 544 + 545 + dirp = buf; 546 + count = sys_getdents64(fd, dirp, BUF_SIZE); 547 + while (count > 0) { 548 + while (count > 0) { 549 + struct stat st; 550 + int ret; 551 + 552 + ret = sys_newlstat(dirp->d_name, &st); 553 + WARN_ON_ONCE(ret); 554 + if (!ret) { 555 + if (S_ISDIR(st.st_mode)) 556 + sys_rmdir(dirp->d_name); 557 + else 558 + sys_unlink(dirp->d_name); 559 + } 560 + 561 + count -= dirp->d_reclen; 562 + dirp = (void *)dirp + dirp->d_reclen; 563 + } 564 + dirp = buf; 565 + memset(buf, 0, BUF_SIZE); 566 + count = sys_getdents64(fd, dirp, BUF_SIZE); 567 + } 568 + 569 + sys_close(fd); 570 + kfree(buf); 571 + } 572 + 518 573 static int __init populate_rootfs(void) 519 574 { 520 575 char *err = unpack_to_rootfs(__initramfs_start, 521 - __initramfs_end - __initramfs_start, 0); 576 + __initramfs_end - __initramfs_start); 522 577 if (err) 523 578 panic(err); /* Failed to decompress INTERNAL initramfs */ 524 579 if (initrd_start) { ··· 573 534 int fd; 574 535 printk(KERN_INFO "checking if image is initramfs..."); 575 536 err = unpack_to_rootfs((char *)initrd_start, 576 - initrd_end - initrd_start, 1); 537 + initrd_end - initrd_start); 577 538 if (!err) { 578 539 printk(" it is\n"); 579 - unpack_to_rootfs((char *)initrd_start, 580 - initrd_end - initrd_start, 0); 581 540 free_initrd(); 582 541 return 0; 542 + } else { 543 + clean_rootfs(); 544 + unpack_to_rootfs(__initramfs_start, 545 + __initramfs_end - __initramfs_start); 583 546 } 584 547 printk("it isn't (%s); looks like an initrd\n", err); 585 548 fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); ··· 594 553 #else 595 554 printk(KERN_INFO "Unpacking initramfs..."); 596 555 err = unpack_to_rootfs((char *)initrd_start, 597 - initrd_end - initrd_start, 0); 556 + initrd_end - initrd_start); 598 557 if (err) { 599 558 printk(" failed!\n"); 600 559 printk(KERN_EMERG "%s\n", err);
+5 -13
kernel/async.c
··· 49 49 */ 50 50 51 51 #include <linux/async.h> 52 + #include <linux/bug.h> 52 53 #include <linux/module.h> 53 54 #include <linux/wait.h> 54 55 #include <linux/sched.h> ··· 388 387 389 388 static int __init async_init(void) 390 389 { 391 - if (async_enabled) 392 - if (IS_ERR(kthread_run(async_manager_thread, NULL, 393 - "async/mgr"))) 394 - async_enabled = 0; 390 + async_enabled = 391 + !IS_ERR(kthread_run(async_manager_thread, NULL, "async/mgr")); 392 + 393 + WARN_ON(!async_enabled); 395 394 return 0; 396 395 } 397 - 398 - static int __init setup_async(char *str) 399 - { 400 - async_enabled = 1; 401 - return 1; 402 - } 403 - 404 - __setup("fastboot", setup_async); 405 - 406 396 407 397 core_initcall(async_init);