This past week has been quite productive as regards my SoC project, tmpfs, although at the beginning I was a bit stalled (and afraid of not knowing how to solve the problems I had).

I started trying to fix the rmdir operation, which was broken since its addition. Thanks to the dedicated test machine, I was able to discover the point of failure quite easily because it panic'ed long before the iBook did. Solving the issue was not easy, though, as I didn't have some concepts clear (which the nice guys at tech-kern@ quickly clarified after my post). The thing is that I had serious issues with vnode allocation (duplicate vnodes for a single real file) and node removal (which can only happen after a reclaim operation).

While doing the above, I also implemented vnode locking, which I thought could be causing some of my problems too. This was really complex to get right (and I still have my doubts about its correctness), because the locking protocol is not consistent across different calls. I also found that some parts of the vnodeops(9) manual page are inconsistent with existing code in this area.

When I got this working correctly, I continued adding vnode operations. I saw it was time to start dealing with files, so I implemented file creation, removal, renaming and hard-linking. I was excited to see that, since I already learned the basics, writing these was not too difficult.

Furthermore, I've also done multiple bug fixes all around. For example, I solved the assignment of ownerships and modes of new files (and directories), simplified the unmount operation (to not use a recursive algorithm that could crash the kernel), solved problems with file-names including trailing slashes and fixed hard link counts.

Lastly, but not least, I've also added several new regression tests to ensure that all the new functionality works and that the problems that were solved do not reappear, and have reorganized their code so that code duplication is minimal. Some of the improvements include code to execute some parts of the tests as regular users, basically to verify that ownerships get correctly assigned... which makes me think I should update the project page to describe how to use this functionality.

So, summarizing: at the moment the file-system basically supports: creation, removal, renames and moves of directories and files, hard-linking of files and gets and sets of their attributes (ownerships, flags and mode). It's probably time to start to deal with the read and write operations... that is, to learn something about UVM...