Inodes between subvolumes on a btrfs file system can have the same i_ino.
This messes with hard link detection during our file scan. To fix it, detect
when a file is on btrfs, and query the subvolume id. The filerec tree is
modified to sort on inum, then subvolid and thus we can detect duplicates.

For files not on btrfs, we store st_dev in the same location.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Use gcc built-in atomic operations for increment and fetch of
cur_num_filerecs.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Print the reason we exited with error when we have options incompatible with
--read-hashes or --write-hashes.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Print error when the user specifies both --read-hashes and --write-hashes on
the same command line.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Merge branch 'subvol-checking'
Fix check that dedupe is on btrfs in add_file

This had done the opposite and actually *disabled* dedupe! Thanks to Marcel
Ritter <ritter.marcel@gmail.com> for reporting this bug.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Fix typo in usage: "readble".

Signed-off-by: Aleksej Serdyukov <deletesoftware@yandex.ru>