Skip to content

Commit e1ec517

Browse files
committed
Merge branch 'hch.init_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull init and set_fs() cleanups from Al Viro: "Christoph's 'getting rid of ksys_...() uses under KERNEL_DS' series" * 'hch.init_path' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (50 commits) init: add an init_dup helper init: add an init_utimes helper init: add an init_stat helper init: add an init_mknod helper init: add an init_mkdir helper init: add an init_symlink helper init: add an init_link helper init: add an init_eaccess helper init: add an init_chmod helper init: add an init_chown helper init: add an init_chroot helper init: add an init_chdir helper init: add an init_rmdir helper init: add an init_unlink helper init: add an init_umount helper init: add an init_mount helper init: mark create_dev as __init init: mark console_on_rootfs as __init init: initialize ramdisk_execute_command at compile time devtmpfs: refactor devtmpfsd() ...
2 parents 19b39c3 + f073531 commit e1ec517

35 files changed

+796
-768
lines changed

arch/arm/kernel/atags_parse.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ __tagtable(ATAG_VIDEOTEXT, parse_tag_videotext);
9191
static int __init parse_tag_ramdisk(const struct tag *tag)
9292
{
9393
rd_image_start = tag->u.ramdisk.start;
94-
rd_doload = (tag->u.ramdisk.flags & 1) == 0;
95-
rd_prompt = (tag->u.ramdisk.flags & 2) == 0;
9694

9795
if (tag->u.ramdisk.size)
9896
rd_size = tag->u.ramdisk.size;

arch/sh/kernel/setup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ void __init setup_arch(char **cmdline_p)
290290

291291
#ifdef CONFIG_BLK_DEV_RAM
292292
rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
293-
rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
294-
rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
295293
#endif
296294

297295
if (!MOUNT_ROOT_RDONLY)

arch/sparc/kernel/setup_32.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ void __init setup_arch(char **cmdline_p)
353353
ROOT_DEV = old_decode_dev(root_dev);
354354
#ifdef CONFIG_BLK_DEV_RAM
355355
rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
356-
rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0);
357-
rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0);
358356
#endif
359357

360358
prom_setsync(prom_sync_me);

arch/sparc/kernel/setup_64.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,6 @@ void __init setup_arch(char **cmdline_p)
659659
ROOT_DEV = old_decode_dev(root_dev);
660660
#ifdef CONFIG_BLK_DEV_RAM
661661
rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
662-
rd_prompt = ((ram_flags & RAMDISK_PROMPT_FLAG) != 0);
663-
rd_doload = ((ram_flags & RAMDISK_LOAD_FLAG) != 0);
664662
#endif
665663

666664
task_thread_info(&init_task)->kregs = &fake_swapper_regs;

arch/x86/kernel/setup.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,8 +870,6 @@ void __init setup_arch(char **cmdline_p)
870870

871871
#ifdef CONFIG_BLK_DEV_RAM
872872
rd_image_start = boot_params.hdr.ram_size & RAMDISK_IMAGE_START_MASK;
873-
rd_prompt = ((boot_params.hdr.ram_size & RAMDISK_PROMPT_FLAG) != 0);
874-
rd_doload = ((boot_params.hdr.ram_size & RAMDISK_LOAD_FLAG) != 0);
875873
#endif
876874
#ifdef CONFIG_EFI
877875
if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,

drivers/base/devtmpfs.c

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/sched.h>
2626
#include <linux/slab.h>
2727
#include <linux/kthread.h>
28+
#include <linux/init_syscalls.h>
2829
#include <uapi/linux/mount.h>
2930
#include "base.h"
3031

@@ -359,7 +360,7 @@ int __init devtmpfs_mount(void)
359360
if (!thread)
360361
return 0;
361362

362-
err = do_mount("devtmpfs", "dev", "devtmpfs", MS_SILENT, NULL);
363+
err = init_mount("devtmpfs", "dev", "devtmpfs", MS_SILENT, NULL);
363364
if (err)
364365
printk(KERN_INFO "devtmpfs: error mounting %i\n", err);
365366
else
@@ -378,30 +379,8 @@ static int handle(const char *name, umode_t mode, kuid_t uid, kgid_t gid,
378379
return handle_remove(name, dev);
379380
}
380381

381-
static int devtmpfs_setup(void *p)
382+
static void __noreturn devtmpfs_work_loop(void)
382383
{
383-
int err;
384-
385-
err = ksys_unshare(CLONE_NEWNS);
386-
if (err)
387-
goto out;
388-
err = do_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
389-
if (err)
390-
goto out;
391-
ksys_chdir("/.."); /* will traverse into overmounted root */
392-
ksys_chroot(".");
393-
out:
394-
*(int *)p = err;
395-
complete(&setup_done);
396-
return err;
397-
}
398-
399-
static int devtmpfsd(void *p)
400-
{
401-
int err = devtmpfs_setup(p);
402-
403-
if (err)
404-
return err;
405384
while (1) {
406385
spin_lock(&req_lock);
407386
while (requests) {
@@ -421,6 +400,38 @@ static int devtmpfsd(void *p)
421400
spin_unlock(&req_lock);
422401
schedule();
423402
}
403+
}
404+
405+
static int __init devtmpfs_setup(void *p)
406+
{
407+
int err;
408+
409+
err = ksys_unshare(CLONE_NEWNS);
410+
if (err)
411+
goto out;
412+
err = init_mount("devtmpfs", "/", "devtmpfs", MS_SILENT, NULL);
413+
if (err)
414+
goto out;
415+
init_chdir("/.."); /* will traverse into overmounted root */
416+
init_chroot(".");
417+
out:
418+
*(int *)p = err;
419+
complete(&setup_done);
420+
return err;
421+
}
422+
423+
/*
424+
* The __ref is because devtmpfs_setup needs to be __init for the routines it
425+
* calls. That call is done while devtmpfs_init, which is marked __init,
426+
* synchronously waits for it to complete.
427+
*/
428+
static int __ref devtmpfsd(void *p)
429+
{
430+
int err = devtmpfs_setup(p);
431+
432+
if (err)
433+
return err;
434+
devtmpfs_work_loop();
424435
return 0;
425436
}
426437

drivers/md/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ obj-$(CONFIG_MD_FAULTY) += faulty.o
4343
obj-$(CONFIG_MD_CLUSTER) += md-cluster.o
4444
obj-$(CONFIG_BCACHE) += bcache/
4545
obj-$(CONFIG_BLK_DEV_MD) += md-mod.o
46+
ifeq ($(CONFIG_BLK_DEV_MD),y)
47+
obj-y += md-autodetect.o
48+
endif
4649
obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o
4750
obj-$(CONFIG_BLK_DEV_DM_BUILTIN) += dm-builtin.o
4851
obj-$(CONFIG_DM_UNSTRIPED) += dm-unstripe.o

0 commit comments

Comments
 (0)