From 45a2e09fbe8dd9f5fb8dbbf3fbc9a23bc3f6acfe Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Wed, 4 Jun 2014 21:59:33 -0400 Subject: [PATCH] reverse source and destination mount points to match fstab requirements. closes #13 --- README.md | 27 ++++++++++++++++++++++++--- src/option_parser.cpp | 11 +++-------- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8e93fc34..8b643666 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Filesystem calls are broken up into 4 functional categories: search, action, cre #### statvfs #### -Since we aren't trying to stripe data across drives or move them should ENOSPC be return on a write the free space of the mountpoint is just that of the source mount with the most free space at the moment. +It normalizes the source drives based on the fragment size and sums the number of adjusted blocks and inodes. This means you will see the combined space of all sources. Total, used, and free. The sources however are dedupped based on the drive so multiple points on the same drive will not result in double counting it's space. **NOTE:** create is really a search for existence and then create. The 'search' policy applies to the first part. If the [dirname](http://linux.die.net/man/3/dirname) of the full path is not found to exist [ENOENT](http://linux.die.net/man/3/errno) is returned. @@ -41,15 +41,36 @@ Usage ===== ``` -$ mergerfs -o create=epmfs,search=ff,action=ff :: +$ mergerfs -o create=epmfs,search=ff,action=ff ``` +###options### + | Option | Default | |--------|--------| | search | ff | | action | ff | | create | epmfs | +###srcpoints### + +The source points argument is a colon (':') delimited list of paths. To make it simplier to include multiple source points without having to modify your [fstab](http://linux.die.net/man/5/fstab) we also support [globbing](http://linux.die.net/man/7/glob). + +``` +$ mergerfs /mnt/disk*:/mnt/cdrom /media/drives +``` + +The above line will use all points in /mnt prefixed with *disk* and the directory *cdrom*. + +In /etc/fstab it'd look like the following: + +``` +# +/mnt/disk*:/mnt/cdrom /media/drives fuse.mergerfs allow_other 0 0 +``` + +**NOTE:** the globbing is done at mount time. If a new directory is added matching the glob after the fact it will not be included. + Building ======== @@ -60,7 +81,7 @@ Building ``` [trapexit:~/dev/mergerfs] $ make help usage: make -make WITHOUT_XATTR=1 - to build program without xattrs functionality +make XATTR_AVAILABLE=0 - to build program without xattrs functionality (auto discovered otherwise) ``` Runtime Settings diff --git a/src/option_parser.cpp b/src/option_parser.cpp index ab69fea2..b7be3b22 100644 --- a/src/option_parser.cpp +++ b/src/option_parser.cpp @@ -134,15 +134,10 @@ option_processor(void *data, break; case FUSE_OPT_KEY_NONOPT: - if(config.destmount.empty()) - { - rv = 1; - config.destmount = arg; - } + if(config.srcmounts.empty()) + process_srcmounts(arg,config); else - { - process_srcmounts(arg,config); - } + rv = (config.destmount = arg,1); break; default: