summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* init: add an init_stat helperChristoph Hellwig2020-07-314-2/+20
| | | | | | | Add a simple helper to stat with a kernel space file name and switch the early init code over to it. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_mknod helperChristoph Hellwig2020-07-318-16/+30
| | | | | | | Add a simple helper to mknod with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_mknod. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_mkdir helperChristoph Hellwig2020-07-318-13/+25
| | | | | | | Add a simple helper to mkdir with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_mkdir. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_symlink helperChristoph Hellwig2020-07-316-13/+19
| | | | | | | Add a simple helper to symlink with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_symlink. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_link helperChristoph Hellwig2020-07-316-14/+38
| | | | | | | Add a simple helper to link with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_link. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_eaccess helperChristoph Hellwig2020-07-315-10/+17
| | | | | | | | | Add a simple helper to check if a file exists based on kernel space file name and switch the early init code over to it. Note that this theoretically changes behavior as it always is based on the effective permissions. But during early init that doesn't make a difference. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_chmod helperChristoph Hellwig2020-07-316-12/+19
| | | | | | | Add a simple helper to chmod with a kernel space file name and switch the early init code over to it. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_chown helperChristoph Hellwig2020-07-315-5/+24
| | | | | | | Add a simple helper to chown with a kernel space file name and switch the early init code over to it. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_chroot helperChristoph Hellwig2020-07-317-12/+30
| | | | | | | Add a simple helper to chroot with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_chroot. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_chdir helperChristoph Hellwig2020-07-317-13/+24
| | | | | | | Add a simple helper to chdir with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_chdir. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_rmdir helperChristoph Hellwig2020-07-314-8/+7
| | | | | | | Add a simple helper to rmdir with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_rmdir. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_unlink helperChristoph Hellwig2020-07-317-12/+12
| | | | | | | Add a simple helper to unlink with a kernel space file name and switch the early init code over to it. Remove the now unused ksys_unlink. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_umount helperChristoph Hellwig2020-07-316-4/+19
| | | | | | | | Like ksys_umount, but takes a kernel pointer for the destination path. Switch over the umount in the init code, which just happen to work due to the implicit set_fs(KERNEL_DS) during early init right now. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: add an init_mount helperChristoph Hellwig2020-07-319-11/+46
| | | | | | | | | Like do_mount, but takes a kernel pointer for the destination path. Switch over the mounts in the init code and devtmpfs to it, which just happen to work due to the implicit set_fs(KERNEL_DS) during early init right now. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: mark create_dev as __initChristoph Hellwig2020-07-311-1/+1
| | | | | | This helper is only used for the early init code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: mark console_on_rootfs as __initChristoph Hellwig2020-07-311-1/+1
| | | | | | This helper is only used for the early init code. Signed-off-by: Christoph Hellwig <hch@lst.de>
* init: initialize ramdisk_execute_command at compile timeChristoph Hellwig2020-07-311-5/+1
| | | | | | | | Set ramdisk_execute_command to "/init" at compile time. The command line can still override it, but this saves a few instructions and removes a NULL check. Signed-off-by: Christoph Hellwig <hch@lst.de>
* devtmpfs: refactor devtmpfsd()Christoph Hellwig2020-07-311-21/+31
| | | | | | | | | Split the main worker loop into a separate function. This allows devtmpfsd_setup to be marked __init, which will allows us to call __init routines for the setup work. devtmpfѕ itself needs a __ref marker for that to work, and a comment explaining why it works. Signed-off-by: Christoph Hellwig <hch@lst.de>
* fs: push the getname from do_rmdir into the callersChristoph Hellwig2020-07-313-9/+7
| | | | | | | This mirrors do_unlinkat and will make life a little easier for the init code to reuse the whole function with a kernel filename. Signed-off-by: Christoph Hellwig <hch@lst.de>
* fs: refactor ksys_umountChristoph Hellwig2020-07-311-22/+18
| | | | | | | | | Factor out a path_umount helper that takes a struct path * instead of the actual file name. This will allow to convert the init and devtmpfs code to properly mount based on a kernel pointer instead of relying on the implicit set_fs(KERNEL_DS) during early init. Signed-off-by: Christoph Hellwig <hch@lst.de>
* fs: refactor do_mountChristoph Hellwig2020-07-311-32/+35
| | | | | | | | | Factor out a path_mount helper that takes a struct path * instead of the actual file name. This will allow to convert the init and devtmpfs code to properly mount based on a kernel pointer instead of relying on the implicit set_fs(KERNEL_DS) during early init. Signed-off-by: Christoph Hellwig <hch@lst.de>
* initramfs: use vfs_utimes in do_copyChristoph Hellwig2020-07-311-4/+6
| | | | | | | | Don't bother saving away the pathname and just use the new struct path based utimes helper instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: expose utimes_commonChristoph Hellwig2020-07-312-3/+4
| | | | | | | | Rename utimes_common to vfs_utimes and make it available outside of utimes.c. This will be used by the initramfs unpacking code. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: move timespec validation into utimes_commonChristoph Hellwig2020-07-311-10/+9
| | | | | | | | | | Consolidate the validation of the timespec from the two callers into utimes_common. That means it is done a little later (e.g. after the path lookup), but I can't find anything that requires a specific order of processing the errors. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: refactor do_utimesChristoph Hellwig2020-07-311-46/+54
| | | | | | | Split out one helper each for path vs fd based operations. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: remove ksys_ioctlChristoph Hellwig2020-07-312-7/+1
| | | | | | | Fold it into the only remaining caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: remove ksys_fchmodChristoph Hellwig2020-07-312-7/+1
| | | | | | | Fold it into the only remaining caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: remove ksys_dupChristoph Hellwig2020-07-312-7/+1
| | | | | | | Fold it into the only remaining caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: remove ksys_openChristoph Hellwig2020-07-312-14/+8
| | | | | | | Just open code it in the two callers. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: remove ksys_getdents64Christoph Hellwig2020-07-312-11/+2
| | | | | | | Just open code it in the only caller. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* init: open code setting up stdin/stdout/stderrChristoph Hellwig2020-07-311-6/+10
| | | | | | | | | Don't rely on the implicit set_fs(KERNEL_DS) for ksys_open to work, but instead open a struct file for /dev/console and then install it as FD 0/1/2 manually. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initramfs: switch initramfs unpacking to struct file based APIsChristoph Hellwig2020-07-311-21/+26
| | | | | | | | | There is no good reason to mess with file descriptors from in-kernel code, switch the initramfs unpacking to struct file based write instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initramfs: remove clean_rootfsChristoph Hellwig2020-07-301-48/+1
| | | | | | | | | | | There is no point in trying to clean up after unpacking the initramfs failed, as it should never get past the magic number check. In addition the current code only removes file that are direct children of the root entry, which wasn't complete anyway Fixes: df52092f3c97 ("fastboot: remove duplicate unpack_to_rootfs()") Reported-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
* initramfs: remove the populate_initrd_image and clean_rootfs stubsChristoph Hellwig2020-07-301-11/+4
| | | | | | | | If initrd support is not enable just print the warning directly instead of hiding the fact that we just failed behind two stub functions. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initrd: mark initrd support as deprecatedChristoph Hellwig2020-07-301-0/+2
| | | | | | | | | | | The classic initial ramdisk has been replaced by the much more flexible and efficient initramfs a long time. Warn about it being removed soon. Includes a spelling fix from Colin Ian King <colin.king@canonical.com>. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initrd: mark init_linuxrc as __initChristoph Hellwig2020-07-301-1/+1
| | | | | Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initrd: switch initrd loading to struct file based APIsChristoph Hellwig2020-07-303-42/+40
| | | | | | | | | | | | | There is no good reason to mess with file descriptors from in-kernel code, switch the initrd loading to struct file based read and writes instead. Also Pass an explicit offset instead of ->f_pos, and to make that easier, use file scope file structs and offsets everywhere except for identify_ramdisk_image instead of the current strange mix. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initrd: remove the BLKFLSBUF call in handle_initrdChristoph Hellwig2020-07-301-9/+0
| | | | | | | | | | | BLKFLSBUF used to be overloaded for the ramdisk driver to free the whole ramdisk, which was completely different behavior compared to all other drivers. But this magic overload got removed in commit ff26956875c2 ("brd: remove support for BLKFLSBUF"), so this call is entirely pointless now. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* initrd: remove support for multiple floppiesChristoph Hellwig2020-07-309-94/+12
| | | | | | | | | | | Remove the special handling for multiple floppies in the initrd code. No one should be using floppies for booting these days. (famous last words..) Includes a spelling fix from Colin Ian King <colin.king@canonical.com>. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: rewrite md_setup_drive to avoid ioctlsChristoph Hellwig2020-07-163-85/+81
| | | | | | | | | | | | md_setup_drive knows it works with md devices, so it is rather pointless to open a file descriptor and issue ioctls. Just call directly into the relevant low-level md routines after getting a handle to the device using blkdev_get_by_dev instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: NeilBrown <neilb@suse.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: simplify md_setup_driveChristoph Hellwig2020-07-161-102/+101
| | | | | | | | | | Move the loop over the possible arrays into the caller to remove a level of indentation for the whole function. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: NeilBrown <neilb@suse.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: remove the kernel version of md_u.hChristoph Hellwig2020-07-162-13/+1
| | | | | | | | mdp_major can just move to drivers/md/md.h. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: remove the autoscan partition re-readChristoph Hellwig2020-07-161-10/+0
| | | | | | | | | devfs is long gone, and autoscan works just fine without this these days. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: NeilBrown <neilb@suse.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: replace the RAID_AUTORUN ioctl with a direct function callChristoph Hellwig2020-07-163-21/+6
| | | | | | | | | | | Instead of using a spcial RAID_AUTORUN ioctl that only exists for non-modular builds and is only called from the early init code, just call the actual function directly. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: NeilBrown <neilb@suse.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* md: move the early init autodetect code to drivers/md/Christoph Hellwig2020-07-166-13/+25
| | | | | | | | | Just like the NFS and CIFS root code this better lives with the driver it is tightly integrated with. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* init: remove the bstat helperChristoph Hellwig2020-07-162-14/+4
| | | | | | | | | | The only caller of the bstat function becomes cleaner and simpler when open coding the function. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: NeilBrown <neilb@suse.de> Acked-by: Song Liu <song@kernel.org> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: add a vfs_fchmod helperChristoph Hellwig2020-07-162-2/+8
| | | | | | | | Add a helper for struct file based chmode operations. To be used by the initramfs code soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* fs: add a vfs_fchown helperChristoph Hellwig2020-07-162-12/+19
| | | | | | | | Add a helper for struct file based chown operations. To be used by the initramfs code soon. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge tag 'clk-fixes-for-linus' of ↵Linus Torvalds2020-07-163-8/+43
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux into master Pull clk fixes from Stephen Boyd: "A couple build fixes for issues exposed this merge window and a fix for the eMMC clk on AST2600 SoCs that fixes the rate that is calculated by the clk framework" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: Specify IOMEM dependency for HSDK pll driver clk: AST2600: Add mux for EMMC clock clk: mvebu: ARMADA_AP_CPU_CLK needs to select ARMADA_AP_CP_HELPER
| * clk: Specify IOMEM dependency for HSDK pll driverDavid Gow2020-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The HSDK pll driver uses the devm_ioremap_resource function, but does not specify a dependency on IOMEM in Kconfig. This causes a build failure on architectures without IOMEM, for example, UML (notably with make allyesconfig). Fix this by making CONFIG_CLK_HSDK depend on CONFIG_IOMEM. Signed-off-by: David Gow <davidgow@google.com> Link: https://lore.kernel.org/r/20200630043214.1080961-1-davidgow@google.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>