Develop a user-level File System that keeps its contents in primary memory - TecnicoFS.
The server program must recieve the following four arguments in the command line:
server_name inputfile outputfile numthreads synchstrategy
c /a f -> creates file a on root c /b d -> creates directory b on root c /c f -> creates file c on root l /a -> searches for i-node associated to given path d /a -> deletes i-node a m /c /b/c -> moves i-node /c from root to directory /b
Project divided into 3 iterations:
Execute call sequences loaded from the inputfile. Possible commands:
- Arguments: name type Adds a new entry to the directory, whoose name and type are indicated in the arguments. The type can be either 'd' (directory) or 'f' (file).
- Arguments: name Search the file system for a file or directory with the given name.
-Arguments: name Delete the file or directory with the given name from the file system.
The server must execute operations in parallel, using a thread pool with the number of threads specified by numthreads. The pool is only created after the inputfile has been totally loaded.
The threads' synchronization must be kept by using one of 2 strategies:
Global Mutex (pthread_mutex)
Using a read-write lock instead of a global mutex (pthread_rw_lock)
The strategy to be used is specified using synchstrategy (mutex, rwlock or nosync).
When all operations have been executed, the server must print the execution time and export the final contents of the file system to the outputfile.
In this iteration, the previous synchronization strategies are abandoned and each inode has its own lock.
In this iteration, the inputfile load and the execution of commands are executed in parallel.
- Arguments: pathname1 pathname2 Moves file of directory with name pathname1 into the location specified in pathname2.
The server no longer loads calls from a file. Instead, used a Unix socket of datagram type through which it recieves (and answers to) requests made from "client" processes.
The executable now recieves the following arguments:
server_name numthreads socketname
- Arguments: outputfile Prints the current contents of the file system on the outputfile.