Advanced Operating Systems (9 CFU)
MS Degree in Computer Engineering
Academic Year 2018/2019
Lecturer: Francesco Quaglia
The examination requires fulfilling the development of a Linux kernel subsystem compliant with the following specification:
Lets' suppose that this pathname is dir-A, then for any file F in dir-A the device driver enables creating a sessioned file F in another directory whose pathname will be dir-B. This pathname can be selected by the software designer.
The device driver must support creation and removal of sessioned files with arbitrary names in/from dir-B.
When a sessioned file F in dir-B is opened, a new incarnation of its content is created, which is filled with the content of the corresponding file F in dir-A. However, its update operations must not be immediately visible in the corresponding file F in dir-A (or in other files). These updates must be flushed to F in dir-A only upon the closure of an I/O session on the sessioned file F residing in dir-B. In other words, all the update operations on the sessioned file F remain volatile up to its closure. This is the so called "session based file access semantic", as opposed to the classical UNIX based semantic where any update on a file performed in an I/O session in are made visible to other I/O sessions on the same file.
If upon the closure of a sessioned file, the corresponding file F in dir-A no longer exists, then the closing process must receive the SIGPIPE signal. Similarly, if upon opening a sessioned file the corresponding file kept in dir-A does (no longer) exist, then opening the sessioned file will result in an error.
Sessioned files in dir-B must support at least the following set of file-operations:
Concurrent I/O sessions on files in dir-B must be allowed, as well as concurrent operations on a same I/O session, as usual for files in Linux. On the other hand, atomicity of the concurrent operations must still be guaranteed.
Finally, when a sessioned file is opened and an incarnation of its content is created, the content needs to be filled atomically with respect to the closure of another incarnation of the same file (which flushes the content of the sessioned file to the original file in the dir-A directory). The same is true for concurrent closures of the different incarnations of a sessioned file.