Linux 051287161312 xlanchenustc edu cn Autumn 2010 Unix
- Slides: 92
Linux操作系统分析 中国科学技术大学计算机系 陈香兰(0512-87161312) xlanchen@ustc. edu. cn Autumn 2010
文件系统 Unix文件系统概述 Linux的虚拟文件系统 Ext 2文件系统简介 12/19/2021 Linux OS analysis 2
文件操作的系统调用 创建/删除 #include <sys/types. h> #include <sys/stat. h> 打开/关闭 #include <fcntl. h> int open(const char *pathname, int flags); 读/写 int open(const char *pathname, int flags, mode_t mode); 定位 int creat(const char *pathname, mode_t mode); 更名 #include <unistd. h> ssize_t write(int fd, const void *buf, size_t count); int unlink(const char *pathname); #include <sys/types. h> #include <unistd. h> off_t lseek(int fildes, off_t offset, int whence); 12/19/2021 #include <stdio. h> Linux OS analysis 16 int rename(const char *oldpath, const char *newpath);
12/19/2021 Linux OS analysis 21
VFS所处理的系统调用 mount、umount:挂载/卸载文件系统 sysfs :获取文件系统信息 statfs、fstatfs、ustat :获取文件系统统计信息 chroot :更改根目录 chdir、fchdir、getcwd :操纵当前 作目录 mkdir、rmdir :创建/删除目录 getdents、readdir 、link 、unlink 、rename :对目录项进行操作 readlink 、symlink :对软链接进行操作 chown 、fchown 、lchown :更改文件所有者 chmod 、fchmod 、utime :更改文件属性 open、close、create … 12/19/2021 Linux OS analysis 27
Super_block Xxx_sb_info s_fs_info s_op Xxx_super_operations 12/19/2021 Linux OS analysis 30
12/19/2021 Linux OS analysis 31
Xxx_inode_info include/linux/fs. h 一个具体的文件:Inode对象:inode Inode特有的方法 inode_operations 文件特有的方法 file_operations Vfs_inode include/linux/dcache. h 目录项对象:dentry 目录项操作:dentry_operations 一个打开文件:文件对象:file 文件操作指针f_pos 文件对象特有的方法 include/linux/fs. h 专用高速缓存:“filp”,filp_cachep 12/19/2021 Linux OS analysis 33
inode data in memory 12/19/2021 Linux OS analysis 34
Structure of an inode on the disk 12/19/2021 Linux OS analysis 35
与进程相关的文件 文件系统相关信息fs_struct 打开文件相关信息files_struct include/linux/fs_struct. h include/linux/path. h 12/19/2021 Linux OS analysis 36
include/linux/fdtable. h include/linux/posix_types. h include/linux/types. h 12/19/2021 Linux OS analysis 37
12/19/2021 Linux OS analysis 38
12/19/2021 Linux OS analysis 40
文件系统类型的注册 文件系统类型:file_system_type 在系统初始化期间,register_filesystem()用来注 册编译时指定的每个文件系统 相应的文件系统对象被插入到file_systems链表中 unregister_filesystem() 12/19/2021 Linux OS analysis 41
12/19/2021 Linux OS analysis 48
查找操作的标志 12/19/2021 Linux OS analysis 49
VFS系统调用的实现 仍然考虑 $ cp /floppy/TEST /tmp/test 假定cp执行下列代码片段(实际要更复杂) inf = open("/floppy/TEST", O_RDONLY, 0); outf = open("/tmp/test", O_WRONLY | O_CREAT | O_TRUNC, 0600); do { len = read(inf, buf, 4096); write(outf, buf, len); } while (len); close(outf); close(inf); 12/19/2021 Linux OS analysis 53
open()系统调用 sys_open read和write系统调用 sys_write sys_read close系统调用 sys_close 12/19/2021 Linux OS analysis 54
超级块 12/19/2021 Linux OS analysis 62
12/19/2021 Linux OS analysis 63
在内存中记录ext 2超级块的数据结构 12/19/2021 Linux OS analysis … 64
12/19/2021 Linux OS analysis 67
新版的目录项结构 12/19/2021 Linux OS analysis 72
注意: 12/19/2021 Linux OS analysis 74
以 1. 44 MB的软盘为例,创建ext 2文件系统后 12/19/2021 Linux OS analysis 77
索引节点对象方法 12/19/2021 Linux OS analysis 79
12/19/2021 Linux OS analysis 80
12/19/2021 Linux OS analysis 81
文件对象方法 12/19/2021 Linux OS analysis 82
12/19/2021 Linux OS analysis 83
混合索引示意图 12/19/2021 Linux OS analysis 88
文件大小限制 12/19/2021 Linux OS analysis 89
Thanks! The end.
- Is unix and linux same
- Difference between unix and linux
- Differnce between unix and linux
- Linux disusun berdasarkan standar sistem operasi
- Linux (unix-like)
- Linux security modules
- Uclinux
- Edu.sharif.edu
- Months of autumn
- Why we celebrate dussehra
- The trees are in their autumn beauty
- Untitled from marilyn monroe
- Autumn is yellow winter is white
- Us digital millennium copyright act autumn
- Leaves metaphor
- Matt monro autumn leaves
- "israeli autumn"
- Jackral
- Autumn unscramble
- Poem whether the weather
- Autumn rhythm (number 30) 1950
- Action painting vs color field
- Effects of assonance
- The demon lover themes
- Louis comfort tiffany autumn landscape
- "israeli autumn"
- Words that rhyme with autumn
- What happens in the autumn?
- Autumn summer
- Taylor paxton
- Spenserian sonnet
- Lovevery weather station
- Every autumn comes the bear
- The wild swans at coole poem
- An autumn constellation the goat fish
- Hello goodbye poem examples
- Thanksgiving facts
- First day of autumn 2014
- Autumn is a season of mellow
- Autumn spring season
- Case study on unix operating system
- Unix ascii table
- Ar unix
- Ciprian palaghianu
- Unix web
- Struktur sistem unix
- Unix programming
- Sistemas unix
- File structures vtu notes
- Unix programming
- Internal command in unix
- Unix development tools
- Unix gui
- Dos cat
- Process control in unix
- Linux operativni sistem
- 2 example of operating system
- The shell interpretive cycle in unix
- Flex %x
- Chapter 10 case study
- Big sister network monitor
- Sco unix operating system
- Conversion of pathname to inode in unix
- Unix 2
- Fast file system
- Racf tutorial
- Api in unix
- Unix
- Objetivo de unix
- Unix
- Iget algorithm in unix
- Linux operating system
- Unix commands ppt
- Unix sistema operacional
- Unix for bioinformatics
- Unix time sharing system
- Unix
- Unix file name
- Unix basic concepts
- Unix process management
- Block diagram of kernel
- Amelia belinda
- Cronologia de los sistemas operativos
- Unix architecture
- Unix multiple choice questions
- Unix was originally developed in
- Unix concurrency mechanisms
- Berkeley software distribution
- Dave probert
- Http unix socket
- Unix design principles
- Unix process state transition diagram
- Lmd unix bank