Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MPCS 52030 Project 3: A Simple File Server
IMPORTANT DATES
Due: Saturday, 06/08, by 11:59pm. IF YOU HAVE QUESTIONS
If you have questions about the project, please post to Piazza.
CLARIFICATIONS NOTES
This project can be done with a partner.
BACKGROUND
In this project, you will be developing a working file server. We provide you with only the bare minimal UDP communication code – you have to build the rest. Thus, this project has a bigger design component than the previous projects – so think about your design! And feel free to consult with me or the TA if you have questions.
A BASIC FILE SERVER
Your file server is built as a stand-alone UDP-based server. It should wait for a message and then process the message as need be, replying to the given client.
Your file server will store all of its data in an on-disk file which will be referred to as the file system image . This image contains the on-disk representation of your data structures; you should use these system calls to access it: open(), read(), write(), lseek(), close(), fsync() .
To access the file server, you will be building a client library. The interface that the library supports is defined in mfs.h. The library should be called libmfs.so, and any programs that wish to access your file server will link with it and call its various routines.
ON-DISK FILE SYSTEM
Your on-disk file system structures should be very simple. You should have a simple inode table which consists of 4096 inodes. You should have a data
people.cs.uchicago.edu/~shanlu/teaching/52030_sp19/html/projects/p3.html 1/4
6/1/2019 Project 3: A Simple File Server
region which consists of 4096 data blocks. Each inode should contain a type field (directory or regular file), a size field (number of bytes in the file), a blocks field (number of blocks allocated to the file), and 10 (direct) pointers to data blocks. The data block size is fixed at 4096 bytes, and hence the max file size is 10 * 4096 or 40KB. To track what is allocated and what isn’t, you should also have a couple of bit maps. One bitmap for the inodes, and one for the data blocks.
When your server is started, it is passed the name of the file system image file. If this file does not exist, the file server should create it, and initialize it properly, and force it to disk. Such initialization includes creating a space big enough for the inodes and the data blocks, and initializing a root directory with proper . and .. entries. The root inode number should be 0.