Accomplishments
- The first major accomplishment was getting device mapper environment working. Device mapper is a layer between file system and block device and it is confiured by a tool called dmsetup in user space. There are some things that needs to be done before using dmsetup command. First you need to have a space for a new partition in the disk and format it to ext4(or other common file systems). Then edit the config file in the kernel to make device mapper as a module(recommend) or build into kernel. Then you can specify a map strategy for example linear map using dmsetup command. In my implementation, we use the simplest way to do dmsetup, just mapping from start bytes to end bytes. Thanks for Sarah's great help which made it a less misserable start for this project.
- The second major accomplishment making a new mapping algorithm, which is dm-statistic and made it can be recognized by dmsetup tool. Sarah suggested me to make is a single file as what she had done before when she did the true-erase work, however I chose a another approach. I made it a part of the dm-mod, because it is a mapping alrgorithm in the same level as dm-linear and dm-stripe.
- The third accomplishment was to deal with procfs. It was easy until I found out that it can not deal with data larger that one page size. Then after some searching and learning online, I finally knew how to do it . Because we need to use a interface called seq_file. By using this interface, it simplify the read operation for procfs fileh however you need to make the data you what want to show in a seris of structured data like array, list or hash. In my implementation, I used list, so the list is consist of all the bios when mapping.
- The next accomplishment was adding control on specific bios. The original plan was to do some modification in file system, focusing on transaction. However it was too complicated to do so I came out with another idea, which is to do it in the some module. When mapping a bio, we do some delay if needed. it was much easier.
- Another accomplishment was made after the presentation. Sarah gave me some very good suggestions to make it more useful, more functional, and more complete, like add reset time function, export some functions and more descriptive on bio structure.
- I finally implemented all the functions as planed.
.