文件系统注册表的数据结构 r file_ systems指向文件系统注册表,每一个文 件系统类型在注册表中有一个登记项,记录了 该文件系统类型的名name、支持该文件系统 的设备 requires_dev、读出该文件系统在外存 超级块的函数 read_super、以及注册表的链表 指针next。 了函数 rregister_filesystem用于注册一个文件系统 类型,函数 unregister_ filesystem用于从注册 表中卸装一个文件系统类型
文件系统注册表的数据结构 file_systems指向文件系统注册表,每一个文 件系统类型在注册表中有一个登记项,记录了 该文件系统类型的名name、支持该文件系统 的设备requires_dev、读出该文件系统在外存 超级块的函数read_super、以及注册表的链表 指针next。 函数register_filesystem用于注册一个文件系统 类型,函数unregister_filesystem用于从注册 表中卸装一个文件系统类型
f e system type file system t file syster requires dev equires dev requires dev
file_system_type name requires_dev read_super next file_systems file_system_type name requires_dev read_super next file_system_type name requires_dev read_super next
r Linux操作系统不通过设备标识访问某个 具体文件系统,而是通过 mount命令把 它安装到整个文件系统树的某一个目录 节点,该文件系统的所有文件和子目录 就是该目录的文件和子目录,直到用 umount命令显式的撤卸该文件系统
Linux操作系统不通过设备标识访问某个 具体文件系统,而是通过mount命令把 它安装到整个文件系统树的某一个目录 节点,该文件系统的所有文件和子目录 就是该目录的文件和子目录,直到用 umount命令显式的撤卸该文件系统
了当 Linux自举时,首先装入根文件系统, 然后根据/etc/ fstab中的登记项使用 mount命令自动逐个安装文件系统。此 外用户也可以显式地通过 mount和 umount命令安装和卸装文件系统
当Linux自举时,首先装入根文件系统, 然后根据 /etc/fstab 中 的 登 记 项 使 用 mount命令自动逐个安装文件系统。此 外 用 户 也 可 以 显 式 地 通 过 mount 和 umount命令安装和卸装文件系统
smnttail%链表尾的单项链表中增加或删除一个 amount节参 了文件系统的注册和注销操作时,将在以 vfsmntlist为链表头 具体数据结构如下 r static struct vfsmount vfsmntlist =(static struct vfsmount NULL, r static struct vfsmount * vfsmnttail=(static struct vfsmount *)NUL/*尾* r static struct vfsmount *mru-vfsmnt =(static struct vfsmount * )NULL;/ 米当 前 r struct vfsmount t kdey t mnt dev;/*文件系统所在的主次设备号* cha* mnt devname;/*文件系统所在的设备名,*/ char* mnt dirname;/*安装目录名*/ unsigned int mnt_ flags;/*设备标志,如ro* struct semaphore mnt_ sen;/*设备有关的信号量*/ struct super_ block* mnt sb;/*指向超级块* struct file* mnt_ quotas[MAXQUOTAS];/*指向配额文件的指针 r time-t mnt_jexpIMAXQUOTAS]: / expiretime for inodes * time t mnt bexp[MAXQUOTAS]: / expiretime for blocks k struct vfsmount* mnt next;/*后继指针*
文件系统的注册和注销操作时,将在以vfsmntlist为链表头和 vfsmnttail为链表尾的单项链表中增加或删除一个vfsmount节点, 具体数据结构如下: static struct vfsmount vfsmntlist = (static struct vfsmount )NULL; static struct vfsmount *vfsmnttail = (static struct vfsmount *)NULL; /* 尾 */ static struct vfsmount *mru_vfsmnt = (static struct vfsmount *)NULL; /*当前*/ struct vfsmount { kdev_t mnt_dev; /* 文件系统所在的主次设备号 */ char* mnt_devname;/*文件系统所在的设备名, */ char* mnt_dirname;/* 安装目录名 */ unsigned int mnt_flags;/* 设备标志,如ro */ struct semaphore mnt_sem;/* 设备有关的信号量 */ struct super_block* mnt_sb;/* 指向超级块 */ struct file* mnt_quotas[MAXQUOTAS];/*指向配额文件的指针 time_t mnt_iexp[MAXQUOTAS]; /* expiretime for inodes */ time_t mnt_bexp[MAXQUOTAS]; /* expiretime for blocks */ struct vfsmount* mnt_next; /* 后继指针 */ };