[MYSQLFS - Linux VFS driver using userspace deamon - Programmers Documentation]

version 1.0

This is implementation of linux filesystem driver storing data to a mysql database. it uses userspace deamon to comunicate with DB. It was written as semestral work for subject "Operacni systemy" (Operating systems) on MFF UK, Czech Republic by team Michal Ficek, Michal Podzimek, Tomas Pop in year 2007.

Principle you can see on a picture bellow

  _________________________________________________________________    _______
 |                                                                 |  |       |
 |                      LOCAL COMPUTER                             |  |REMOTE |
 | _______________________________________    __________________   |  |MYSQL  |
 ||  KERNEL                               |  | USERSPACE        |  |  |SERVER |
 || -----------------     --------------  |  | ---------------- |  |  |       |
 || | VFS DRIVER    | <-> |CHAR DEVICE |<-|->||USERSPACE DEAMON||<-|->|       |
 || -----------------     --------------  |  |----------------- |  |  |       |
 ||_______________________________________|  |__________________|  |  |       |
 |_________________________________________________________________|  |_______|


Most inportant files:

See also:
kernel_module/fsc_device.c .. Char device implementation

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

Software requirements

Filesystem was developed and tested on suse linux 10.2.

Kernel version

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)

Libraries and sources needed

To buid this you need


You need a standart tool-chain, make, gcc ..., for running you need a MySQL databaze running

How to install and runn


Filesystem module and deamon

run as root script startfs.sh


run as root script filesystemtest.sh

Some Implementation Notes

PHP frontend

Is quite buggy, but is a way, how to visualize what is going on in th DB. It's not official part of project.

Other documentation

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

Char device implementation

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.

Functionality of the filesystem SOME WARNINGS

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. )

Known bugs

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

Opened questions

There are some details we didnt bring to end, because we know that this fs will never be used in real life.

Generated on Mon May 28 13:33:08 2007 for MYSQLFS by  doxygen 1.5.0