Services for Non-Volatile Storage

Slides:



Advertisements
Similar presentations
More on File Management
Advertisements

File-System Interface
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition File-System Interface.
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Secondary Storage Management Hank Levy. 8/7/20152 Secondary Storage • Secondary Storage is usually: –anything outside of “primary memory” –storage that.
File Systems (2). Readings r Silbershatz et al: 11.8.
CSE 451: Operating Systems Winter 2010 Module 14 File Systems Mark Zbikowski Gary Kimura.
CS 153 Design of Operating Systems Spring 2015 Lecture 20: File Systems.
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Disks. Secondary Storage Secondary Storage Typically – Storage systems outside of “primary memory” – Cannot access data using load/store instructions.
Page 110/19/2015 CSE 30341: Operating Systems Principles Chapter 10: File-System Interface  Objectives:  To explain the function of file systems  To.
File Systems (1). Readings r Reading: Disks, disk scheduling (3.7 of textbook; “How Stuff Works”) r Reading: File System Implementation ( of textbook)
UNIX Files File organization and a few primitives.
CS 153 Design of Operating Systems Spring 2015 Lecture 21: File Systems.
CE Operating Systems Lecture 17 File systems – interface and implementation.
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally FILE SYSTEM.
Lecture Topics: 11/29 File System Interface –Files and Directories –Access Methods –Protection –Consistency.
File Systems - Part I CS Introduction to Operating Systems.
File System Interface CSSE 332 Operating Systems
Jonathan Walpole Computer Science Portland State University
Chapter 2: Computer-System Structures
FileSystems.
Module 10: File-System Interface
COMP 3500 Introduction to Operating Systems File Management
Operating Systems (CS 340 D)
CSE 120 Principles of Operating
File System Implementation
Operating System Structure
Filesystems.
File Management.
CSE 451: Operating Systems Autumn 2001 Module 16 File Systems
Operation System Program 4
File Systems Kanwar Gill July 7, 2015.
CSE 451: Operating Systems Spring 2012 Module 15 File Systems
CSE 451: Operating Systems Spring 2013 Module 15 File Systems
CSE 153 Design of Operating Systems Winter 2018
CE Operating Systems Lecture 21
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
Chapter 10: File-System Interface
CSE 451: Operating Systems Autumn 2004 File Systems
CSE 451: Operating Systems Winter 2007 Module 14 File Systems
Directory Structure A collection of nodes containing information about all files Directory Files F 1 F 2 F 3 F 4 F n Both the directory structure and the.
CSE 451: Operating Systems Autumn 2003 Lecture 13 File Systems
Distributed File Systems
IT 344: Operating Systems Winter 2008 Module 14 File Systems
Distributed File Systems
Secondary Storage Management Brian Bershad
Chapter 10: File-System Interface
Chapter 2: Operating-System Structures
Files Management – The interfacing
Introduction to Operating Systems
CSE 451: Operating Systems Winter 2009 Module 14 File Systems
CSE 451: Operating Systems Winter 2004 Module 14 File Systems
Chapter 15: File System Internals
CSE 451: Operating Systems Winter 2003 Lecture 13 File Systems
CSE 153 Design of Operating Systems Winter 2019
Operating System File-System Interface
CSE 451: Operating Systems Spring 2008 Module 14 File Systems
Secondary Storage Management Hank Levy
CS703 - Advanced Operating Systems
Chapter 16 - File Systems Persistent storage: storage that will continue to exist after a program that uses or creates it completes. Sometimes called secondary.
Module 10: File-System Interface
Chapter 2: Operating-System Structures
Department of Computer Science
CSE 451: Operating Systems Autumn 2009 Module 14 File Systems
CSE 451: Operating Systems Autumn 2010 Module 14 File Systems
Lecture 4: File-System Interface
CSE 451: Operating Systems Autumn 2001 Lecture 13 File Systems
Lecture Topics: 11/20 HW 7 What happens on a memory reference Traps
Chapter 5 File Systems -Compiled for MCA, PU
Presentation transcript:

Services for Non-Volatile Storage Filing Services for Non-Volatile Storage

What does a File System Do? Create/Modify/Delete units of secondary storage (the file) Organize files logically Permit sharing of data between processes, people, and machines may even provide for synchronization via locking Protect data from prying eyes

What’s in a file? A file is an array of bytes with some properties contents, size, owner, last read time, last write time, protection (who, what), parent type understood by file system block, character, device, portal, link understood by other parts of the OS or supporting services executable, dll, source, object, text, jpg type may be encoded in name, or contents NT encodes type in name .com, .exe, .jpg, .dll, .msc UNIX encodes type in contents Magic numbers

Basic File Operations fd = create(filename) fd = open(filename, how) create the named file fd = open(filename, how) returns handle to named file generally involves lots of work to get the file open cc = read(fd, buf, len) read next len bytes into buf from opened file cc = write(fd, buf, len) write len bytes from buf into opened file at current position sync(fd) commit any uncommitted writes seek(fd, pos) adjust “current position” to affect next read or write operation close(fd) release resources for opened file delete(filename) remove the named file from the file system

Key OS Data Structures fd=7 User program fd=3 disk loc, 2 Ref cnt Global info disk loc, 2 Per-process open file table Seek pos, ptr to swoft System-wide open file table

Memory Mapped Files Problem: programs use read and write to transfer data from/to files to/from memory. Once in memory they use load/store to manipulate the data Introduces two serious ineffeciencies programmers have to think about data in two ways is it a file or is it memory data must be copied from the fs into vm and then back Insight: Recall that VM is a client of the FS (demand paging, for example)… generalize to memory mapped files

A Memory Mapped File “/tmp/data” char *base; int len; err = map_file(“/tmp/data”, &base, &len); for (i = 0; i < len;i++) putchar(base[i]); “/tmp/data” File Contents Process Address Space

Directories Directories serve two purposes for users, they provide a structured way to organize related files. for the file system, they provide a convenient naming interface which allows the implementation to hide details about where a file’s particular data item . Most systems support multi-level directories, where a file name describes its path from a root through the directories to the file at the leaf. Most systems have a current directory, from which names can be specified relatively, as opposed to absolutely from the root of the directory tree. Directories are an example of a naming hierarchy. naming hierarchies appear all over in the design of systems. //usr/bershad/Mail

A directory hierarchy / usr tmp config bershad levy Mail src inbox

What’s in a Directory? A directory is simply a list of entries -- names and references to metadata metadata is not the data itself, but information that says how to get the data of course, all of this is stored on disk A B C Three files’ names Three files’ metadata Three files’ data

Getting to There A file system has a root. In UNIX, this is / In NT, there may be many roots, one per logical disk (c:\) The root directory is at a well known place on the disk (never moves) The root directory contains the names of other directories and files. Systems tend to spend a lot of time walking the directory. this is why open is separate from read/write.

File Sharing File sharing has been around since the days of timesharing it was one of the first things missed when we went from timesharing to personal computers. Whether we’re on a network or not, file sharing is incredibly important for getting work done. Two key issues arise when sharing files semantics of concurrent access protection

Protection A protection system allows us to specify WHO can access a file and HOW they can access it More generally, we have Objects, Subjects, Actions A protection system tells us if a given action performed by a given subject on a given object should be allowed. “Johnny can read his email but not delete it.” “Suzy can not read or write Johnny’s email” Johnny Suzie Fred Brian /a /b /c /d rw - r w w - - rw w rw rw - rw rw rw rw objects subjects

Two Key Ways to Represent Protection Access Control List For each object, maintain a list of principals and their permitted actions. Capability For each subject, maintain a list of objects and their permitted actions. Johnny Suzie Fred Brian /a /b /c /d rw - r w w - - rw w rw rw - rw rw rw rw objects subjects The approaches differ only in how we represent the table (and the implications)

In Practice... ACLs are easier to manage “object”-centric easy to grant, revoke ACLs have a problem when objects are heavily shared the ACL gets quite big Groups are pretty effective here. Note UNIX READ-capabilities can be simulated with encryption

Reliability & Availability if you put something there, you can get it back later. backup/restore is a popular mechanism consistency semantics can be quite painful however Availability if you put something there, you can get it back sooner rather than later disk mirroring

Summary OS exports a File System API for use by clients. Key issues yet to be discussed are how this actually gets implemented.