Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-28 20:09:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Flags is a 32-bit value that allows up to 31 non-fs dependent flags to* be given to the mount() call (ie: read-only, no-dev, no-suid etc)

Proto:long do_mount(const char *dev_name, const char __user *dir_name, const char *type_page, unsigned long flags, void *data_page)

Type:long

Parameter:

TypeParameterName
const char *dev_name
const char __user *dir_name
const char *type_page
unsigned longflags
void *data_page
3065  mnt_flags = 0
3066  retval = 0
3069  If (flags & MS_MGC_MSK) == Old magic mount flag and mask Then flags &= ~MS_MGC_MSK
3073  If data_page Then ) = 0
3076  If flags & MS_NOUSER Then Return -EINVAL
3080  retval = user_path_at(Special value used to indicateopenat should use the currentworking directory. , dir_name, llow links at the end , & path)
3081  If retval Then Return retval
3084  retval = security_sb_mount(dev_name, & path, type_page, flags, data_page)
3086  If Not retval && Not Is the caller allowed to modify his namespace? Then retval = -EPERM
3088  If Not retval && flags & Allow mandatory locks on an FS && Not may_mandlock() Then retval = -EPERM
3090  If retval Then Go to dput_out
3094  If Not (flags & Do not update access times. ) Then mnt_flags |= MNT_RELATIME
3098  If flags & Ignore suid and sgid bits Then mnt_flags |= MNT_NOSUID
3100  If flags & Disallow access to device special files Then mnt_flags |= MNT_NODEV
3102  If flags & Disallow program execution Then mnt_flags |= MNT_NOEXEC
3104  If flags & Do not update access times. Then mnt_flags |= MNT_NOATIME
3106  If flags & Do not update directory access times Then mnt_flags |= MNT_NODIRATIME
3108  If flags & Always perform atime updates Then mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME)
3110  If flags & Mount read-only Then mnt_flags |= does the user want this to be r/o?
3114  If flags & Alter flags of a mounted FS && (flags & ( Do not update access times. | Do not update directory access times | Update atime relative to mtime/ctime. | Always perform atime updates )) == 0 Then
3117  mnt_flags &= ~MNT_ATIME_MASK
3118  mnt_flags |= mnt_flags & MNT_ATIME_MASK
3121  sb_flags = flags & ( Mount read-only | Writes are synced at once | Allow mandatory locks on an FS | Directory modifications are synchronous | SB_SILENT | VFS does not apply the umask | Update the on-disk [acm]times lazily | Update inode I_version field )
3130  If (flags & (Alter flags of a mounted FS | MS_BIND)) == (Alter flags of a mounted FS | MS_BIND) Then retval = Handle reconfiguration of the mountpoint only without alteration of the* superblock it refers to. This is triggered by specifying MS_REMOUNT|MS_BIND* to mount(2).
3132  Else if flags & Alter flags of a mounted FS Then retval = hange filesystem flags. dir should be a physical root of filesystem.* If you've mounted a non-root directory somewhere and want to do remount* on it - tough luck.
3135  Else if flags & MS_BIND Then retval = do loopback mount.
3137  Else if flags & ( change to shared | change to private | change to slave | change to unbindable ) Then retval = rsively change the type of the mountpoint.
3139  Else if flags & MS_MOVE Then retval = do_move_mount_old( & path, dev_name)
3141  Else retval = reate a new mount for userspace and request it to be added into the* namespace's tree
3144  dput_out :
3145  path_put - put a reference to a path*@path: path to put the reference to* Given a path decrement the reference count to the dentry and the vfsmount.
3146  Return retval
Caller
NameDescribe
prepare_namespacePrepare the namespace - decide what/where to mount, load ramdisks, etc.
init_linuxrc
handle_initrd
SYSCALL_DEFINE5
COMPAT_SYSCALL_DEFINE5