Presentation is loading. Please wait.

Presentation is loading. Please wait.

Project 4. “File System Implementation”

Similar presentations


Presentation on theme: "Project 4. “File System Implementation”"— Presentation transcript:

1 Project 4. “File System Implementation”
Dong Jin Kim, PhD student

2 Introduction to Projects
Project 1: Setting up Environment for Project Project 2: Linux Fundamental Project 3: System Call and Synchronization Project 4: File System Project 5: Device Driver for Embedded H/W Especially, including “BeagleBoard Development”

3 Contents of Project 4 Task 1. Data encryption on FUSE file system (30%) Task 2. Buffer cache implementation on FUSE file system (30%) Task 3. File system performance evaluation (10%) Report (30%) Explanation about your work Answer to questions

4 FUSE File System What is FUSE?
FUSE : File System in User space General File System is in the Kernel Space Our Goal Simple Buffer Cache Management in FUSE

5 FUSE Install Download provided “fuse tar.gz” from the course home page # wget # tar xf fuse tar.gz # cd fuse-2.9.4 # ./configure # make # make install

6 FUSE Tools # wget # tar xf fuse-tutorial. # cd fuse-tutorial # ./configure # make

7 Use FUSE File System # cd src # mkdir /mnt/fuse # mkdir /root/fuse
# ./bbfs -o direct_io /mnt/fuse /root/fuse # mount Check information Mounting Point Real Dir.

8 General File System File system operation in kernel space User Program
read() write() User Space Kernel Space VFS File System

9 Current FUSE File System
File system operation in user space FUSE bb_read bb_write User Program read() write() read() write() User Space System Call Kernel Space VFS File System

10 Data Encryption Encrypt data using “keys” FUSE User Program read()
Task 1 Data Encryption Encrypt data using “keys” FUSE bb_read bb_write User Program Encrypted data read() write() read() write() User Space System Call Kernel Space VFS File System

11 Simple Encryption and Decryption Method
Task 1 Simple Encryption and Decryption Method Using encryption, only users with correct keys can take correct data Incorrect keys will give incorrect data For each “char” or “byte”, encrypt with … Addition: add a value to original data Right shift: after addition, an amount of bit-shift operation to the data Decryption = reverse of encryption 1 1 2-bit right shift

12 Modify FUSE for Encryption and Decryption
Task 1 Modify FUSE for Encryption and Decryption Modify 2 functions in bbfs.c bb_read Decrypt after pread called bb_write Encrypt before pwrite called With correct keys, correct data should be available With incorrect keys, correct data should not be available How to give encryption keys Create “fuse-tutorial /src/ee516.conf” file First line: two non-negative integer, separated by space or tab(\t) First integer: key for addition The number that should be added to original data Second integer: key for shift The number of bit-shifts for each byte When you mount fuse file system, read this file and take keys If you want to change keys, unmount fuse  modify ee516.conf file  mount fuse

13 Example Result File written in (addition, shift) = (3, 5)
Task 1 Example Result File written in (addition, shift) = (3, 5) Read with (4, 5), (3, 4), and (4, 4), respectively

14 Buffer Cache Implementation
Task 2 Buffer Cache Implementation Add buffer cache Add this FUSE bb_read bb_write Buffer Cache User Program read() write() read() write() User Space System Call Kernel Space VFS File System

15 Modify FUSE for Buffer Cache Implementation
Task 2 Modify FUSE for Buffer Cache Implementation Modify 3 functions in bbfs.c bb_read bb_write bb_release Read and write operations Read Buffer hit Return contents Buffer miss If buffer is full, evict some contents Read from disk and write to buffer Write Write into the buffer Release If there are dirty data of corresponding file in the buffer, write them to the disk

16 Eviction Algorithms to Implement
Task 2 Eviction Algorithms to Implement Implement 2 eviction algorithms 1. Random eviction Choose victim randomly 2. LRU Least Recently Used For buffer hit, entry moves to the head of the queue

17 Specification to Implement the Buffer Cache
Task 2 Specification to Implement the Buffer Cache Do not use O_DIRECT flags for testing the given FUSE file system FUSE doesn’t support O_DIRECT yet “Buffer Cache” should have an array of “chunks” and a linked list Each “chunk” stores 4KB data You can assume that request size is fixed to 4KB The linked list will manage eviction algorithm Buffer Cache Buffer Cache Size : 5MB Don’t care about consistency (for just 1 user) Eviction policy will given as an integer in the second line of “ee516.conf” file 0: no buffer / 1: random eviction / 2: LRU

18 Performance Evaluation
Task 3 Performance Evaluation Use benchmark tool of project 1 Remove all O_DIRECT flags for FUSE Use FILESIZE 10MB Use request size (second parameter of execution) 4096 You can use Run benchmark and analyze Current Linux file system Same as project 1 FUSE with 0. No encryption and no buffer 1. No encryption and random eviction buffer 2. No encryption and LRU buffer 3. Encryption and no buffer 4. Encryption and random eviction buffer 5. Encryption and LRU buffer

19 Questions for the Report
Find answers from your brain, web site, book, Q1. Pros. and Cons. of FUSE file system (against file system in kernel space) Q2. In our encryption, can different key pairs give same encrypted / decrypted data? Why? Q3. List several encryption methods and analyze them. Q4. Why performances of Linux and FUSE file systems are different? Q5. Why performances of different eviction algorithms are different? In which cases each eviction algorithm can have advantage? Specify the references

20 Submission Contents Submission Source codes Report
Implemented and modified codes Include comments in the source codes Report Key points of your source code Do not attach entire source codes in the report Result screenshots Answers of questions Submission Due date: Nov. 28., PM 23:59 Delay penalty 10% per day (AM 00:00) Joo Kyung Ro Title: [EE516 Project 4] student_number Attached file: student_number.zip Various compression format is allowed


Download ppt "Project 4. “File System Implementation”"

Similar presentations


Ads by Google