matteoserva / MegaFuse

MEGA client for linux, based on FUSE
Other
249 stars 79 forks source link

Implementation of extended attributes and symlinks #35

Closed NachE closed 8 years ago

NachE commented 9 years ago

I have been working on an implementation of (non-volatile) extended attributes and symlinks to give MegaFuse the hability to work with glusterfs.

NachE commented 9 years ago

Just to add more info about this PR:

This code have a serializer/unserializer that save symlinks and xattr on .megafuse_symlink and .megafuse_xattr respectively. The xattr are saved on a binary way to preserve the exact values of extended attributes, and the symlinks are saved on plain text in the way path1:path2\n.

The binary way is in format [INT][CHAR][INT][CHAR]... The INT portion say us the size of next CHAR portion, so we have: [SIZE_OF_PATH][PATH][SIZE_OF_NAME][NAME][SIZE_OF_VALUE][VALUE] etc...

I have been add a MegaFuse::maintenance function with a loop wich watch for new needed serialization. Also, I have been needed to change MegaFuseModel::write to add capability of write files with O_APPEND flag (let we save a various chunks of data on same file and in a different moments)

I also add MegaFuseModel::releaseNoThumb because when the serializer save the file, we dont need a thumb generator.