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方法)