-
Notifications
You must be signed in to change notification settings - Fork 0
raghavendrasuvvari/U2fs-FileSystem
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Author : Raghavendra Suvvari SBU ID : 109596686 Files included : wrapfs.h, file.c, inode.c, copyup.c, dentry.c lookup.c, mmap.c, super.c, Makefile, ReadMe ABOUT u2fs: ----------- u2fs is a stackable, fan-out, unification file system. u2fs takes two branches - left branch(LB) and right branch (RB) and while mounting it combines these two branches and presents them as a single branch to the user. Here LB has higher priority than RB and LB had R/W permissions where as RB had just READ permissions. So if we have same files/directories names in both LB and RB then after mounting we can see only the contents of the LB with that same name as it has higher priority. u2fs /\ / \ / \ LB RB Here the files in LB and RB will physically be staying in the same underlying location as they were before. The advantage of u2fs is that we can keep the underlying directories separate, which is convenient for software management as well as Live-CDs, but at the same time provide a convenient merged view of the two directories to users. USAGE : ------- Mounting: mount -t u2fs -o ldir=./left/dir,rdir=./right/dir null ./mnt/u2fs Umounting: umount mnt/u2fs where './mnt/u2fs' is the mount point and 'ldir=./left/dir,rdir=./right/dir' are the two directories 'ldir' and 'rdir' which are to be combined and mounted in new file system. Here the device name will be 'null' and we pass the directories as options to 'mount' command which will parse the options and then pass the directories to the file system. Inside the mounted directory (mnt/u2fs) we can use normal file/dir manipulation commands like cp,mv,mkdir,ls etc. Compiling and executing : ------------------------ 'make' will compile and create the 'img' file for the files system which is a loadable module. 'insmod ./fs/wrapfs/wrapfs.ko' will insert this module. And then we can mount the u2fs and use it. mount -t u2fs -o ldir=./left/dir,rdir=./right/dir null ./mnt/u2fs now by going to ./mnt/u2fs directory we can see the contents of ./left/dir and ./right/dir directories. Now we can perform normal operations here in this directory. Unmounting can be done by using 'umount mnt/u2fs' 'rmmod wrapfs' will remove the module. Approach for coding: ------------------- u2fs was developed on top of wrapfs(which is a stackable file system for single branch) code. I have also referenced unionfs code and mirrored some functionalities in u2fs. u2fs was coded by taking the existing wrapfs code and adding functionalities of u2fs in an incremental way. The directories for the branching will be identified by parsing the options. Inode numbers for the files in u2fs will be uniquely generated by using 'iunique' function. we can create/edit the files in filesystem by using any of the file manipulation commands like touch, echo, vim etc. The new files created will be physically created in the LB (as RB has just Read permissions). If we try to create a new file inside the directory of RB then the new file will be created in the LB replacing the existing file in the RB in u2fs. This is called copyup operation. And if we try to delete a file in the RB then the file will be marked as whiteout and it will not be visible to the user in u2fs. --------------------------------------------------------------------------------------------- Below are some of more in detail(in the format of unionfs documentation): Branch Priority: ================ Left branch has higher priority than the right branch. Branch Mode: ============ Left branch has R/W permissions where as Right branch has only Read permissions. Whiteouts: ========== A whiteout removes a file name from the namespace. Whiteouts are needed when one attempts to remove a file on a read-only branch. After unioning both the branches and if anyone tries to delete a file in the right branch which is read only then a whiteout will be created in the left branch and the file in the right branch will be hidden. Duplicate Elimination: ====================== If both the branches have files with the same names then the file in the left branch will be displayed to the user as LB had higher priority than RB. Copyup: ======= If a user tries tries to create newfiles in the RB in the mount point then the file in RB wil be hidden and a newopy of the file will be created in the LB physically.
About
Implementation of a Stackable file system 'U2fs' in Linux Vanilla 3.2.2 Kernel
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published