handle, transaction and journal
I was looking at the source 开发者_StackOverflow社区code for the implementation of journaling in ext3 and I came across the types handle_t
, transaction_t
and journal_t
.
handle_t
represents a single atomic update being performed by a process. transaction_t
represents a compound set of atomic updates and journal_t
maintains all journaling information for a single filesystem.
I have the following doubts:-
- How are a set of disk interactions grouped into various transactions?
- An example of a handle and a transaction, please.
Few examples to explain few scenarios.
A. Move one file one one place to another in same filesystem.
This will have several tasks
a. make entry into new directory file
b. Delete entry from old file
In this A
is transaction and a,b
are handles.
B. Writing to a file
Tasks involved are
a. changing content of the changed block.
b. change last modified time in inode.
In this B
is transaction and a,b
are handles.
精彩评论