Import changes from Joshua Charles Campbell <joshua2@ualberta.ca>,
found in joshua-perf-fixes branch.

- Walk duplicate block list and only compare files when they share a
  duplicate block. This fixes the n^2 behavior in our code to pick
  files for comparison.

- walk_dupe_block() was only checking whether it had seen the new
  block. It needed to check the original file block for the same
  condition. This reduces unnecessary comparisons.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Import changes from Joshua Charles Campbell <joshua2@ualberta.ca>,
found in joshua-perf-fixes branch.

- In find_all_dups skip a comparison if the 2nd block we're looking at
  has already been used in any comparison.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Import changes from Joshua Charles Campbell <joshua2@ualberta.ca>,
found in joshua-perf-fixes branch.

- Handle partial writes in csum_whole_file
  - Fix a bug in the original patch where we didn't catch EOF properly (Mark)

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
- initialize b_seen in insert_hashed_block

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Merge branch 'merge-joshua-perf-fixes'