Linux Virtual Filesystem

Slides:



Advertisements
Similar presentations
Chapter 12: File System Implementation
Advertisements

Concepts about the file system 2. The disk structure 3. Files in disk – The ext2 FS 4. The Virtual File System (c) 2013, Prof. Jordi Garcia.
File Systems.
A Guide to Unix Using Linux Fourth Edition
Introduction to Unix (CA263) File System
Linux+ Guide to Linux Certification, Second Edition
The UNIX File System.
Lecture 17 FS APIs and vsfs. File and File Name What is a File? Array of bytes. Ranges of bytes can be read/written. File system consists of many files,
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Fourth Edition
Rensselaer Polytechnic Institute CSCI-4210 – Operating Systems David Goldschmidt, Ph.D.
Manage Directories and Files in Linux
CS 6560 Operating System Design Lecture 13 Finish File Systems Block I/O Layer.
CSCC69: Operating Systems Assignment 3 Review. Assignment Review Implement the file-related system calls – open, close, dup2 – read, write, lseek – chdir,
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Linux+ Guide to Linux Certification, Second Edition
SIMULATED UNIX FILE SYSTEM Implementation in C Tarek Youssef Bipanjit Sihra.
Chapter Two Exploring the UNIX File System and File Security.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials– 8 th Edition Chapter 10: File System Implementation.
Linux File Systems Presented by: Lloyd Brown, James Frazee, & Travis Wertz.
Chapter 5 File Management File System Implementation.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Interfacing Device Drivers with the Kernel
Chapter 10: File-System Interface Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 1, 2005 File-System Interface.
Chapter 12 File Management Patricia Roy Manatee Community College, Venice, FL ©2008, Prentice Hall Operating Systems: Internals and Design Principles,
Lecture 19 Linux/Unix – File System
CSCC69: Operating Systems Tutorial 10. Hints on testing Assignment 3 How to test tlb replacement algorithms? – Write a program that creates an array larger.
Fall 2013 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO
CSC 660: Advanced Operating SystemsSlide #1 CSC 660: Advanced OS Virtual Filesystem.
1 The File System. 2 Linux File System Linux supports 15 file systems –ext, ext2, xia, minix, umsdos, msdos, vfat, proc, smb, ncp, iso9660, sysv, hpfs,
MINIX Presented by: Clinton Morse, Joseph Paetz, Theresa Sullivan, and Angela Volk.
LINUX Zhengli Zhu, School of Life Sciences. Outline 1. ABC of Linux 2. Basic orers of Linux 3. Bash Programming.
Processes David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
BILKENT UNIVERSITY DEPARTMENT OF COMPUTER TECHNOLOGY AND INFORMATION SYSTEMS CTIS156 INFORMATION TECHNOLOGIES II FILES AND FILE SYSTEM STRUCTURE.
Linux Filesystem Management
Getting Started with Linux
Day 28 File System.
File System Examples Unix Fast File System (FFS)
EXT in Detail High-Performance Database Research Center
Week Fourteen Student name: Mike Gallagher
Chapter 11: File System Implementation
How & When The Kernel Runs
Midterm Review Chris Gill CSE 422S - Operating Systems Organization
Chapter 12: File System Implementation
Midterm Review David Ferry, Chris Gill
Day 27 File System.
Linux Pipes and FIFOs David Ferry, Chris Gill
Processes David Ferry, Chris Gill
Process Realization In OS
Overview of the Lab 2 Assignment: Linux Scheduler Profiling
Filesystems.
Overview of the Lab 3 Assignment: Kernel Module Concurrent Memory Use
Semester Review Chris Gill CSE 422S - Operating Systems Organization
Chapter 12: File System Implementation
The Linux Command Line Chapter 2
Subject Name: Operating Systems Subject Code:10CS53
Exploring the UNIX File System and File Security
Chapter 12 File Management
CSE 451: Operating Systems Spring 2006 Module 12
Chap 4: Distributed File Systems
CSE 451 Fall 2003 Section 11/20/2003.
Midterm Review Brian Kocoloski
Chapter 15: File System Internals
How & When The Kernel Runs
Semester Review Brian Kocoloski
Processes David Ferry, Chris Gill, Brian Kocoloski
User-level Memory Chris Gill, David Ferry, Brian Kocoloski
Presentation transcript:

Linux Virtual Filesystem Chris Gill and James Orr CSE 422S - Operating Systems Organization Washington University in St. Louis St. Louis, MO 63130

CSE 422S – Operating Systems Organization Linux VFS Layer Kernel-wide filesystem view Superblock (struct super_block) describes a filesystem, provides operations the OS can use Each superblock has a list (in its s_list field) of superblocks for all available file systems It also keeps lists of index nodes, directory entries, files Process-specific filesystem view Process’ task_struct points to 3 filesystem structs Field fs points to a filesystem structure (struct fs_struct) Field files points to open files table (struct files_struct) Field nsproxy points to a wrapper for its namespace, etc. Each of these has further structure we will look at next CSE 422S – Operating Systems Organization

Linux Process’ Views of Filesystem Fields in the process’ task_struct point to key filesystem structs The new nsproxy field points to a nsproxy struct that wraps a pointer to the filesystem’s namespace (mnt_namespace) The files field points to a table of process’ open files The fs field points to a filesystem structure that points to paths for the process’ root and current working directories current task_struct nsproxy fs files nsproxy files_struct mnt_namespace fs_struct root pwd CSE 422S – Operating Systems Organization

Paths and Directory Entries Each path points to a VFS mount structure (vfs_mount) and a directory entry (dentry) structure (filesystem+directory) A VFS mount structure describes a specific filesystem instance (a “mount point”) A directory entry structure describes any element in the filesystem (directory or file, though in a path it’s a directory) current task_struct fs fs_struct root pwd path mnt dentry Vfs_mount dentry CSE 422S – Operating Systems Organization

Directory Entries and Index Nodes Each directory entry points to an associated index node (inode) that contains metadata about the directory entry Last access time, permissions, etc. E.g., what you see with ls command Index nodes also implement operations the superblock uses Each directory entry also has a character array field (d_iname) that contains its name dentry ‘/’ \0 d_iname ... d_inode inode CSE 422S – Operating Systems Organization

Directory Entry Hierarchy A directory’s dentry lists other directory entries that it contains Stored in its d_subdirs field List iteration requires special operations (see LKD Chapter 6) E.g., list_empty(), list_for_each(), list_for_each_entry(), etc. Can use those operations to traverse a path (or an entire filesystem) recursively via the directory entry hierarchy dentry d_iname ‘/’ \0 ... d_subdirs ... dentry d_iname ‘b’ ‘i’ ‘n’ \0 ... d_subdirs ... ... dentry d_iname ‘l’ ‘s’ \0 ... d_subdirs (empty) CSE 422S – Operating Systems Organization

Studio Exercises Today Create a kernel module with a single thread Runs in kernel space, in process context Has access to filesystem, but details differ a bit from the view a user-space process has Kernel thread can get PID for a user-space process, get its task_struct and see its filesystem view Explore different file system data structures Working from process to filesystem structure to root and working directory paths, to dentrys, etc. Looking at directory entries specifically as you go CSE 422S – Operating Systems Organization