Principle you can see on a picture bellow
_________________________________________________________________ _______ | | | | | LOCAL COMPUTER | |REMOTE | | _______________________________________ __________________ | |MYSQL | || KERNEL | | USERSPACE | | |SERVER | || ----------------- -------------- | | ---------------- | | | | || | VFS DRIVER | <-> |CHAR DEVICE |<-|->||USERSPACE DEAMON||<-|->| | || ----------------- -------------- | |----------------- | | | | ||_______________________________________| |__________________| | | | |_________________________________________________________________| |_______|
Most inportant files:
kernel_module/fs_inode.c .. Inode operations
kernel_module/fs_dir.c .. Dir operations
kernel_module/fs_file.c .. File operations
kernel_module/fs_main.c .. Module "main" file (includes module_init() call)
deamon/fsd_main.c .. Deamon main file
deamon/fsd_mysql.c .. Comand to SQL Query implementation
Filesystem was developed and tested on suse linux 10.2.
Supported kernel version is 2.6.18. Small changes are needed for kernel 2.6.16 or 2.6.20 (With this kernel is not possible to build the filesystem)
To buid this you need
You need a standart tool-chain, make, gcc ..., for running you need a MySQL databaze running
run as root script startfs.sh
run as root script filesystemtest.sh
Is quite buggy, but is a way, how to visualize what is going on in th DB. It's not official part of project.
Some other documentation is in directory doc/ Interesting may be espetialy doc/protokol/protokol.txt (protokol between userspace and deamon specification)
All parts are desctibed on the begining of corresponfing .c file
Chardevice is implemented strangely. In some case cases it doesn't behave as a char device but as a block device. See all notes in kernel_module/fsc_device.c if you want to use it for something else than it it was done for.
This is just a seminar work, when you want to MySQL filesystem, it's done much more correctly using fuse. So we didn't waste a time with things like users, hardlinks, softling...
Filesystem offer basic functionalyty, it mean read, write, create/unlink files, create/remove directory. Other operations are not supported and behavior is UNDEFINED (For example chmod seems to work, using generic one, but nothing is written to database, so after unmount all chmod changes are lost. )
We have tested filesystem, but we know abou several bugs. It would be possible to find them but, other groups has moustly read only filesystems. There is no more time to debudd all these problems
There are some details we didnt bring to end, because we know that this fs will never be used in real life.