About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default iconFL-COW Publisher's description

The File Link Copy On Write library

The FL-COW library born to solve a problem I had when working with the Linux Kernel archives that I use to replicate using hard links. Replicating archives with hard links is both fast and space saving, and it helped me a lot in speeding up my operations when working on the kernel source.

A recent Arch's mailing list thread that suggested that use of hard links to create archive cached revisions pushed me to write the FL-COW library. What is the problem with hard links when, for example, I'm working with kernel sources? The problem is that I do a:

cp -al linux-2.6-test6 linux-2.6-test6.vm-fix

This command replicate at light speed the vanilla (Linus) archive into an archive I can start hacking on. The problem is that I have to manually remember to break hard links on files I start working on, otherwise even the original copy get modified.

This might break because I forgot doing so and it might also break because other tools might eventually touch file they were not supposed to touch. If it happens that I forget to decouple a file hard link, the next command:

diff -Nru linux-2.6-test6 linux-2.6-test6.vm-fix

will skip all changes done on the file I forgot, because my changes has been applied to the original file also. The library works by intercepting all file open operations happening inside a configured path list, and by decoupling the hard link with a COW if a write operation is requested.

The library is installed using the environment variable LD_PRELOAD and in this way it is able to hook glibc open(2) functions and it is able to perform the COW when necessary. The environment variable FLCOW_PATH control which paths should be subject to COWing. The logic that the library follow to know if a file should be COWed is the following:

Is the file being opened with O_RDWR or O_WRONLY modes?
Is the file inside one of the paths listed inside the FLCOW_PATH environment variable?
Is the file being opened a regular file?
Is the (struct stat)->st_nlink variable greater than one?

If all those answers are yes, the file is COWed by leaving the calling application with a non hard linked version of the file. To setup the library you must start with building it doing a (for example):

./configure --prefix=/usr
make check
make install

If all those steps complete correctly you will have your library installed in /usr/lib/libflcow.so that is ready for use. I use to set the LD_PRELOAD inside my .bashrc file so that I am sure that no tool will screw up my hard-linked archives.

This is the relevant section of my .bashrc file:

export LD_PRELOAD=/usr/lib/libflcow.so:$LD_PRELOAD
export FLCOW_PATH=/usr/src/:/home/davide/arch-archives/

System Requirements:

No special requirements.
Program Release Status:
Program Install Support: Install and Uninstall

FL-COW Tags:

Click on a tag to find related softwares

Is FL-COW your software?

Manage your software

Most Popular

linux default icon JOrg 0.93 RC
It's a software to help you control your files and their location.
linux default icon Android HTC 2.3
Android ported to the HTC Vogue, Kaiser, Polaris, and Nike.
linux default icon iReport Designer for JasperReports 4.0.2
iReport is the free, open source report designer for JasperReports.
linux default icon jGRASP 1.8.8_07 Beta
jGRASP is a lightweight development environment,.....
linux default icon Code::Blocks 10.05
A C/C++ IDE built with configurability and extensibility in mind

Related Category

» Archiving (73)
» Benchmarking (88)
» Other (3482)
» Printer (63)
» Shell Tools (113)