Function report |
Source Code:fs\namespace.c |
Create Date:2022-07-28 20:09:22 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Create a kernel mount representation for a new, prepared superblock* (specified by fs_fd) and attach to an open_tree-like file descriptor.
Proto:SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags, unsigned int, attr_flags)
Type:
Parameter:Nothing
| 3375 | mnt_flags = 0 |
| 3378 | If Not Is the caller allowed to modify his namespace? Then Return -EPERM |
| 3381 | If (flags & ~smount() flags.) != 0 Then Return -EINVAL |
| 3392 | If attr_flags & Mount read-only Then mnt_flags |= does the user want this to be r/o? |
| 3394 | If attr_flags & Ignore suid and sgid bits Then mnt_flags |= MNT_NOSUID |
| 3396 | If attr_flags & Disallow access to device special files Then mnt_flags |= MNT_NODEV |
| 3398 | If attr_flags & Disallow program execution Then mnt_flags |= MNT_NOEXEC |
| 3400 | If attr_flags & Do not update directory access times Then mnt_flags |= MNT_NODIRATIME |
| 3404 | Case & == - Always perform atime updates |
| 3405 | Break |
| 3406 | Case & == - Do not update access times. |
| 3407 | mnt_flags |= MNT_NOATIME |
| 3408 | Break |
| 3409 | Case & == - Update atime relative to mtime/ctime. |
| 3410 | mnt_flags |= MNT_RELATIME |
| 3411 | Break |
| 3412 | Default |
| 3413 | Return -EINVAL |
| 3421 | If f_op != fscontext_fops Then Go to err_fsfd |
| 3426 | ret = mutex_lock_interruptible( & uapi_mutex) |
| 3432 | If Not root Then Go to err_unlock |
| 3436 | If mount_too_revealing(d_sb, & mnt_flags) Then |
| 3437 | pr_warn("VFS: Mount too revealing\n") |
| 3438 | Go to err_unlock |
| 3442 | If phase != FS_CONTEXT_AWAITING_MOUNT Then Go to err_unlock |
| 3446 | If sb_flags & Allow mandatory locks on an FS && Not may_mandlock() Then Go to err_unlock |
| 3452 | Go to err_unlock |
| 3462 | vfs_clean_context(fc) |
| 3464 | ns = alloc_mnt_ns(user_ns, true) |
| 3469 | mnt = real_mount(mnt) |
| 3470 | containing namespace = ns |
| 3472 | # of mounts in the namespace = 1 |
| 3479 | file = dentry_open( & newmount, O_PATH, cred) |
| 3487 | ret = get_unused_fd_flags((flags & smount() flags.) ? O_CLOEXEC : 0) |
| 3488 | If ret >= 0 Then fd_install(ret, file) |
| 3493 | err_path : |
| 3495 | err_unlock : |
| 3497 | err_fsfd : |
| 3499 | Return ret |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |