函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-29 10:39:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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)

函数原型:long do_mount(const char *dev_name, const char __user *dir_name, const char *type_page, unsigned long flags, void *data_page)

返回类型:long

参数:

类型参数名称
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  如果flags按位与MS_MGC_MSK的值恒等于Old magic mount flag and maskflags与等于MS_MGC_MSK的反
3073  如果data_page则) = 0
3076  如果flags按位与MS_NOUSER则返回:负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  如果retval则返回:retval
3084  retval等于security_sb_mount(dev_name, & path, type_page, flags, data_page)
3086  如果非retval且非Is the caller allowed to modify his namespace?retval等于负EPERM
3088  如果非retvalflags按位与Allow mandatory locks on an FS 且非may_mandlock()则retval等于负EPERM
3090  如果retval则转到:dput_out
3094  如果非flags按位与Do not update access times. 的值则mnt_flags或等于MNT_RELATIME
3098  如果flags按位与Ignore suid and sgid bits mnt_flags或等于MNT_NOSUID
3100  如果flags按位与Disallow access to device special files mnt_flags或等于MNT_NODEV
3102  如果flags按位与Disallow program execution mnt_flags或等于MNT_NOEXEC
3104  如果flags按位与Do not update access times. mnt_flags或等于MNT_NOATIME
3106  如果flags按位与Do not update directory access times mnt_flags或等于MNT_NODIRATIME
3108  如果flags按位与Always perform atime updates mnt_flags与等于MNT_RELATIME按位或MNT_NOATIME的值的反
3110  如果flags按位与Mount read-only mnt_flags或等于does the user want this to be r/o?
3114  如果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则
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  如果flags按位与Alter flags of a mounted FS 按位或MS_BIND的值的值恒等于Alter flags of a mounted FS 按位或MS_BIND的值则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  否则如果flags按位与Alter flags of a mounted FS 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  否则如果flags按位与MS_BINDretval等于do loopback mount.
3137  否则如果flags按位与change to shared 按位或change to private 按位或change to slave 按位或change to unbindable 的值则retval等于rsively change the type of the mountpoint.
3139  否则如果flags按位与MS_MOVEretval等于do_move_mount_old( & path, dev_name)
3141  否则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  返回:retval
调用者
名称描述
prepare_namespacePrepare the namespace - decide what/where to mount, load ramdisks, etc.
init_linuxrc
handle_initrd
SYSCALL_DEFINE5
COMPAT_SYSCALL_DEFINE5
do_mount_root