filesystemskerneljournaling

handle, transaction and journal


I was looking at the source 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:-

  1. How are a set of disk interactions grouped into various transactions?
  2. An example of a handle and a transaction, please.

Solution

  • 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.