LINUX_VFS精华版PPT.ppt_第1页
LINUX_VFS精华版PPT.ppt_第2页
LINUX_VFS精华版PPT.ppt_第3页
LINUX_VFS精华版PPT.ppt_第4页
LINUX_VFS精华版PPT.ppt_第5页
已阅读5页,还剩62页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、LINUX VFS,孟静 2009春,LINUX VFS(虚拟文件系统Virtual File System),1. VFS之What 是什么(概念,定义,功能) 2. VFS之Why为什么(目的,作用) 3. VFS之HowVFS如何工作 4. VFS之3W总结,1. VFS之What 是什么(概念,定义,功能),VFS:Virtual File System虚拟文件系统, 或Virtual File Switch虚拟文件转换/开关 VFS是Linux和UNIX文件系统中采用的一种技术机制,旨在一个操作系统中支持多个不同类型的文件系统。VFS是操作系统内核中这样一组数据结构与子程序的集合,它

2、位于操作系统系统调用界面与具体类型文件系统之间,负责 记录操作系统中可以支持和已经安装有哪些文件系统类型, 将相关系统调用转换为对具体类型文件系统的调用, 负责不同类型文件系统间的协同工作(例如跨FS复制), 实现对不同类型文件系统的动态装卸和可扩充性等。,续1. VFS之What 是什么(概念,定义,功能),通过以上功能,VFS 向用户、应用程序、和操作系统其他部件提供了一个通用的、统一的、标准的、抽象的、虚拟的系统调用接口界面(所以称Virtual) 对以上应用程序等掩盖不同类型文件系统的差异和细节 为以上应用程序等提供了对具体文件系统类型的程序独立性和透明性。 例如,当用户程序AP1在两

3、次运行中分别读EXT2、NTFS文件,都使用同样的read()系统调用函数,程序AP1不必改变 VFS是从OS系统调用界面到各具体类型文件系统之间的中介、分支机构、转换机构(所以称switch)、函数转换表,其作用类似于设备开关表、系统调用分支表、总线、主板插槽等。,LINUX VFS支持哪些文件系统,目前至少50多种,可从fs.h中的union u或fs/*.c或/proc/filesystems看到 本地文件系统:EXT2,EXT3,EXT4,FAT,NTFS,minix,UFS,HFS,ISOFS,HPFS,AFFS(FFS),SYSV(S5FS),EFS,UDF等 网络文件系统:NFS

4、,coda,SAMBA,等 虚拟文件系统:PROC,等,Union u,2. VFS之Why为什么/目的/作用,前已概述 稍微深入一点的思考:“在一个操作系统中支持多种不同类型文件系统”存在或需要解决哪些问题?(相对于一个操作系统只支持单类型文件系统而言) 卷格式不同 卷管理信息内容与格式不同 目录项内容与格式不同 文件描述信息内容与格式不同 相应操作子程序也就不同(打开文件,读写文件等) 所以同样的读文件系统调用read(),对不同类型的文件系统(例如EXT或NTFS),需调用相应不同的操作子程序。 VFS最关键的作用,就在于提供了对上述不同操作子程序的分支跳转支持机制。,3. VFS之Ho

5、wVFS如何工作,关键数据结构:文件操作表,文件系统安装登记表 关键流程步骤:根据文件操作表从标准系统调用跳转至相应具体类型文件系统的操作子程序。 把“/d1/f1”这整个路径名,一次性地转交给具体类型文件系统去处理? 如此简单吗?NO. VFS内部实现机制包括种数据结构、行源代码 为何有这些更多的工作要做?有哪些工作?,文件操作表struct file_operations 完整说明(fs.h中,共34行),struct file_operations struct module *owner; loff_t (*llseek) (struct file *, loff_t, int); s

6、size_t (*read) (struct file *, char _user *, size_t, loff_t *); ssize_t (*write) (struct file *, const char _user *, size_t, loff_t *); ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t

7、); int (*readdir) (struct file *, void *, filldir_t); unsigned int (*poll) (struct file *, struct poll_table_struct *); int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); long (*compat_ioctl) (struct file *,

8、 unsigned int, unsigned long); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); int (*flush) (struct file *, fl_owner_t id); int (*release) (struct inode *, struct file *); int (*fsync) (struct file *, struct dentry *, int datasync); int (*aio_fsync)

9、 (struct kiocb *, int datasync); int (*fasync) (int, struct file *, int); int (*lock) (struct file *, int, struct file_lock *); ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); unsigned long (

10、*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); int (*check_flags)(int); int (*dir_notify)(struct file *filp, unsigned long arg); int (*flock) (struct file *, int, struct file_lock *); ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, lo

11、ff_t *, size_t, unsigned int); ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); ;,文件操作表struct file_operations 重点标释,struct file_operations loff_t (*llseek) (struct file *, loff_t, int); ssize_t (*read) (struct file *, char _user *, size_t, loff_t *); ss

12、ize_t (*write) (struct file *, const char _user *, size_t, loff_t *); int (*mmap) (struct file *, struct vm_area_struct *); int (*open) (struct inode *, struct file *); ;,关键流程步骤,应用程序中open(“/d1/f1”) 通过系统调用进入内核 VFS判断/d1/f1所属文件系统类型 根据文件操作表跳转至相应具体类型文件系统(例如EXT2)的open操作子程序,为何不是1次转换那么简单?更多工作有哪些?,安装点和链接 /d1

13、/f1路径上可能存在两个不同类型的文件系统 结论:需逐个分量逐次调用具体类型文件系统,而不能一次性的整个路径名转交 因此,与具体类型文件系统的交互(即调用次数)增多了 因此,内存缓冲数据结构进入VFS 内存活动I结点,目录项,超级块,等 为了统一管理和减少代码重复,文件系统类型无关的操作(即大部分内存操作)进入VFS,文件系统类型相关的操作(即所有外存操作,及少量内存操作)留在具体类型文件系统中 以上这三个因素导致的VFS实际结构和过程,3.VFS之HowVFS如何工作,3.1 VFS数据结构:单多类型对比 3.2 VFS工作过程:单多类型对比 文件系统登记与安装,打开文件,读文件 3.3 V

14、FS相关源码和.h文件简介 理解要点:与单类型FS对比 3.0 几个概念的区分,3.0 几个概念的区分,一个已发布的linuxOS版本,支持几种FS类型? 一个已安装的linuxOS实例,支持几种FS类型? 一个FS类型的注册(register)FS代码 一个FS实例的产生和建立(格式化)FS数据(外存盘卷) 一个FS实例的安装(mount)FS数据从外存进入内存 VFS只有代码和内存数据,在外存不存在,开机时产生,关机后不再存在。 单类型FS和具体类型FS既可能指代码,也可能指外存数据(盘卷实体)。具体类型FS既可能对单类型FS而言,也可能指多类型FS而言。 FS的含义可能指以上所有内容中一

15、个或全体,依上下文而定。,相关词汇,版本version 发布distribute 类型type 登记注册register 实例instance 安装mount FS建立(格式化,初始化):mkfs,formatted,initialize,相关概念和过程之间关系,注册FS类型(此处是指代码) 安装具体类型FS(此处是指实例,数据) 打开文件 读写文件 关闭文件 卸载具体类型FS 注销具体类型FS,3.1 VFS数据结构,分两级看: 数据结构总图级:与单类型对比 Struct级:.h文件,需结合工作过程图看,VFS数据结构总图,VFS数据结构总图要点分析,与单类型FS数据结构总图对比: VFS多

16、了文件系统类型注册表 VFS多了几张对具体类型FS的操作分支表 VFS的与外存对应的内存暂存数据结构内容与格式是通用的、面向多种类型FS的。 VFS的OO(面向对象思想): 系统打开文件表:目录项对象(dentry对象) 内存活动I结点表:inode对象 进程打开文件表:文件对象(file对象) 内存超级块表:超级块对象 Vfs关于FS级的数据结构为何一分为三,文件描述信息的三个数据结构,单类型FS数据结构总图,单类型FS数据结构要点简单回顾,外存数据结构:超级块,I结点,目录项等 内存数据结构包括两种与外存对应暂存信息当前使用信息(与外存没有对应) 为提高效率,凡是正使用或已打开的外存数据,

17、都在内存留存,以便再次使用时不必重复读写外存。 关于卷的内存数据结构: 内存超级块外存超级块 关于文件的内存数据结构: 内存活动I结点表外存I结点 系统打开文件表外存目录项 进程打开文件表在外存没有对应 为何关于文件的内存数据结构是一分为三的? 链接导致系统打开文件表与活动I结点分离 多进程同时打开一个文件,导致系统打开文件表与进程打开文件表的分离 因为单类型,所以没有文件系统类型登记表,进程表中的相关内容,Struct task_struct . /* filesystem information */struct fs_struct *fs;/* open file information

18、 */struct files_struct *files; ,struct fs_struct,struct fs_struct atomic_t count;rwlock_t lock;int umask;struct dentry * root, * pwd, * altroot;struct vfsmount * rootmnt, * pwdmnt, * altrootmnt;,进程打开文件表Struct files_struct完整说明与重点标释,Struct files_struct atomic_t count; rwlock_t file_lock; int max_fds;

19、int max_fdset; int next_fd; struct file *fd;/*current fd array*/ fd_set *close_on_exec; fd_set *open_fds; fd_set close_on_exec_init; fd_set open_fds_init; struct file * fd_arrayNR_OREN_DEFAULT; ,进程打开文件表(struct file)的内容,重点信息: 文件操作表 指向系统打开文件表的指针 文件当前读写位置指针 其他信息: 打开方式,文件主信息, 指向FS安装表的指针,指向文件缓冲区的指针, 链表信息

20、 关于权限、安全、互斥的信息 相关struct: Struct file Struct files_struct struct file * fd_arrayNR_OREN_DEFAULT;,进程打开文件表struct file完整说明(fs.h中,共35行),struct file /* * fu_list becomes invalid after file_free is called and queued via * fu_rcuhead for RCU freeing */ union struct list_headfu_list; struct rcu_head fu_rcuhe

21、ad; f_u; struct pathf_path; #define f_dentryf_path.dentry #define f_vfsmntf_path.mnt const struct file_operations*f_op; atomic_tf_count; unsigned int f_flags; mode_tf_mode; loff_tf_pos; struct fown_structf_owner; unsigned intf_uid, f_gid; struct file_ra_statef_ra; unsigned longf_version; #ifdef CONF

22、IG_SECURITY void*f_security; #endif /* needed for tty driver, and maybe others */ void*private_data; #ifdef CONFIG_EPOLL /* Used by fs/eventpoll.c to link all the hooks to this file */ struct list_headf_ep_links; spinlock_tf_ep_lock; #endif /* #ifdef CONFIG_EPOLL */ struct address_space*f_mapping; ;

23、,进程打开文件表struct file重点标释,struct file struct pathf_path; const struct file_operations*f_op; atomic_tf_count; unsigned int f_flags; mode_tf_mode; loff_tf_pos; struct fown_structf_owner; unsigned intf_uid, f_gid; struct file_ra_statef_ra; unsigned longf_version; void*private_data; struct address_space*f

24、_mapping; .;,系统打开文件表(struct dentry)内容,重点信息: 文件名 指向活动I结点表的指针 目录项对象操作表 其他信息: 指向超级块的指针 链表信息 文件系统类型相关信息 引用计数 关于互斥、保护信息等 相关struct: Struct dentry,系统打开文件表struct dentry完整说明(dcache.h文件中,共34行),struct dentry atomic_t d_count;unsigned int d_flags;/* protected by d_lock */spinlock_t d_lock;/* per dentry lock */s

25、truct inode *d_inode;/* Where the name belongs to - NULL is * negative */* * The next three fields are touched by _d_lookup. Place them here * so they all fit in a cache line. */struct hlist_node d_hash;/* lookup hash list */struct dentry *d_parent;/* parent directory */struct qstr d_name;struct lis

26、t_head d_lru;/* LRU list */* * d_child and d_rcu can share memory */union struct list_head d_child;/* child of parent list */ struct rcu_head d_rcu; d_u;struct list_head d_subdirs;/* our children */struct list_head d_alias;/* inode alias list */unsigned long d_time;/* used by d_revalidate */struct d

27、entry_operations *d_op;struct super_block *d_sb;/* The root of the dentry tree */void *d_fsdata;/* fs-specific data */#ifdef CONFIG_PROFILINGstruct dcookie_struct *d_cookie; /* cookie, if any */#endifint d_mounted;unsigned char d_inameDNAME_INLINE_LEN_MIN;/* small names */;,系统打开文件表struct dentry重点标释,

28、struct dentry atomic_t d_count;unsigned int d_flags;/* protected by d_lock */spinlock_t d_lock;/* per dentry lock */struct inode *d_inode;/* Where the name belongs to - struct dentry *d_parent;/* parent directory */struct qstr d_name;struct dentry_operations *d_op;struct super_block *d_sb;/* The roo

29、t of the dentry tree */void *d_fsdata;/* fs-specific data */int d_mounted;unsigned char d_inameDNAME_INLINE_LEN_MIN;/* small names */;,struct dentry_operations,struct dentry_operations int (*d_revalidate)(struct dentry *, struct nameidata *);int (*d_hash) (struct dentry *, struct qstr *);int (*d_com

30、pare) (struct dentry *, struct qstr *, struct qstr *);int (*d_delete)(struct dentry *);void (*d_release)(struct dentry *);void (*d_iput)(struct dentry *, struct inode *);char *(*d_dname)(struct dentry *, char *, int);,活动I结点表的内容,重点内容: 外存I结点号 I结点对象操作表指针,文件对象操作表指针, 其他内容: 文件长度、类型、权限,文件主各种信息,各种时间信息,设备号 链

31、接数,此I结点的所有链接的链头 指向文件缓冲区的指针,内存超级块指针, 各种链表信息,队列指针,状态信息,限额信息,计数信息 关于锁、互斥的信息,指向文件系统类型相关信息的指针,等 相关struct: struct inode,活动I结点表struct inode完整说明(fs.h中,共66行),struct inode struct hlist_nodei_hash; struct list_headi_list; struct list_headi_sb_list; struct list_headi_dentry; unsigned longi_ino; atomic_ti_count;

32、 unsigned inti_nlink; uid_ti_uid; gid_ti_gid; dev_ti_rdev; unsigned longi_version; loff_ti_size; #ifdef _NEED_I_SIZE_ORDERED seqcount_ti_size_seqcount; #endif struct timespeci_atime; struct timespeci_mtime; struct timespeci_ctime; unsigned inti_blkbits; blkcnt_ti_blocks; unsigned short i_bytes; umod

33、e_ti_mode; spinlock_ti_lock;/* i_blocks, i_bytes, maybe i_size */ struct mutexi_mutex; struct rw_semaphorei_alloc_sem; const struct inode_operations*i_op; const struct file_operations*i_fop;/* former -i_op-default_file_ops */ struct super_block*i_sb; struct file_lock*i_flock; struct address_space*i_

34、mapping; struct address_spacei_data; #ifdef CONFIG_QUOTA struct dquot*i_dquotMAXQUOTAS; #endif struct list_headi_devices; union struct pipe_inode_info*i_pipe; struct block_device*i_bdev; struct cdev*i_cdev; ; inti_cindex; _u32i_generation; #ifdef CONFIG_DNOTIFY unsigned longi_dnotify_mask; /* Direct

35、ory notify events */ struct dnotify_struct*i_dnotify; /* for directory notifications */ #endif #ifdef CONFIG_INOTIFY struct list_headinotify_watches; /* watches on this inode */ struct mutexinotify_mutex;/* protects the watches list */ #endif unsigned longi_state; unsigned longdirtied_when;/* jiffie

36、s of first dirtying */ unsigned inti_flags; atomic_ti_writecount; #ifdef CONFIG_SECURITY void*i_security; #endif void*i_private; /* fs or device private pointer */ ;,活动I结点表struct inode重点标释,struct inode struct list_headi_dentry; unsigned longi_ino; atomic_ti_count; unsigned inti_nlink; dev_ti_rdev; u

37、nsigned longi_version; loff_ti_size; const struct inode_operations*i_op; const struct file_operations*i_fop;/* former -i_op-default_file_ops */ struct super_block*i_sb; struct address_space*i_mapping; struct address_spacei_data; inti_cindex; _u32i_generation; void*i_private; /* fs or device private

38、pointer */ ;,struct inode_operations,struct inode_operations int (*create) (struct inode *,struct dentry *,int, struct nameidata *);struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);int (*link) (struct dentry *,struct inode *,struct dentry *);int (*unlink) (struct inode

39、*,struct dentry *);int (*symlink) (struct inode *,struct dentry *,const char *);int (*mkdir) (struct inode *,struct dentry *,int);int (*rmdir) (struct inode *,struct dentry *);int (*mknod) (struct inode *,struct dentry *,int,dev_t);int (*rename) (struct inode *, struct dentry *,struct inode *, struc

40、t dentry *);int (*readlink) (struct dentry *, char _user *,int);void * (*follow_link) (struct dentry *, struct nameidata *);void (*put_link) (struct dentry *, struct nameidata *, void *);void (*truncate) (struct inode *);int (*permission) (struct inode *, int, struct nameidata *);int (*setattr) (str

41、uct dentry *, struct iattr *);int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);ssize_t (*listxattr) (struct dentry *, char *, size_t);int

42、(*removexattr) (struct dentry *, const char *);void (*truncate_range)(struct inode *, loff_t, loff_t);,3.2 VFS工作过程,重点分析以下过程: 3.2.1 文件系统类型登记注册(register) 3.2.2 文件系统安装(mount) 3.2.3 文件打开(open) 3.2.4 读文件(read) 每个过程都与单类型FS对比,3.2.1 VFS文件系统注册工作原理,VFS文件系统类型注册 主要数据结构:文件系统类型注册链表 VFS文件系统类型注册时机和相关用户界面 VFS文件系统注册内

43、部实现工作过程 单类型FS没有文件系统类型注册问题与需要,VFS文件系统类型注册链表,该表概述: 每个已安装的OS实例,有一张该链表 每个FS类型在表中有一“行” 该OS实例,支持多少种FS类型,该表就有多少行 链头file_systems 该链表在开机(OS启动)时自动生成,并可在OS运行过程中由用户补充注册新的FS类型 每行主要内容(struct file_system_type) 文件系统类型名 读超级块的函数指针,链表指针,等,struct file_system_type完整说明(fs.h中,共12行)和重点标释,struct file_system_type const char

44、*name; /*文件系统类型名*/ int fs_flags; int (*get_sb) (struct file_system_type *, int, const char *, void *, struct vfsmount *); void (*kill_sb) (struct super_block *);/*读超块*/ struct module *owner; struct file_system_type * next; struct list_head fs_supers; struct lock_class_key s_lock_key; struct lock_cla

45、ss_key s_umount_key; ;,VFS文件系统类型注册时机/用户界面,向OS内核注册FS类型,有两种途径: 一种是在编译内核时确定,并在OS初始化时通过内嵌的函数调用向FS类型注册表登记。 另一种是通过linux模块(module)机制,把某个FS当作一个模块,装入该模块时(通过kerneld或insmod/modprob命令)向FS类型注册表登记其类型,卸载该模块时则从FS类型注册表注销。 FS类型注册和注销函数: Int register_filesystem(struct file_system_type *fs) Int unregister_filesystem(str

46、uct file_system_type *fs),文件系统注册的内部工作过程,(注意调用参数为struct file_system_type指针) 根据FS类型名在链表中检查是否已注册(重名) 将struct file_system_type链入链表 OK,3.2.2 VFS下的文件系统安装,VFS下的FS安装时机和相关用户界面: OS初启时自动安装: 根FS(由全程变量ROOT_DEV指示) 根据/etc/fstab的指定,逐个安装文件系统 OS运行过程中可随时安装其他FS实例: 命令mount 设备名 安装点目录名 系统调用和函数mount(设备名,安装点目录名) 例如mount /de

47、v/sda1 /home/usr1/d1将C:安装到d1下 主要数据结构:文件系统安装表,内存超级块 VFS“文件系统安装”内部工作过程 简忆与对比:FS基础知识及单类型FS安装 Vfs关于FS的数据结构为何一分为三,简忆与对比:FS基础知识/单类型FS安装,比较linux/unix安装点机制与windows驱符机制 关于文件系统实例的概念:闭体,卷,分区,盘,设备,格式化与FS类型,安装,安装点 单类型文件系统的文件系统安装用户界面同前,但格式化时和内部实现时不用考虑FS类型,文件系统安装表,表概述: 每个已安装的OS实例,有一张该链表 每个已安装的FS实例,在表中有一“行” 该OS实例,已

48、安装多少个FS实例,该表就有多少行 链头 该链表在OS启动时自动生成第一行根,在OS运行过程中用户每安装/卸载一个FS时,增/减一行 该表有时又称FS注册表,注意区分于FS类型注册表 每行主要内容struct vfsmount 主要内容:超级块指针,设备名,安装点,根目录项 其他内容:链表信息,父fs信息,,struct vfsmount完整说明(mount.h中,共27行),struct vfsmount struct list_head mnt_hash;struct vfsmount *mnt_parent;/* fs we are mounted on */struct dentry

49、*mnt_mountpoint;/* dentry of mountpoint */struct dentry *mnt_root;/* root of the mounted tree */struct super_block *mnt_sb;/* pointer to superblock */struct list_head mnt_mounts;/* list of children, anchored here */struct list_head mnt_child;/* and going through their mnt_child */int mnt_flags;/* 4

50、bytes hole on 64bits arches */char *mnt_devname;/* Name of device e.g. /dev/dsk/hda1 */struct list_head mnt_list;struct list_head mnt_expire;/* link in fs-specific expiry list */struct list_head mnt_share;/* circular list of shared mounts */struct list_head mnt_slave_list;/* list of slave mounts */s

51、truct list_head mnt_slave;/* slave list entry */struct vfsmount *mnt_master;/* slave is on master-mnt_slave_list */struct mnt_namespace *mnt_ns;/* containing namespace */* * We put mnt_count ,struct vfsmount重点标释,struct vfsmount struct dentry *mnt_mountpoint;/* 指向安装点dentry的指针*/struct dentry *mnt_root

52、;/* 指向该FS根目录dentry的指针 */struct super_block *mnt_sb;/*指向该FS的超级块*/char *mnt_devname;/* 该FS设备名*/.;,VFS“文件系统安装”内部工作过程,过程图中红色部分为与单类型FS不同处。黑体部分原来由具体类型FS完成,现由VFS完成,但过程与具体类型FS类似。(类型相关无关) 注意:因为一个FS可安装在多个安装点,因此一个超级块可对应多个struct vfsmount。 相关函数: Sys_mount,do_mount, Static struct vfsmount *add_vfsmnt(struct namei

53、data *nd,struct dentry *root,const char *dev_name) Static void move_vfsmnt(struct vfsmount *mnt,struct dentry *mountpoint,struct vfsmount *parent,const char *dev_name) Static void remove_vfsmnt(struct vfsmount *mnt),VFS下”文件系统安装”内部工作过程图,应用程序通过mount系统调用进入内核 参数:FS类型/设备名/安装点/等 根据设备名查VFS内存超级块对象链表,判断该FS超级

54、块已在内存否?否则通过FS类型注册表读该设备超级块,建立该设备的内存超级块对象和根目录项对象 申请新struct vfsmount并填写其各项内容: 超级块指针,设备名,安装点,根目录项指针等。 OK,struct super_block完整说明(在fs.h中,共60行),struct super_block struct list_heads_list;/* Keep this first */ dev_ts_dev;/* search index; _not_ kdev_t */ unsigned longs_blocksize; unsigned chars_blocksize_bits

55、; unsigned chars_dirt; unsigned long longs_maxbytes;/* Max file size */ struct file_system_type*s_type; const struct super_operations*s_op; struct dquot_operations*dq_op; struct quotactl_ops*s_qcop; struct export_operations *s_export_op; unsigned longs_flags; unsigned longs_magic; struct dentry*s_ro

56、ot; struct rw_semaphores_umount; struct mutexs_lock; ints_count; ints_syncing; ints_need_sync_fs; atomic_ts_active; #ifdef CONFIG_SECURITY void *s_security; #endif struct xattr_handler*s_xattr; struct list_heads_inodes;/* all inodes */ struct list_heads_dirty;/* dirty inodes */ struct list_heads_io;

57、/* parked for writeback */ struct hlist_heads_anon;/* anonymous dentries for (nfs) exporting */ struct list_heads_files; struct block_device*s_bdev; struct mtd_info*s_mtd; struct list_heads_instances; struct quota_infos_dquot;/* Diskquota specific options */ ints_frozen; wait_queue_head_ts_wait_unfr

58、ozen; char s_id32;/* Informational name */ void *s_fs_info;/* Filesystem private info */ /* * The next field is for VFS *only*. No filesystems have any business * even looking at it. You had been warned. */ struct mutex s_vfs_rename_mutex;/* Kludge */ /* Granularity of c/m/atime in ns. Cannot be wor

59、se than a second */ u32 s_time_gran; /* * Filesystem subtype. If non-empty the filesystem type field * in /proc/mounts will be type.subtype */ char *s_subtype; ;,struct super_block重点标释,struct super_block dev_ts_dev;/* search index; _not_ kdev_t */ unsigned longs_blocksize; unsigned chars_blocksize_bits; unsigned chars_dirt; unsigned long longs_maxbytes;/* Max file size */ struct file_system_type*s_type;/*指向该FS的struct file_system_type*/ const struct super_operations*s_op;/*指向一组对该FS进行操作的函数*/ struct dentry*s_root;/*指向该FS根目录dentry对象*/ struct block_d

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论