mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-01 00:58:39 +02:00 
			
		
		
		
	 c60166f042
			
		
	
	
		c60166f042
		
	
	
	
	
		
			
			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>
		
			
				
	
	
		
			25 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
	
		
			667 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| /*
 | |
|  * Routines that mimic syscalls, but don't use the user address space or file
 | |
|  * descriptors.  Only for init/ and related early init code.
 | |
|  */
 | |
| #include <linux/init.h>
 | |
| #include <linux/mount.h>
 | |
| #include <linux/namei.h>
 | |
| #include <linux/fs.h>
 | |
| #include <linux/init_syscalls.h>
 | |
| #include "internal.h"
 | |
| 
 | |
| int __init init_mount(const char *dev_name, const char *dir_name,
 | |
| 		const char *type_page, unsigned long flags, void *data_page)
 | |
| {
 | |
| 	struct path path;
 | |
| 	int ret;
 | |
| 
 | |
| 	ret = kern_path(dir_name, LOOKUP_FOLLOW, &path);
 | |
| 	if (ret)
 | |
| 		return ret;
 | |
| 	ret = path_mount(dev_name, &path, type_page, flags, data_page);
 | |
| 	path_put(&path);
 | |
| 	return ret;
 | |
| }
 |