File System Concepts in Operating Systems, Thesis of Operating Systems

Various aspects of file systems in operating systems, including file concepts, access methods, directory structure, file sharing, protection, file systems, file types, file structure, access methods, directory structure, and file operations. It also discusses the unix open() and winnt/2000 createfile() functions, file types and extensions, file structure, sequential and direct access files, index and relative files, file system mounting, file sharing, protection, access lists and groups, and directory design goals.

Typology: Thesis

2017/2018

Uploaded on 05/12/2018

saski-mendis
saski-mendis 🇱🇰

1 document

1 / 41

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Silberschatz, Galvin and Gagne 2002
11.1
Operating System Concepts
Chapter 11: File-System Interface
Chapter Outline
File Concept
Access Methods
Directory Structure
File System Mounting
File Sharing
Protection
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29

Partial preview of the text

Download File System Concepts in Operating Systems and more Thesis Operating Systems in PDF only on Docsity!

Silberschatz, Galvin and Gagne

Chapter 11: File-System Interface

Chapter Outline 

File Concept



Access Methods



Directory Structure



File System Mounting



File Sharing



Protection

Silberschatz, Galvin and Gagne

File SystemsFile SystemsFile SystemsFile Systems



File System consists of

A collection of files

A directory structure

(possibly) partitions



Important Issues

File protection

The semantics of file sharing



Note:Note:Note:Note: Historically, operating systems and filesystems have been viewed as distinct entities.



From the perspective of the modern user, thisdistinction is often blurred.

Silberschatz, Galvin and Gagne

2002

File Attributes



Name

  • only information kept in human-readable form.



Identifier – a unique tag (i.e., an internal number)that identifies the file within the file system.



Type

  • needed for systems that support different types.



Location

  • a pointer to file location on device.



Size

  • current file size.



Protection

  • controls who can do reading, writing,

executing.



Time

date

and user identification

  • data for protection,

security, and usage monitoring.



Information about files are kept in the

directory structure

which is maintained on the disk.

Silberschatz, Galvin and Gagne

File Operations



Create



Write



Read



Reposition within file – file seek



Delete



Truncate



Open(

F

i

) – search the directory structure on disk for entry

F

i

, and move the content of entry to memory.



Close (

F

i

) – move the content of entry

F

i

in memory to

directory structure on disk.

Silberschatz, Galvin and Gagne

2002

Claypool Example:

Unix

open()

Under the Hood

int fid = open(“blah”, flags);read(fid, …);

User SpaceSystem Space

stdinstdoutstderr ...

File Structure

File

Descriptor

(whereblocks are)

(attributes)

(index)

(Per process)

(Per device)

Silberschatz, Galvin and Gagne

Claypool Example

: WinNT/

CreateFile()

Returns file object handle:HANDLE

CreateFile

lpFileName

// name of file

dwDesiredAccess

// read-write

dwShareMode

// shared or not

lpSecurity

// permissions

File objects used for all: files, directories, diskdrives, ports, pipes, sockets and console

Silberschatz, Galvin and Gagne

File StructureFile StructureFile StructureFile Structure



File types may be used to indicate the internalstructure of a file.



An OS may require

require

require require a file to have a specific structure

so that the OS will provide special operations for thosefiles conforming to the set of system-supported filestructures.

e.g., VMS supported three defined file structures.

Others (UNIX, MS-DOS) support a minimal

minimalminimalminimal number of file

structures.



This is an obvious tradeoff between flexibility andsystem support!

Silberschatz, Galvin and Gagne

Access Methods



Access methods determine the way that files areaccessed and read into memory.



Some systems only

only

only only support one access method while

other OS’s support many access methods.



Sequential Access

The most common method used by editors andcompilers.

Information is processed in order.

read nextwrite nextreset no

read after last write

(rewrite)

Silberschatz, Galvin and Gagne

Direct Access File



File is made up of fixed-length logical records thatallow programs to read and write records in noparticular order.



The files is viewed as a numbered sequence ofblocks or records.



Very useful in databases.



Direct Access

n

= relative block number}

read nwrite nposition to n

read nextwrite next

rewrite n

Silberschatz, Galvin and Gagne

Simulation of Sequential Access on a Direct-access File

Silberschatz, Galvin and Gagne

Directory StructureDirectory StructureDirectory StructureDirectory Structure



Partitions (or Volumes) – can be viewed as theabstraction of virtual disks.

virtual disks.virtual disks.virtual disks.



Disks can be partitioned into separate areas such thateach partition is treated as a separate storage device.



The other way --

a partition may be defined to be more

moremoremore

than onethan onethan onethan one disk device.



Partitions can store multiple

multiple

multiple multiple operating systems such that

a system can boot more than one OS.



Each partition contains information about files in adevice directorydevice directorydevice directorydevice directory (or a VTOC

VTOCVTOCVTOC – Volume Table of Contents).



Each directory records file attribute information.

Silberschatz, Galvin and Gagne

Directory Structure



A collection of nodes containing information about allfiles.

F 1

F 2

F 3

F 4

F n

Directory

Files

Both the directory structure and the files reside on disk.Backups of these two structures are kept on tapes.

Silberschatz, Galvin and Gagne

Information in a Device Directory



Name



Type



Address



Current length



Maximum length



Date last accessed (for archival)



Date last updated (for dump)



Owner ID (who pays)



Protection information (discuss later)

Silberschatz, Galvin and Gagne

Directory Operations



Search for a file

- need to find a particular entry or

be able to find file names based on a pattern match.



Create a file -

and add

add

add add its entry to the directory.



Delete a file

- and remove

remove

remove remove it from the directory.



List a directory –

list both the files in the directory

and the directory contents for each file.



Rename a file –

renaming may imply changing the

position of the file entry in the directory structure.



Traverse the file system –

the directory needs a logical

structure such that every directory and every filewithin each directory can be accessing efficiently.

efficiently.efficiently.efficiently.