File System Interface (13) Flashcards

1
Q

File characteristics

A
  • Contiguos inside the logical addr. space
  • Type:
    • Data:
      • Numeric
      • Character
      • Binary
    • Program
  • Contents are defined by creator
    • Many different types available
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

File attributues

A

The informations about the file are stored/kept in the directory structure.

  • Name: human readable
  • Identifier: unique tag to identify the file inside fs
  • type: needed for the system to identify the program with which to open the file
  • location: pointer to location on device
  • Size
  • Protection: permissions
  • Time, date and user id
    • used for permissions, security and for computing statistics.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

File Operations/Primitives

A

Here we mean file as ADT, not the physical object made of electrons.

  • Create
  • Write: at the address specified by the pointer
  • Read: at the address specified by the pointer
  • Reposition: seek
  • Delete
  • Truncate
  • Open(Fi): search che cwd for the file Fi and move the content to memory
  • Close(Fi): move content loaded in memory to disk
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Managing Open Files

A

Structures needed:

  • Open-file table
  • File pointer: pointer to last address of memory written to file
  • File-open count: how many processes have this file opened?
    • Removed open-file table entry when count = 0
  • Disk location of file:
  • Access rights: changes based on process request and the protection attribute of the file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Open file locking

A

Lock types:

  • Shared lock
  • Exclusive lock

Can be mandatory or advisory:

  • Mandatory: system enforces rules
  • Advisory: system advertises rules but doesn’t inforce them, process decide what to do if they see a lock
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Kinds of file structures

A
  • None: flat
  • SImple record structure
    • Lines
    • Fixed len
    • variable len
  • Complex structure
    • Formatted document
    • Relocatable document

Systems can simulate last two using the first method and control characters.

Decision makers:

  • OS
  • Program
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Access methods

A

Files store information used to access their content.

Methods:

  • Sequential
    • Primitives:
      • read next
      • write next
      • reset (go to beginning)
      • Impossible to read
    • Works well on sequential access devices as well as random access ones.
      Simulation on random access device:
      • reset: cp = 0;
      • read next: read cp; cp++;
      • write next: write cp; cp++;
  • Direct
    • File contains X fixed length records that allow programs to jump between the file in constant time.
    • Primitives (n = relative block n.)
      • read (n)
      • write (n)
      • position to (n)
      • rewrite (n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Derived access methods

A
  • Other access methods can be built upon direct-access methods
  • usually this involves making and index for the file to keep in memory for fast access
  • Options for large files: index of index stored on secondary memory
  • IBM indexed sequential access method
    • Small master index, points to disk blocks of secondary index
    • All done by OS
    • File kept sorted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Directory structure

A
  • Collection of nodes containing info about all files and their structure
  • Both residing on disk
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Disk structure

A
  • Disk can be organized in partitions
  • Partitions AKA minidisks, slices
  • Partitions and disks can be protected through RAID
  • Disk and parititions can be used without file system or without being formatted: RAW
  • Volume: entity containing fs
  • Each volume tracks fs statistics and properties inside either:
    • device directory
    • volume table of contents
  • There exist special purpose fs, many fs can coexist on the same machine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Operations on Directory

A
  • Search file
  • Create file
  • Delete file
  • List a directory
  • Rename file
  • Traverse file system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Directory organization

A

Objectives:

  • Efficient file search
  • Convenient file naming
  • Grouping capabilities: by different attributes.

Types:

  • One level
    • One dir for each user
    • Problems:
      • Naming
      • Grouping
  • Two level
    • Separate dir for each user
    • Efficient searching
    • Can have same file name for different users
    • No grouping
  • Tree structured
    • Efficient searching
    • Grouping capability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Acyclic graph directories

A
  • Have shared subdirs and files
  • Dangling pointer:
    • Happens if dict deletes list
    • Solutions:
      • Backpointers
      • Backpointers using daisy chain
      • Entry-hold-count
  • New directory entry type:
    • Link: another name pointer to an existing file
    • Resolve the link follow pointer to locate the file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

General graph directory

A

How do we guarantee no cycles?

  • Allow only links to file not subdirectories
  • Garbage collection
  • Use cycle detection everytime a new link is created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Mounting and Mount point

A

OS is given the name of the device and the mount point.

Typically a mount point is an empty directory.

OS verifies that device has valid file system, by asking the device driver to read the directory and verysing that it has the expected format.

Finally the OS notes in its directory that a file system is mounted at the specified mount point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

File sharing

A
  • Sharing is a desirable feature of a multi-user system
  • May be performed using protection schemes
  • If the OS supports distributed fs, file may be shared accross the file system
  • NFS (Network file systems) is a common one.
  • In multi-user systems:
    • User id
    • Group id
    • Owner of a file
    • Group of a file
17
Q

Remote FS

A

Networking can be used to allow access to remote fs:

  • Manually ftp
  • Auto. using something like NFS
  • Semi-auto using the web

Client server model makes possible mounting remote file system

  • servers can serve multiple clients
  • client and user-on-client id is complicated and insecure
  • NFS is standard UNIX client-server file sharing prot
  • CIFS is standard windows
  • Standard os fs calls are translated into remote calls
18
Q

Fail sharing failure modes

A
  • FS have failure modes to manage corrupted files/directory
  • Remote FS add failure modes to manage connection errors
  • Recovery can involve state information about the state of each remote request
  • Stateless protocols such as NFS v3 include all the informationt in each request
    • easier to recover
    • less secure
19
Q

File Sharing Consistency Semantics

A
  • How many users can access a shared file at the same time?
    • AFS (ANDREW FS)
      • Implements complex remote file sharing semantics
      • Writes only visible to sessions starting after the file is closed
    • UFS (Unix FS):
      • Write open file visible immediately to other users on the same file
      • Sharing file pointer to allow concurrent wr/rd by multiple-users
20
Q

File Protection

A

File owner should be able to control what can be done and by whom.

Access types:

  • Read
  • Write
  • Exectue
  • Append
  • Delete
  • List