linux version: 3.4.67
kernel 代码
fs/namespace.c , mount.h
struct vfsmount {
struct dentry *mnt_root;/*挂载点根目录的dentry */
struct super_block *mnt_sb;/* 挂载点批向superblock的指针*/
int mnt_flags; //挂载标识
};
struct mount {
struct list_head mnt_hash;
struct mount *mnt_parent;
struct dentry *mnt_mountpoint;
struct vfsmount mnt;
........
};
mount命令调用关系
mount- > /fs/namespace.c/SYSCALL_DEFINE5(mount,....); -> do_mount -> do_new_mount->
->do_kern_mount->vfs_kern_mount->mount_fs->
->/fs/super.c (struct file_system_type *)type->mount(具体文件系统的mount方法)

本文详细介绍了Linux 3.4版本中VFS的mount系统调用过程,从do_mount开始,经过do_new_mount、do_kern_mount、vfs_kern_mount到最后调用具体文件系统的mount函数。主要涉及的功能包括挂载点创建、权限检查、挂载点加入全局挂载树等,解析了挂载过程中涉及的各种标志和操作。

645

被折叠的 条评论
为什么被折叠?



