26-filesystem-part1 - CS241 Systems Programming Filesystem...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
  1 CS241 Systems Programming Filesystem  Yoann Padioleau
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  2 What is a filesystem (file system)? Wikipedia definition: « a  method  for  storing  and  organizing   computer files and the data they contain to make it  easy to  find  and access them »  Why need a filesystem ? Compare fd=open(« / home / pad / cs241 / fs.ppt »,…) With « get blocks 45 to 2023 of first scsi disk » So far we have seen mainly  file content  syscalls. What about  other aspects ? What about  files organization  ?
Background image of page 2
  3 A filesystem = virtual filing system Like in  physical  world, the  “best” method to organize  virtual  data so far is to use  folders  and  labels  (names) directories  and  sub- directories Hierarchical filesystem
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  4 Table of contents Interface (user side) Files Directories, sub-directories Paths, absolute, relative Data, meta-data Links, hard links, symbolic links Mount, NFS Access control Implementation (kernel and hardware side) Disk properties Allocation Disk layout, directory format, inode table Mount table, VFS Fault tolerance, fsck Putting it together: booting and the Big Bang
Background image of page 4
  5 “/” bin dev lib etc home usr pad erik jim dude guy .emacs bin tmp root A typical  UNIX  directory hierarchy Legend: cs241 fs1.ppt syscalls.ppt file Sub-directory directory File Directory Path path (absolute) Belongs to path (relative)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
  6 Path path  is a description to locate a file or directory, composed  of possibly multiple directories, e.g  «  / home / pad / foo.txt  » The directory separator symbol: «  »            (and «  » under  microsoft windows) Two kinds of path: Absolute  path, starts with  (e.g.  / a / b / foo.txt ) Relative  path, does not start with  (e.g  b / foo.txt )   and is  relative to the  working directory  (see how change it later) Why need two kinds of path in API ?
Background image of page 6
7 Path bis Two special entries in each directory:  « . » for  this  directory  « . . » for the  parent  directory (e.g  open(« . . / .. / tmp / foo.txt, O_READ) Why need those 2 entries ? More consistent. No need special function to get parent, just access a directory  entry like any other directory entry cd . .   really like   cd adirectory As a  user  you can not care about this and use a file exporer instead of a  shell to navigate, but as a  programmer  you need to deal with that What is the « . . » For the  root  directory ? « .
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/04/2008 for the course CS 241 taught by Professor Systemsprogramming during the Spring '08 term at University of Illinois at Urbana–Champaign.

Page1 / 29

26-filesystem-part1 - CS241 Systems Programming Filesystem...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online