×‍×¢×¨×›×•× ×”×¤×¢×œ×”

  • View
    56

  • Download
    0

Embed Size (px)

DESCRIPTION

מערכות הפעלה. תרגול 14 – מערכת קבצים ב- Linux. תוכן התרגול. VFS מהו VFS מערכות קבצים מיוחדות מודל משותף לניהול קבצים - Common File Model אובייקטים של VFS superblock , inode , file object , dentry הרכבה/ניתוק מערכות קבצים mount , unmount פעולות בסיסיות ב- VFS - PowerPoint PPT Presentation

Text of ×‍ערכו×...

  • 14 -Linux

    - 10

  • VFS VFS - Common File Model VFS superblock,inode, file object, dentry/ mount, unmount -VFS (pathname)

    - 10

  • , . . : " . , .

    - 10

  • VFS) Virtual Filesystem Switch) , . VFS . VFS .

    - 10

  • - VFS . -Linux Ext2, Ext3, ReiserFs Unix SysV(System V), UFS(BSD, Solaris) Dos/Windows FAT, NTFS , , ((NFS, AFS , , .

    - 10

  • : . , pipes - sockets :devfs , pipefs - pipes, -pipes .shm sockfs socketsproc

    - 10

  • Common File ModelVFS " Linux Unix (native) Linux. "" VFS. VFS . FAT . , Linux FAT.

    - 10

  • VFS , : superblock object - .inode object . -inode - .file object " .dentry object ( ). " , .

    - 10

  • VFS - VFS , file object file object dentry 1 - 2 (hard link) dentry 3 ( )-dentries inode

    - 10

  • process 1process 2process 3file objectfile objectfile objectdentryobjectdentryobjectinode objectSuperblockobjectdisk filedentry cachefdf_dentryd_inodei_sb

    - 10

  • To link or not to link Linux ( UNIX) 2 links:hard link " ln src dst link ( ) inode srcrm f1 - -hard links inode hard links soft (symbolic) link " ln s src dst , alias symbolic link symbolic link rm f1 ( f1 soft link) link Windows .lnk .lnk .lnk " windows

    - 10

  • Superblock object " superblock.-superblock , '. -superblock . -VFS, . , (- ) :read_inode(), put_super(), remount_fs() ...

    - 10

  • inode Object inode .inode - . inode object -inode . -object inode , -inode . -inode object , , , , , '. ( ). inode , VFS

    - 10

  • File Objectfile object " , . Linux file descriptor -file object .file object -inode-file object -dentry , (, ,...), , '.-file object . -inode object . :read(), write(), llseek() .

    - 10

  • dentry Object dentry , -.: : /tmp/test dentries : / ( )tmp - -"/" test - -"/tmp" ! dentry , . -dentry -inode .-, -dentry -, -.

    - 10

  • -dentries . . dentry . dentries " dentries.

    - 10

  • Mounting - -VFS. (Mounting). . (mount point). (root directory). -VFS (root filesystem). mount() .

    - 10

  • (2) (mount point) , . , .: -/usr/src-Linux . (path).binetcusrincludesrcbinroot filesystem/dev/dsk1 filesystem

    - 10

  • -VFS " unmount() , . .

    - 10

  • shell / shell, . mount ( mount()). mount .mount t type device dir type device dir umount ( unmount()).umount dirDir .

    - 10

  • (pathname): , -inode ? . . -dentry -dentry : ( ).

    - 10

  • (1) , :dentry -dentry mnt -superblock : dentry -mnt -/ ( ), ( current->fs->root) ( ) . ( current->fs->pwd)

    - 10

  • (2) : -inode " dentry -inode . (), (. ) .. ( ), -dentry. dentry. , dentry . -dentry . , mnt , dentry .

    - 10

  • (3) -inode -dentry -dentry ( ). -dentry . ( ) . ( ). dentry dentry , . , -inode -dentry .

    - 10

  • " open(), sys_open().: filename , , [ ] sys_open() , : (pathname) . fd -PDT .Process Descriptor Table / -inode . , inode . file object , . -inode : . f_flags open -file object , . -fd -PDT -file object .

    - 10

  • " close(), sys_close(). -file descriptor . sys_close() , : -file object -PDT , fd. " -NULL. flush -file object, . -file object. flush (" 0)

    - 10

  • " read() -write(), sys_read() -sys_write() . -file descriptor , , . : -file object -fd . -file object ( ). -file object / . . , . .

    - 10

  • Linux :Advisory locking ( ) Mandatory locking read, write, open , leases lease :FL_LOCK " flock()FL_POSIX " fcntl()

    - 10

Recommended

View more >