diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 177 | ||||
-rw-r--r-- | init/do_mounts.c | 86 | ||||
-rw-r--r-- | init/do_mounts_md.c | 2 | ||||
-rw-r--r-- | init/do_mounts_rd.c | 4 | ||||
-rw-r--r-- | init/initramfs.c | 14 | ||||
-rw-r--r-- | init/main.c | 4 | ||||
-rw-r--r-- | init/noinitramfs.c | 6 |
7 files changed, 191 insertions, 102 deletions
diff --git a/init/Kconfig b/init/Kconfig index 35518243c4b..526ec1c7456 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -21,6 +21,13 @@ config CONSTRUCTORS depends on !UML default y +config HAVE_IRQ_WORK + bool + +config IRQ_WORK + bool + depends on HAVE_IRQ_WORK + menu "General setup" config EXPERIMENTAL @@ -64,7 +71,7 @@ config BROKEN_ON_SMP config LOCK_KERNEL bool - depends on SMP || PREEMPT + depends on (SMP || PREEMPT) && BKL default y config INIT_ENV_ARG_LIMIT @@ -179,7 +186,7 @@ config KERNEL_LZO depends on HAVE_KERNEL_LZO help Its compression ratio is the poorest among the 4. The kernel - size is about about 10% bigger than gzip; however its speed + size is about 10% bigger than gzip; however its speed (both compression and decompression) is the fastest. endchoice @@ -332,6 +339,8 @@ config AUDIT_TREE depends on AUDITSYSCALL select FSNOTIFY +source "kernel/irq/Kconfig" + menu "RCU Subsystem" choice @@ -562,7 +571,6 @@ if CGROUPS config CGROUP_DEBUG bool "Example debug cgroup subsystem" - depends on CGROUPS default n help This option enables a simple cgroup subsystem that @@ -573,7 +581,6 @@ config CGROUP_DEBUG config CGROUP_NS bool "Namespace cgroup subsystem" - depends on CGROUPS help Provides a simple namespace cgroup subsystem to provide hierarchical naming of sets of namespaces, @@ -582,21 +589,18 @@ config CGROUP_NS config CGROUP_FREEZER bool "Freezer cgroup subsystem" - depends on CGROUPS help Provides a way to freeze and unfreeze all tasks in a cgroup. config CGROUP_DEVICE bool "Device controller for cgroups" - depends on CGROUPS && EXPERIMENTAL help Provides a cgroup implementing whitelists for devices which a process in the cgroup can mknod or open. config CPUSETS bool "Cpuset support" - depends on CGROUPS help This option will let you create and manage CPUSETs which allow dynamically partitioning a system into sets of CPUs and @@ -612,7 +616,6 @@ config PROC_PID_CPUSET config CGROUP_CPUACCT bool "Simple CPU accounting cgroup subsystem" - depends on CGROUPS help Provides a simple Resource Controller for monitoring the total CPU consumed by the tasks in a cgroup. @@ -622,11 +625,10 @@ config RESOURCE_COUNTERS help This option enables controller independent resource accounting infrastructure that works with cgroups. - depends on CGROUPS config CGROUP_MEM_RES_CTLR bool "Memory Resource Controller for Control Groups" - depends on CGROUPS && RESOURCE_COUNTERS + depends on RESOURCE_COUNTERS select MM_OWNER help Provides a memory resource controller that manages both anonymous @@ -664,10 +666,23 @@ config CGROUP_MEM_RES_CTLR_SWAP if boot option "noswapaccount" is set, swap will not be accounted. Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page size is 4096bytes, 512k per 1Gbytes of swap. +config CGROUP_MEM_RES_CTLR_SWAP_ENABLED + bool "Memory Resource Controller Swap Extension enabled by default" + depends on CGROUP_MEM_RES_CTLR_SWAP + default y + help + Memory Resource Controller Swap Extension comes with its price in + a bigger memory consumption. General purpose distribution kernels + which want to enable the feautre but keep it disabled by default + and let the user enable it by swapaccount boot command line + parameter should have this option unselected. + For those who want to have the feature enabled by default should + select this option (if, for some reason, they need to disable it + then noswapaccount does the trick). menuconfig CGROUP_SCHED bool "Group CPU scheduler" - depends on EXPERIMENTAL && CGROUPS + depends on EXPERIMENTAL default n help This feature lets CPU scheduler recognize task groups and control CPU @@ -696,7 +711,7 @@ endif #CGROUP_SCHED config BLK_CGROUP tristate "Block IO controller" - depends on CGROUPS && BLOCK + depends on BLOCK default n ---help--- Generic block IO controller cgroup interface. This is the common @@ -705,11 +720,14 @@ config BLK_CGROUP Currently, CFQ IO scheduler uses it to recognize task groups and control disk bandwidth allocation (proportional time slice allocation) - to such task groups. + to such task groups. It is also used by bio throttling logic in + block layer to implement upper limit in IO rates on a device. This option only enables generic Block IO controller infrastructure. - One needs to also enable actual IO controlling logic in CFQ for it - to take effect. (CONFIG_CFQ_GROUP_IOSCHED=y). + One needs to also enable actual IO controlling logic/policy. For + enabling proportional weight division of disk bandwidth in CFQ seti + CONFIG_CFQ_GROUP_IOSCHED=y and for enabling throttling policy set + CONFIG_BLK_THROTTLE=y. See Documentation/cgroups/blkio-controller.txt for more information. @@ -723,57 +741,7 @@ config DEBUG_BLK_CGROUP endif # CGROUPS -config MM_OWNER - bool - -config SYSFS_DEPRECATED - bool - -config SYSFS_DEPRECATED_V2 - bool "enable deprecated sysfs features to support old userspace tools" - depends on SYSFS - default n - select SYSFS_DEPRECATED - help - This option switches the layout of sysfs to the deprecated - version. Do not use it on recent distributions. - - The current sysfs layout features a unified device tree at - /sys/devices/, which is able to express a hierarchy between - class devices. If the deprecated option is set to Y, the - unified device tree is split into a bus device tree at - /sys/devices/ and several individual class device trees at - /sys/class/. The class and bus devices will be connected by - "<subsystem>:<name>" and the "device" links. The "block" - class devices, will not show up in /sys/class/block/. Some - subsystems will suppress the creation of some devices which - depend on the unified device tree. - - This option is not a pure compatibility option that can - be safely enabled on newer distributions. It will change the - layout of sysfs to the non-extensible deprecated version, - and disable some features, which can not be exported without - confusing older userspace tools. Since 2007/2008 all major - distributions do not enable this option, and ship no tools which - depend on the deprecated layout or this option. - - If you are using a new kernel on an older distribution, or use - older userspace tools, you might need to say Y here. Do not say Y, - if the original kernel, that came with your distribution, has - this option set to N. - -config RELAY - bool "Kernel->user space relay support (formerly relayfs)" - help - This option enables support for relay interface support in - certain file systems (such as debugfs). - It is designed to provide an efficient mechanism for tools and - facilities to relay large amounts of data from kernel space to - user space. - - If unsure, say N. - -config NAMESPACES +menuconfig NAMESPACES bool "Namespaces support" if EMBEDDED default !EMBEDDED help @@ -782,48 +750,102 @@ config NAMESPACES or same user id or pid may refer to different tasks when used in different namespaces. +if NAMESPACES + config UTS_NS bool "UTS namespace" - depends on NAMESPACES + default y help In this namespace tasks see different info provided with the uname() system call config IPC_NS bool "IPC namespace" - depends on NAMESPACES && (SYSVIPC || POSIX_MQUEUE) + depends on (SYSVIPC || POSIX_MQUEUE) + default y help In this namespace tasks work with IPC ids which correspond to different IPC objects in different namespaces. config USER_NS bool "User namespace (EXPERIMENTAL)" - depends on NAMESPACES && EXPERIMENTAL + depends on EXPERIMENTAL + default y help This allows containers, i.e. vservers, to use user namespaces to provide different user info for different servers. If unsure, say N. config PID_NS - bool "PID Namespaces (EXPERIMENTAL)" - default n - depends on NAMESPACES && EXPERIMENTAL + bool "PID Namespaces" + default y help Support process id namespaces. This allows having multiple processes with the same pid as long as they are in different pid namespaces. This is a building block of containers. - Unless you want to work with an experimental feature - say N here. - config NET_NS bool "Network namespace" - default n - depends on NAMESPACES && EXPERIMENTAL && NET + depends on NET + default y help Allow user space to create what appear to be multiple instances of the network stack. +endif # NAMESPACES + +config MM_OWNER + bool + +config SYSFS_DEPRECATED + bool "enable deprecated sysfs features to support old userspace tools" + depends on SYSFS + default n + help + This option adds code that switches the layout of the "block" class + devices, to not show up in /sys/class/block/, but only in + /sys/block/. + + This switch is only active when the sysfs.deprecated=1 boot option is + passed or the SYSFS_DEPRECATED_V2 option is set. + + This option allows new kernels to run on old distributions and tools, + which might get confused by /sys/class/block/. Since 2007/2008 all + major distributions and tools handle this just fine. + + Recent distributions and userspace tools after 2009/2010 depend on + the existence of /sys/class/block/, and will not work with this + option enabled. + + Only if you are using a new kernel on an old distribution, you might + need to say Y here. + +config SYSFS_DEPRECATED_V2 + bool "enabled deprecated sysfs features by default" + default n + depends on SYSFS + depends on SYSFS_DEPRECATED + help + Enable deprecated sysfs by default. + + See the CONFIG_SYSFS_DEPRECATED option for more details about this + option. + + Only if you are using a new kernel on an old distribution, you might + need to say Y here. Even then, odds are you would not need it + enabled, you can always pass the boot option if absolutely necessary. + +config RELAY + bool "Kernel->user space relay support (formerly relayfs)" + help + This option enables support for relay interface support in + certain file systems (such as debugfs). + It is designed to provide an efficient mechanism for tools and + facilities to relay large amounts of data from kernel space to + user space. + + If unsure, say N. + config BLK_DEV_INITRD bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" depends on BROKEN || !FRV @@ -1058,6 +1080,7 @@ config PERF_EVENTS default y if (PROFILING || PERF_COUNTERS) depends on HAVE_PERF_EVENTS select ANON_INODES + select IRQ_WORK help Enable kernel support for various performance events provided by software and hardware. diff --git a/init/do_mounts.c b/init/do_mounts.c index 02e3ca4fc52..830aaec9c7d 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -58,6 +58,62 @@ static int __init readwrite(char *str) __setup("ro", readonly); __setup("rw", readwrite); +#ifdef CONFIG_BLOCK +/** + * match_dev_by_uuid - callback for finding a partition using its uuid + * @dev: device passed in by the caller + * @data: opaque pointer to a 36 byte char array with a UUID + * + * Returns 1 if the device matches, and 0 otherwise. + */ +static int match_dev_by_uuid(struct device *dev, void *data) +{ + u8 *uuid = data; + struct hd_struct *part = dev_to_part(dev); + + if (!part->info) + goto no_match; + + if (memcmp(uuid, part->info->uuid, sizeof(part->info->uuid))) + goto no_match; + + return 1; +no_match: + return 0; +} + + +/** + * devt_from_partuuid - looks up the dev_t of a partition by its UUID + * @uuid: 36 byte char array containing a hex ascii UUID + * + * The function will return the first partition which contains a matching + * UUID value in its partition_meta_info struct. This does not search + * by filesystem UUIDs. + * + * Returns the matching dev_t on success or 0 on failure. + */ +static dev_t __init devt_from_partuuid(char *uuid_str) +{ + dev_t res = 0; + struct device *dev = NULL; + u8 uuid[16]; + + /* Pack the requested UUID in the expected format. */ + part_pack_uuid(uuid_str, uuid); + + dev = class_find_device(&block_class, NULL, uuid, &match_dev_by_uuid); + if (!dev) + goto done; + + res = dev->devt; + put_device(dev); + +done: + return res; +} +#endif + /* * Convert a name into device number. We accept the following variants: * @@ -68,6 +124,8 @@ __setup("rw", readwrite); * of partition - device number of disk plus the partition number * 5) /dev/<disk_name>p<decimal> - same as the above, that form is * used when disk name of partitioned disk ends on a digit. + * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the + * unique id of a partition if the partition table provides it. * * If name doesn't have fall into the categories above, we return (0,0). * block_class is used to check if something is a disk name. If the disk @@ -82,6 +140,18 @@ dev_t name_to_dev_t(char *name) dev_t res = 0; int part; +#ifdef CONFIG_BLOCK + if (strncmp(name, "PARTUUID=", 9) == 0) { + name += 9; + if (strlen(name) != 36) + goto fail; + res = devt_from_partuuid(name); + if (!res) + goto fail; + goto done; + } +#endif + if (strncmp(name, "/dev/", 5) != 0) { unsigned maj, min; @@ -221,7 +291,7 @@ static int __init do_mount_root(char *name, char *fs, int flags, void *data) if (err) return err; - sys_chdir("/root"); + sys_chdir((const char __user __force *)"/root"); ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; printk("VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", current->fs->pwd.mnt->mnt_sb->s_type->name, @@ -291,13 +361,13 @@ out: #ifdef CONFIG_ROOT_NFS static int __init mount_nfs_root(void) { - void *data = nfs_root_data(); + char *root_dev, *root_data; - create_dev("/dev/root", ROOT_DEV); - if (data && - do_mount_root("/dev/root", "nfs", root_mountflags, data) == 0) - return 1; - return 0; + if (nfs_root_data(&root_dev, &root_data) != 0) + return 0; + if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0) + return 0; + return 1; } #endif @@ -418,5 +488,5 @@ void __init prepare_namespace(void) out: devtmpfs_mount("dev"); sys_mount(".", "/", NULL, MS_MOVE, NULL); - sys_chroot("."); + sys_chroot((const char __user __force *)"."); } diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c index 69aebbf8fd2..32c4799b8c9 100644 --- a/init/do_mounts_md.c +++ b/init/do_mounts_md.c @@ -283,7 +283,7 @@ static void __init autodetect_raid(void) wait_for_device_probe(); - fd = sys_open("/dev/md0", 0, 0); + fd = sys_open((const char __user __force *) "/dev/md0", 0, 0); if (fd >= 0) { sys_ioctl(fd, RAID_AUTORUN, raid_autopart); sys_close(fd); diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index bf3ef667bf3..6e1ee6987c7 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c @@ -168,7 +168,7 @@ int __init rd_load_image(char *from) char rotator[4] = { '|' , '/' , '-' , '\\' }; #endif - out_fd = sys_open("/dev/ram", O_RDWR, 0); + out_fd = sys_open((const char __user __force *) "/dev/ram", O_RDWR, 0); if (out_fd < 0) goto out; @@ -267,7 +267,7 @@ noclose_input: sys_close(out_fd); out: kfree(buf); - sys_unlink("/dev/ram"); + sys_unlink((const char __user __force *) "/dev/ram"); return res; } diff --git a/init/initramfs.c b/init/initramfs.c index 4b9c2020509..2531811d42c 100644 --- a/init/initramfs.c +++ b/init/initramfs.c @@ -483,7 +483,8 @@ static int __init retain_initrd_param(char *str) } __setup("retain_initrd", retain_initrd_param); -extern char __initramfs_start[], __initramfs_end[]; +extern char __initramfs_start[]; +extern unsigned long __initramfs_size; #include <linux/initrd.h> #include <linux/kexec.h> @@ -528,7 +529,7 @@ static void __init clean_rootfs(void) struct linux_dirent64 *dirp; int num; - fd = sys_open("/", O_RDONLY, 0); + fd = sys_open((const char __user __force *) "/", O_RDONLY, 0); WARN_ON(fd < 0); if (fd < 0) return; @@ -570,8 +571,7 @@ static void __init clean_rootfs(void) static int __init populate_rootfs(void) { - char *err = unpack_to_rootfs(__initramfs_start, - __initramfs_end - __initramfs_start); + char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size); if (err) panic(err); /* Failed to decompress INTERNAL initramfs */ if (initrd_start) { @@ -585,12 +585,12 @@ static int __init populate_rootfs(void) return 0; } else { clean_rootfs(); - unpack_to_rootfs(__initramfs_start, - __initramfs_end - __initramfs_start); + unpack_to_rootfs(__initramfs_start, __initramfs_size); } printk(KERN_INFO "rootfs image is not initramfs (%s)" "; looks like an initrd\n", err); - fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); + fd = sys_open((const char __user __force *) "/initrd.image", + O_WRONLY|O_CREAT, 0700); if (fd >= 0) { sys_write(fd, (char *)initrd_start, initrd_end - initrd_start); diff --git a/init/main.c b/init/main.c index 94ab488039a..8646401f7a0 100644 --- a/init/main.c +++ b/init/main.c @@ -20,7 +20,6 @@ #include <linux/delay.h> #include <linux/ioport.h> #include <linux/init.h> -#include <linux/smp_lock.h> #include <linux/initrd.h> #include <linux/bootmem.h> #include <linux/acpi.h> @@ -424,7 +423,6 @@ static void __init setup_command_line(char *command_line) static __initdata DECLARE_COMPLETION(kthreadd_done); static noinline void __init_refok rest_init(void) - __releases(kernel_lock) { int pid; @@ -556,7 +554,6 @@ asmlinkage void __init start_kernel(void) local_irq_disable(); early_boot_irqs_off(); - early_init_irq_lock_class(); /* * Interrupts are still disabled. Do necessary setups, then @@ -819,7 +816,6 @@ static void run_init_process(const char *init_filename) * makes it inline to init() and it becomes part of init.text section */ static noinline int init_post(void) - __releases(kernel_lock) { /* need to finish all async __init code before freeing the memory */ async_synchronize_full(); diff --git a/init/noinitramfs.c b/init/noinitramfs.c index f4c1a3a1b8c..267739d8517 100644 --- a/init/noinitramfs.c +++ b/init/noinitramfs.c @@ -29,17 +29,17 @@ static int __init default_rootfs(void) { int err; - err = sys_mkdir("/dev", 0755); + err = sys_mkdir((const char __user __force *) "/dev", 0755); if (err < 0) goto out; - err = sys_mknod((const char __user *) "/dev/console", + err = sys_mknod((const char __user __force *) "/dev/console", S_IFCHR | S_IRUSR | S_IWUSR, new_encode_dev(MKDEV(5, 1))); if (err < 0) goto out; - err = sys_mkdir("/root", 0700); + err = sys_mkdir((const char __user __force *) "/root", 0700); if (err < 0) goto out; |