





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






n File headers (or i-nodes) n File headers point to file data blocks
n For large files, file headers point to Indirect blocks n Directories are special files: a table mapping names to i-node numbers n Bitmap for free blocks n Bitmap for i-nodes (to remember which i-nodes have been allocated)
File Header
File Contents
No guarantee blocks are written to disk in any order. Sometimes meta-data consistency is good enough
How should vi save changes to a file to disk? Wrong: delete old version, create new version
Correct: Write new version in temp file Move old version to another temp file Move new version into real file Unlink old version
If crash, look at temp area; if any files out there, send email to user that there might be a problem.
n Atomic : either happens or it does not (no partial operations) n Serializable : transactions appear to happen one after the other n Durable : once it happens, stays happened
Critical sections are atomic and serializable, but not durable
Need two more terms to describe transactions: Commit --- when transaction is done (durable) Rollback --- if failure during a transaction (means it didn’t happen at all)
Begin transaction x = x + 1 y = y – 1 Commit
n A log is like a journal, never erased, record of everything you’ve done n Once both changes are on log, transaction is committed. n Then can “write behind” changes to disk --- if crash after commit, replay log to make sure updates get to disk
Begin transaction Lock x, y x = x + 1 y = y – 1 Unlock x, y Commit