From ead84869181666b6f09b3e2c8ec30896fa102525 Mon Sep 17 00:00:00 2001 From: Hrushikesh Vaidya Date: Fri, 19 Apr 2024 12:46:20 +0530 Subject: [PATCH] Added CS 162 lec 21 part 1 --- CS162/index.md | 6 +++++- CS162/lec21.md | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 CS162/lec21.md diff --git a/CS162/index.md b/CS162/index.md index 566c9e4..333f6fe 100644 --- a/CS162/index.md +++ b/CS162/index.md @@ -27,4 +27,8 @@ Taught by Prof. John Kubiatowicz at UC Berkeley in Fall, 2020 13. [Lecture 14 - Memory 2: Virtual Memory, Caching and TLBs]({% link CS162/lec14.md %}) 14. [Lecture 15 - Memory 3: Caching & TLBs, Demand Paging]({% link CS162/lec15.md %}) 15. [Lecture 16 - Memory 4: Demand Paging Policies]({% link CS162/lec16.md %}) -16. [Lecture 17 - Demand Paging, General I/O, Storage Devices]({% link CS162/lec17.md %}) \ No newline at end of file +16. [Lecture 17 - Demand Paging, General I/O, Storage Devices]({% link CS162/lec17.md %}) +17. [Lecture 18 - General I/O, Storage Devices, Performance]({% link CS162/lec18.md %}) +18. [Lecture 19 - Filesystems 1: Performance, Queueing Theory, Filesystem Design]({% link CS162/lec19.md %}) +19. [Lecture 20 - Filesystems 2: Filesystem Design, Case Studies]({% link CS162/lec20.md %}) +20. [Lecture 21 - Filesystems 3: Case Studies, Buffering, Reliability, Transactions]({% link CS162/lec21.md %}) \ No newline at end of file diff --git a/CS162/lec21.md b/CS162/lec21.md new file mode 100644 index 0000000..d537f50 --- /dev/null +++ b/CS162/lec21.md @@ -0,0 +1,16 @@ +--- +layout: default +title: "Lecture 20 - Filesystems 3: Case Studies, Buffering, Reliability, Transactions" +parent: UCB CS 162 - Operating Systems and Systems Programming +nav_order: 20 +--- + +# Filesystems 3: Case Studies, Buffering, Reliability, Transactions + +In previous lectures, we saw that a directory is just a file mapping file names to file numbers. There are two such types of mappings - + +1. Hard links - Maps a file name to a file number. The fist hard link is created when the file is created. There can be multiple hard links, and hard links can be created and removed using syscalls like `link()` and `unlink()`. When all hard links to a file are removed, the file is deleted. +2. Soft links - These are also called symbolic links (symlinks). They map a file name to a different file name. + +## Memory Mapped Files +Traditional I/O involves reading and writing to regions of memory on disk, usually with buffers and caches in between. Memory mapping of files is a technique in which we "map" the file into RAM by giving it a virtual address, and then we can use the RAM as a cache without needing buffers, and the RAM is backed by the file in memory. This technique is often used to set up inter process communication. \ No newline at end of file