Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\fsopen.c Create Date:2022-07-28 20:13:27
Last Modify:2022-05-24 07:35:12 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Open a filesystem by name so that it can be configured for mounting.* We are allowed to specify a container in which the filesystem will be* opened, thereby indicating which namespaces will be used (notably, which

Proto:SYSCALL_DEFINE2(fsopen, const char __user *, _fs_name, unsigned int, flags)

Type:

Parameter:Nothing

122  If Not ns_capable(user_ns, Allow setting zone reclaim policy ) Then Return -EPERM
125  If flags & ~sopen() flags. Then Return -EINVAL
128  fs_name = strndup_user - duplicate an existing string from user space*@s: The string to duplicate*@n: Maximum number of bytes to copy, including the trailing NUL.* Return: newly allocated copy of @s or an ERR_PTR() in case of error
129  If IS_ERR(fs_name) Then Return PTR_ERR(fs_name)
132  fs_type = get_fs_type(fs_name)
133  kfree(fs_name)
134  If Not fs_type Then Return -ENODEV
137  fc = fs_context_for_mount(fs_type, 0)
138  put_filesystem(fs_type)
139  If IS_ERR(fc) Then Return PTR_ERR(fc)
142  phase = FS_CONTEXT_CREATE_PARAMS
144  ret = fscontext_alloc_log(fc)
145  If ret < 0 Then Go to err_fc
148  Return Attach a filesystem context to a file and an fd.
150  err_fc :
151  put_fs_context - Dispose of a superblock configuration context.*@fc: The context to dispose of.
152  Return ret