Home

This document is a cache from http://www.nobius.org/~dbg/practical-file-system-design.pdf


Practical File System Design

Document source : www.nobius.org


124
7
J O U R N A L I N G
7.8
What Are Transactions?--A Deeper Look
The operations considered by BFS to be a single atomic transaction are
create a file/directory
delete a file/directory
rename a file (including deletion of the existing name)
change the size of a file (growing or shrinking)
write data to an attribute
delete an attribute
create an index
delete an index
update a file's attributes
Each of these operations typically correspond to a user-level system call. For
example, the
write()
system call writes data to a file. Implicit in that is
that the file will grow in size to accommodate the new data. Growing the
file to a specific size is one atomic operation--that is, a transaction. The
other operations all must define the starting and ending boundaries of the
transaction--what is included in the transaction and what is not.
Create File/Directory
In BFS, creating a file or directory involves modifying the bitmap (to allo-
cate the i-node), adding the file name to a directory, and inserting the name
into the name index. When creating a directory, the file system must also
write the initial contents of the directory. All blocks modified by these
suboperations would be considered part of the create file or create directory
transaction.
Delete
Deleting a file is considerably more complex than creating a file. The file
name is first removed from the directory and the main file system indices
(name, size, last modified time). This is considered one transaction. When
all access to the file is finished, the file data and attributes are removed in a
separate transaction. Removing the data belonging to a file involves stepping
through all the blocks allocated to the file and freeing them in the bitmap.
Removing attributes attached to the file is similar to deleting all the files
in a directory--each attribute must be deleted the same as a regular file.
Potentially a delete transaction may touch many blocks.
Rename
The rename operation is by far the most complex operation the file system
supports. The semantics of a rename operation are such that if a file exists
Practical File System Design:The Be File System
, Dominic Giampaolo
page 124







Summary :

124 7 J O U R N A L I N G 7.8 What Are Transactions?--A Deeper Look The operations considered by BFS to be a single atomic transaction are create a file/directory delete a file/directory rename a file (including deletion of the existing name) change the size of a file (growing or shrinking) write data to an attribute delete an attribute create an index delete an index update a file's attributes Each of these operations typically correspond to a user-level system call.


Tags : system,transaction,directory,name,delete,all,create,data,rename,size,index,operations,filedirectory





Terms    |    Link pdf-search-files.com    |    Site Map
   |    Content Removal Notice   
   |    Contact   

All books are the property of their respective owners.
Please respect the publisher and the author for their creations if their books copyrighted