Linux File System - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

Linux File System

Description:

Linux File System Li-Shien Chen – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 32
Provided by: LSC90
Category:
Tags: file | linux | system

less

Transcript and Presenter's Notes

Title: Linux File System


1
Linux File System
  • Li-Shien Chen

2
????
3
????
4
Inode
5
Link
  • ?????
  • ?????????
  • Hardlink
  • ln /a/os1.txt /b/os2.txt

6
Hard Link
7
Hard Link ??
  • ????????
  • ???????
  • ???????
  • ???Inode number???

8
Symbolic Link
  • Ln s /a/os1.txt /b/os2.txt
  • ?Hard Link???
  • ????Inode??

9
Symbolic Link
10
??Unix??
  • ???????????
  • ???????????
  • ????????????


11
??Unix????
12
???
13
??????
  • Kernel???????????
  • ?????????
  • ??? ?kernel??????????
  • ??????

14
???
15
Linux File System
  • ???????
  • ?Ext2,FAT??
  • Cache
  • ???????????
  • Virtual File System Switch(VFS)
  • Kernel??????????

16
Linux File System ??
17
The Buffer Cache
18
The States of the Cache
  • Locked
  • Buffers that are locked, waiting to be written
  • Dirty
  • Dirty buffers. These contain new, valid data, and
    will be written but so far have not been
    scheduled to write

19
The States of the Cache
  • Share
  • Shared buffers
  • Unshared
  • Buffers that were once shared but which are now
    not shared

20
???????
  • Disk and Patition Layout
  • ?Linux?, ??????????partition????
  • ?VFS?, ??????????superblock????

21
VFS Superblock
  • Super_block??
  • struct list_heads s_list
  • kdev_t s_dev
  • unsigned long s_blocksize
  • unsigned char s_blocksize_bits
  • unsigned char s_rd_only
  • unsigned char s_dirt

22
VFS Superblock
  • struct file_system_type type
  • unsigned long s_flags
  • unsigned long s_magic
  • struct dentry s_root
  • struct super_operations s_op

23
?????
  • ????? ????
  • ? usr/src/linux/fs/file.c
  • VFS?vfs inode(vnode)???

24
VFS inode
  • Device
  • Inode Number
  • Mode
  • User id
  • times
  • block size
  • inode operations
  • a pointer to a block of routine addresses
  • count
  • lock
  • dirty
  • file system specific

25
Registering the File Systems
  • Build Linux kernel supported file systems
  • Build file systems as module

26
??????
  • ?? mount ? mount_root()
  • ??read_super()???superblock
  • mount -t ext2 /dev/hda3 /mnt

27
Example
28
Mounting a File System
  • mount -t iso9600 -o ro /dev/cdrom /mnt/cdrom
  • Search for the file system types( iso9600)
  • Allocate a VFS superblock and pass it the mount
    information to the superblock read routine

29
A Mounted File System
30
Unmount a File System
  • Check whether someone is using the FS
  • Check if the File System is dirty
  • write back
  • Return VFS superblock to kernels pool
  • vfsmount is unlinked from vfsmntlist

31
Reference
  • The Linux Kernel
  • Linux ?????
  • http//www.linpus.com.tw
  • http//cat.ice.ntnu.edu.tw
Write a Comment
User Comments (0)
About PowerShow.com