SlideShare a Scribd company logo
8
Most read
20
Most read
21
Most read
UNIT III
FILE SYSTEM
The Virtual File System (VFS)
• The Virtual File System (also known as the Virtual Filesystem Switch)
is the software layer in the kernel that provides the filesystem interface
to user space programs.
• It also provides an abstraction within the kernel which allows
different files
• The virtual file system (VFS) interface, also known as the v-node
interface, provides a bridge between the physical and logical file
systems. The information that follows discusses the virtual file system
interface, its data structures, and its header files, and explains how to
configure a virtual file system.tem implementations to coexist.
UNIT III.pptx
Role
• Four main objects: superblock, dentries, inodes, files
•
Several processes may have the same file open for reading or writing,
and file structures contain the required information such as the current
file position.
UNIT III.pptx
System Calls
• A system call is a way for programs to interact with the operating
system.
• A computer program makes a system call when it makes a request to
the operating system's kernel.
• System call provides the services of the operating system to the user
programs via Application Program Interface(API).
UNIT III.pptx
Data Structures - Super Block, Inode, File
• Each VFS object is stored in a suitable data structure, which includes
both the object attributes and a pointer to a table of object methods.
• The kernel may dynamically modify the methods of the object and,
hence, it may install specialized behavior for the object.
• The sb_lock spin lock protects the list against concurrent accesses in
multiprocessor systems.
Inode Objects
• All information needed by the filesystem to handle a file is included in
a data structure called an inode.
• A filename is a casually assigned label that can be changed, but the
inode is unique to the file and remains the same as long as the file
exists.
Dentry Objects
• The VFS treats directories as files. In the path /bin/vi, both bin and vi
are filesbin being the special directory file and vi being a regular file.
• An inode object represents both these components.
• Despite this useful unification, the VFS often needs to perform
directory-specific operations, such as path name lookup.
• Path name lookup involves translating each component of a path,
ensuring it is valid, and following it to the next component.
• To facilitate this, the VFS employs the concept of a directory entry
(dentry). A dentry is a specific component in a path. Using the
previous example, /, bin, and vi are all dentry objects.
• The first two are directories and the last is a regular file. This is an
important point: dentry objects are all components in a path, including
files. Resolving a path and walking its components is a nontrivial
exercise, time-consuming and rife with string comparisons. The dentry
object makes the whole process easier.
Dentry Cache
After the VFS layer goes through the trouble of resolving each element
in a path name into a dentry object and arriving at the end of the path, it
would be quite wasteful to throw away all that work.
Instead, the kernel caches dentry objects in the dentry cache or, simply,
the dcache.
• The dentry cache consists of three parts:
• Lists of "used" dentries that are linked off their associated inode via the
i_dentry field of the inode object. Because a given inode can have multiple
links, there might be multiple dentry objects; consequently, a list is used.
• A doubly linked "least recently used" list of unused and negative dentry
objects. The list is insertion sorted by time, such that entries toward the
head of the list are newest. When the kernel must remove entries to reclaim
memory, the entries are removed from the tail; those are the oldest and
presumably have the least chance of being used in the near future.
• A hash table and hashing function used to quickly resolve a given path into
the associated dentry object.
Files Associated with a Process
• A file system is a process of managing how and where data on a
storage disk, which is also referred to as file management or FS.
• It is a logical disk component that compresses files separated into
groups, which is known as directories.
• It is abstract to a human user and related to a computer; hence, it
manages a disk's internal operations. Files and additional directories
can be in the directories.
• Although there are various file systems with Windows, NTFS is the
most common in modern times.
• It would be impossible for a file with the same name to exist and also
impossible to remove installed programs and recover specific files
without file management, as well as files would have no organization
without a file structure.
• The file system enables you to view a file in the current directory as
files are often managed in a hierarchy.
Filesystem Type Registration
• Often, the user configures Linux to recognize all the filesystems
needed when compiling the kernel for her system.
• But the code for a filesystem actually may either be included in the
kernel image or dynamically loaded as a module.
• The VFS must keep track of all filesystem types whose code is
currently included in the kernel.
• It does this by performing filesystem type registration.
• It is the filesystem that is directly mounted by the kernel during the
booting phase and that holds the system initialization scripts and the
most essential system programs.
• Other filesystems can be mounted—either by the initialization scripts
or directly by the users—on directories of already mounted
filesystems. Being a tree of directories, every filesystem has its
own root directory.
• The directory on which a filesystem is mounted is called the mount
point. A mounted filesystem is a child of the mounted filesystem to
which the mount point directory belongs.
Namespaces
• In a traditional Unix system, there is only one tree of mounted
filesystems: starting from the system’s root filesystem, each process
can potentially access every file in a mounted filesystem by specifying
the proper pathname.
• In this respect, Linux 2.6 is more refined: every process might have its
own tree of mounted filesystems—the so-called namespace of the
process.
Mounting and Unmounting
• Mounting a file system attaches that file system to a directory (mount
point) and makes it available to the system.
• The root (/) file system is always mounted. Any other file system can
be connected or disconnected from the root (/) file system.
• When you mount a file system, any files or directories in the
underlying mount point directory are unavailable as long as the file
system is mounted.
• These files are not permanently affected by the mounting process, and
they become available again when the file system is unmounted.
Implementation of VFS System Calls.
• A virtual file system (VFS) or virtual filesystem switch is an abstract
layer on top of a more concrete file system.
•
The purpose of a VFS is to allow client applications to access different
types of concrete file systems in a uniform way.
UNIT III.pptx

More Related Content

PDF
RACF - The Basics (v1.2)
Rui Miguel Feio
 
PPT
Association rule mining
Acad
 
PPTX
FORESTS
MSharmilaDeviITDEPT
 
PPTX
An Introduction to Information Retrieval and Applications
sathish sak
 
PPTX
Fundamentals of Database system - Databases and Database Users
Mustafa Kamel Mohammadi
 
PPTX
Working with xml data
aspnet123
 
ODP
Partitioning
Reema Gajjar
 
PPT
Modern database management jeffrey a. hoffer, mary b. prescott,
BlackIce86
 
RACF - The Basics (v1.2)
Rui Miguel Feio
 
Association rule mining
Acad
 
An Introduction to Information Retrieval and Applications
sathish sak
 
Fundamentals of Database system - Databases and Database Users
Mustafa Kamel Mohammadi
 
Working with xml data
aspnet123
 
Partitioning
Reema Gajjar
 
Modern database management jeffrey a. hoffer, mary b. prescott,
BlackIce86
 

What's hot (7)

PPT
Codd's rules
Mohd Arif
 
PDF
Database Architecture and Basic Concepts
Tony Wong
 
PDF
TOC Solutions-Adi.pdf
AdiseshaK
 
PPTX
Chapter 10 database management
haider ali
 
PDF
Sql commands
Prof. Dr. K. Adisesha
 
PDF
Z4R: Intro to Storage and DFSMS for z/OS
Tony Pearson
 
PPTX
Multimedia:Multimedia compression
St Mary's College,Thrissur,Kerala
 
Codd's rules
Mohd Arif
 
Database Architecture and Basic Concepts
Tony Wong
 
TOC Solutions-Adi.pdf
AdiseshaK
 
Chapter 10 database management
haider ali
 
Sql commands
Prof. Dr. K. Adisesha
 
Z4R: Intro to Storage and DFSMS for z/OS
Tony Pearson
 
Multimedia:Multimedia compression
St Mary's College,Thrissur,Kerala
 
Ad

Similar to UNIT III.pptx (20)

PPT
Vfs
Waqas !!!!
 
PDF
Ch11 file system implementation
Welly Dian Astika
 
PDF
009709863.pdf
KalsoomTahir2
 
PDF
TLPI Chapter 14 File Systems
Shu-Yu Fu
 
DOCX
Linux File System.docx
BhuvanaR13
 
PDF
Introduction One of the key goals for the Windows Subsystem for Li.pdf
anwarfoot
 
PDF
Part 03 File System Implementation in Linux
Tushar B Kute
 
PPT
Unix file systems 2 in unix internal systems
senthilamul
 
PPTX
Operating System File System IMpl lecture19.pptx
SuryaBasnet3
 
PDF
Lect12
Vin Voro
 
ODP
4. linux file systems
Marian Marinov
 
PPT
Linux
keydak11
 
PPTX
File Management & Access Control
YuvrajWadavale
 
PDF
Operating Systems - Implementing File Systems
Mukesh Chinta
 
PDF
1 04 rao
dimitar9
 
PPT
Unit 3 file management
Kalai Selvi
 
PPT
file management_part2_os_notes.ppt
HelalMirzad
 
PPTX
Files and directories in Linux 6
Meenakshi Paul
 
PPT
Presentation on nfs,afs,vfs
Prakriti Dubey
 
PDF
Ch10 file system interface
Welly Dian Astika
 
Ch11 file system implementation
Welly Dian Astika
 
009709863.pdf
KalsoomTahir2
 
TLPI Chapter 14 File Systems
Shu-Yu Fu
 
Linux File System.docx
BhuvanaR13
 
Introduction One of the key goals for the Windows Subsystem for Li.pdf
anwarfoot
 
Part 03 File System Implementation in Linux
Tushar B Kute
 
Unix file systems 2 in unix internal systems
senthilamul
 
Operating System File System IMpl lecture19.pptx
SuryaBasnet3
 
Lect12
Vin Voro
 
4. linux file systems
Marian Marinov
 
Linux
keydak11
 
File Management & Access Control
YuvrajWadavale
 
Operating Systems - Implementing File Systems
Mukesh Chinta
 
1 04 rao
dimitar9
 
Unit 3 file management
Kalai Selvi
 
file management_part2_os_notes.ppt
HelalMirzad
 
Files and directories in Linux 6
Meenakshi Paul
 
Presentation on nfs,afs,vfs
Prakriti Dubey
 
Ch10 file system interface
Welly Dian Astika
 
Ad

Recently uploaded (20)

PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
PDF
Queuing formulas to evaluate throughputs and servers
gptshubham
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPTX
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
B.Tech Data Science Program (Industry Integrated ) Syllabus
rvray078
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
Traditional Exams vs Continuous Assessment in Boarding Schools.pdf
The Asian School
 
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
VinayB68
 
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
Dr. Rahul Kumar
 
Queuing formulas to evaluate throughputs and servers
gptshubham
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
TE-AI-Unit VI notes using planning model
swatigaikwad6389
 
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
dodultrongaming
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
B.Tech Data Science Program (Industry Integrated ) Syllabus
rvray078
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Software Testing Tools - names and explanation
shruti533256
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 

UNIT III.pptx

  • 2. The Virtual File System (VFS) • The Virtual File System (also known as the Virtual Filesystem Switch) is the software layer in the kernel that provides the filesystem interface to user space programs. • It also provides an abstraction within the kernel which allows different files • The virtual file system (VFS) interface, also known as the v-node interface, provides a bridge between the physical and logical file systems. The information that follows discusses the virtual file system interface, its data structures, and its header files, and explains how to configure a virtual file system.tem implementations to coexist.
  • 4. Role • Four main objects: superblock, dentries, inodes, files • Several processes may have the same file open for reading or writing, and file structures contain the required information such as the current file position.
  • 6. System Calls • A system call is a way for programs to interact with the operating system. • A computer program makes a system call when it makes a request to the operating system's kernel. • System call provides the services of the operating system to the user programs via Application Program Interface(API).
  • 8. Data Structures - Super Block, Inode, File • Each VFS object is stored in a suitable data structure, which includes both the object attributes and a pointer to a table of object methods. • The kernel may dynamically modify the methods of the object and, hence, it may install specialized behavior for the object. • The sb_lock spin lock protects the list against concurrent accesses in multiprocessor systems.
  • 9. Inode Objects • All information needed by the filesystem to handle a file is included in a data structure called an inode. • A filename is a casually assigned label that can be changed, but the inode is unique to the file and remains the same as long as the file exists.
  • 10. Dentry Objects • The VFS treats directories as files. In the path /bin/vi, both bin and vi are filesbin being the special directory file and vi being a regular file. • An inode object represents both these components. • Despite this useful unification, the VFS often needs to perform directory-specific operations, such as path name lookup. • Path name lookup involves translating each component of a path, ensuring it is valid, and following it to the next component.
  • 11. • To facilitate this, the VFS employs the concept of a directory entry (dentry). A dentry is a specific component in a path. Using the previous example, /, bin, and vi are all dentry objects. • The first two are directories and the last is a regular file. This is an important point: dentry objects are all components in a path, including files. Resolving a path and walking its components is a nontrivial exercise, time-consuming and rife with string comparisons. The dentry object makes the whole process easier.
  • 12. Dentry Cache After the VFS layer goes through the trouble of resolving each element in a path name into a dentry object and arriving at the end of the path, it would be quite wasteful to throw away all that work. Instead, the kernel caches dentry objects in the dentry cache or, simply, the dcache.
  • 13. • The dentry cache consists of three parts: • Lists of "used" dentries that are linked off their associated inode via the i_dentry field of the inode object. Because a given inode can have multiple links, there might be multiple dentry objects; consequently, a list is used. • A doubly linked "least recently used" list of unused and negative dentry objects. The list is insertion sorted by time, such that entries toward the head of the list are newest. When the kernel must remove entries to reclaim memory, the entries are removed from the tail; those are the oldest and presumably have the least chance of being used in the near future. • A hash table and hashing function used to quickly resolve a given path into the associated dentry object.
  • 14. Files Associated with a Process • A file system is a process of managing how and where data on a storage disk, which is also referred to as file management or FS. • It is a logical disk component that compresses files separated into groups, which is known as directories. • It is abstract to a human user and related to a computer; hence, it manages a disk's internal operations. Files and additional directories can be in the directories.
  • 15. • Although there are various file systems with Windows, NTFS is the most common in modern times. • It would be impossible for a file with the same name to exist and also impossible to remove installed programs and recover specific files without file management, as well as files would have no organization without a file structure. • The file system enables you to view a file in the current directory as files are often managed in a hierarchy.
  • 16. Filesystem Type Registration • Often, the user configures Linux to recognize all the filesystems needed when compiling the kernel for her system. • But the code for a filesystem actually may either be included in the kernel image or dynamically loaded as a module. • The VFS must keep track of all filesystem types whose code is currently included in the kernel. • It does this by performing filesystem type registration.
  • 17. • It is the filesystem that is directly mounted by the kernel during the booting phase and that holds the system initialization scripts and the most essential system programs. • Other filesystems can be mounted—either by the initialization scripts or directly by the users—on directories of already mounted filesystems. Being a tree of directories, every filesystem has its own root directory. • The directory on which a filesystem is mounted is called the mount point. A mounted filesystem is a child of the mounted filesystem to which the mount point directory belongs.
  • 18. Namespaces • In a traditional Unix system, there is only one tree of mounted filesystems: starting from the system’s root filesystem, each process can potentially access every file in a mounted filesystem by specifying the proper pathname. • In this respect, Linux 2.6 is more refined: every process might have its own tree of mounted filesystems—the so-called namespace of the process.
  • 19. Mounting and Unmounting • Mounting a file system attaches that file system to a directory (mount point) and makes it available to the system. • The root (/) file system is always mounted. Any other file system can be connected or disconnected from the root (/) file system.
  • 20. • When you mount a file system, any files or directories in the underlying mount point directory are unavailable as long as the file system is mounted. • These files are not permanently affected by the mounting process, and they become available again when the file system is unmounted.
  • 21. Implementation of VFS System Calls. • A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. • The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way.