sheep: remove cache object for discard operation

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep: don't trim before calculating sha1

Trim the object before getting sha1 don't give us much benefit because
1. Most of objects can't be trimmed
2. Require farm to trim the object again
   - need malloc() tmp space for the trim

This is all about sha1ing more bytes vs triming the object, which is faster.
Both will take cpu cycles and no big win one over another.

Without triming the object, farm gets life easier.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
farm: clean up trunk.c

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
farm: slice.c proper

Slice is a fixed chunk of one object to be stored in farm. We slice
the object into smaller chunks to get better deduplication.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
farm: use slice_{read, write} to read/write object

For a test with 200M cluster with 2 copies (so roughly 100M data to backup),
I got the following resualt:

                   size  time
w/ slice (64K)  :  51M   2.037s
w/ slice (128K) :  53M   1.223s
w/ slice (256K) :  57M   1.216s
w/ slice (512K) :  61M   1.205s
w/o slice (4M)  :  97M   1.174s

This is why I choose 128K as slice size.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
collie: move show_progress to common.c

- support non-vdi user

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
farm: show progress bar for load/save operations

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
cache: add more debug info to push_cache_object()

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
collie: don't use direct write for 'vdi snapshot'

- also remove an unnecessary tag check

Direct write will ask cache layer to flush_and_delete cache blindly
(set create = 1), which will be a time consuming process and lead
'collie vdi snapshot' easily timeout and cause unexpected behavior thereafter.

Use non-direct write to be cache friendly. 'collie vdi snapshot' will be boosted
a lot with cache enabled.

Signed-off-by: Liu Yuan <namei.unix@gmail.com>