UNIT III.pptx

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
1 sur 22

Recommandé

File Management & Access Control par
File Management & Access Control File Management & Access Control
File Management & Access Control YuvrajWadavale
38 vues81 diapositives
Distributed file system par
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
8.8K vues20 diapositives
Ch10 file system interface par
Ch10   file system interfaceCh10   file system interface
Ch10 file system interfaceWelly Dian Astika
204 vues42 diapositives
Windowsforensics par
WindowsforensicsWindowsforensics
WindowsforensicsSantosh Khadsare
3.3K vues111 diapositives
Os6 par
Os6Os6
Os6gopal10scs185
586 vues99 diapositives
2nd unit part 1 par
2nd unit  part 12nd unit  part 1
2nd unit part 1Pavan Illa
168 vues42 diapositives

Contenu connexe

Similaire à UNIT III.pptx

Ch11 file system implementation par
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementationWelly Dian Astika
439 vues58 diapositives
ITFT_File system interface in Operating System par
ITFT_File system interface in Operating SystemITFT_File system interface in Operating System
ITFT_File system interface in Operating SystemSneh Prabha
1.7K vues23 diapositives
De-Anonymizing Live CDs through Physical Memory Analysis par
De-Anonymizing Live CDs through Physical Memory AnalysisDe-Anonymizing Live CDs through Physical Memory Analysis
De-Anonymizing Live CDs through Physical Memory AnalysisAndrew Case
1.5K vues61 diapositives
Course 102: Lecture 27: FileSystems in Linux (Part 2) par
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Ahmed El-Arabawy
1K vues23 diapositives
File system par
File systemFile system
File systemNavin Royal Achakkagari
109 vues87 diapositives
Unit 3 chapter 1-file management par
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file managementKalai Selvi
60 vues69 diapositives

Similaire à UNIT III.pptx(20)

ITFT_File system interface in Operating System par Sneh Prabha
ITFT_File system interface in Operating SystemITFT_File system interface in Operating System
ITFT_File system interface in Operating System
Sneh Prabha1.7K vues
De-Anonymizing Live CDs through Physical Memory Analysis par Andrew Case
De-Anonymizing Live CDs through Physical Memory AnalysisDe-Anonymizing Live CDs through Physical Memory Analysis
De-Anonymizing Live CDs through Physical Memory Analysis
Andrew Case1.5K vues
Course 102: Lecture 27: FileSystems in Linux (Part 2) par Ahmed El-Arabawy
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Unit 3 chapter 1-file management par Kalai Selvi
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
Kalai Selvi60 vues
Access Methods and File System Mounting.pptx par laiba29012
Access Methods and File System Mounting.pptxAccess Methods and File System Mounting.pptx
Access Methods and File System Mounting.pptx
laiba290128 vues
Part 03 File System Implementation in Linux par Tushar B Kute
Part 03 File System Implementation in LinuxPart 03 File System Implementation in Linux
Part 03 File System Implementation in Linux
Tushar B Kute3.4K vues
File system in operating system e learning par Lavanya Sharma
File system in operating system e learningFile system in operating system e learning
File system in operating system e learning
Lavanya Sharma416 vues
Introduction to file system and OCFS2 par Gang He
Introduction to file system and OCFS2Introduction to file system and OCFS2
Introduction to file system and OCFS2
Gang He621 vues
Internal representation of file chapter 4 Sowmya Jyothi par Sowmya Jyothi
Internal representation of file chapter 4 Sowmya JyothiInternal representation of file chapter 4 Sowmya Jyothi
Internal representation of file chapter 4 Sowmya Jyothi
Sowmya Jyothi168 vues

Dernier

SWM L15-L28_drhasan (Part 2).pdf par
SWM L15-L28_drhasan (Part 2).pdfSWM L15-L28_drhasan (Part 2).pdf
SWM L15-L28_drhasan (Part 2).pdfMahmudHasan747870
28 vues93 diapositives
Pull down shoulder press final report docx (1).pdf par
Pull down shoulder press final report docx (1).pdfPull down shoulder press final report docx (1).pdf
Pull down shoulder press final report docx (1).pdfComsat Universal Islamabad Wah Campus
10 vues25 diapositives
fakenews_DBDA_Mar23.pptx par
fakenews_DBDA_Mar23.pptxfakenews_DBDA_Mar23.pptx
fakenews_DBDA_Mar23.pptxdeepmitra8
12 vues34 diapositives
802.11 Computer Networks par
802.11 Computer Networks802.11 Computer Networks
802.11 Computer NetworksTusharChoudhary72015
9 vues33 diapositives
Codes and Conventions.pptx par
Codes and Conventions.pptxCodes and Conventions.pptx
Codes and Conventions.pptxIsabellaGraceAnkers
7 vues5 diapositives
What is Whirling Hygrometer.pdf par
What is Whirling Hygrometer.pdfWhat is Whirling Hygrometer.pdf
What is Whirling Hygrometer.pdfIIT KHARAGPUR
11 vues3 diapositives

Dernier(20)

fakenews_DBDA_Mar23.pptx par deepmitra8
fakenews_DBDA_Mar23.pptxfakenews_DBDA_Mar23.pptx
fakenews_DBDA_Mar23.pptx
deepmitra812 vues
SUMIT SQL PROJECT SUPERSTORE 1.pptx par Sumit Jadhav
SUMIT SQL PROJECT SUPERSTORE 1.pptxSUMIT SQL PROJECT SUPERSTORE 1.pptx
SUMIT SQL PROJECT SUPERSTORE 1.pptx
Sumit Jadhav 11 vues
An approach of ontology and knowledge base for railway maintenance par IJECEIAES
An approach of ontology and knowledge base for railway maintenanceAn approach of ontology and knowledge base for railway maintenance
An approach of ontology and knowledge base for railway maintenance
IJECEIAES12 vues
Machine learning in drug supply chain management during disease outbreaks: a ... par IJECEIAES
Machine learning in drug supply chain management during disease outbreaks: a ...Machine learning in drug supply chain management during disease outbreaks: a ...
Machine learning in drug supply chain management during disease outbreaks: a ...
IJECEIAES10 vues
Machine Element II Course outline.pdf par odatadese1
Machine Element II Course outline.pdfMachine Element II Course outline.pdf
Machine Element II Course outline.pdf
odatadese18 vues
Update 42 models(Diode/General ) in SPICE PARK(DEC2023) par Tsuyoshi Horigome
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Update 42 models(Diode/General ) in SPICE PARK(DEC2023)
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th... par ahmedmesaiaoun
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...
Performance of Back-to-Back Mechanically Stabilized Earth Walls Supporting th...
ahmedmesaiaoun12 vues

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.