Re: [RFC PATCH v5 5/5] Btrfs: online data deduplication

2013-08-01 Thread Zach Brown
> So do you mean that our whole hash value will be (key.objectid + bytes) > because key.objectid is a part of hash value? I think so, if I understood your question. The idea is to not store the bytes of the hash that make up the objectid more than once so the tree items are smaller. For example:

Re: [RFC PATCH v5 5/5] Btrfs: online data deduplication

2013-08-01 Thread Liu Bo
On Wed, Jul 31, 2013 at 03:50:50PM -0700, Zach Brown wrote: > > > +#define BTRFS_DEDUP_HASH_SIZE 32 /* 256bit = 32 * 8bit */ > > +#define BTRFS_DEDUP_HASH_LEN 4 > > + > > +struct btrfs_dedup_hash_item { > > + /* FIXME: put a hash type field here */ > > + > > + __le64 hash[BTRFS_DEDUP_HASH_LE

Re: [RFC PATCH v5 5/5] Btrfs: online data deduplication

2013-07-31 Thread Zach Brown
> +#define BTRFS_DEDUP_HASH_SIZE 32 /* 256bit = 32 * 8bit */ > +#define BTRFS_DEDUP_HASH_LEN 4 > + > +struct btrfs_dedup_hash_item { > + /* FIXME: put a hash type field here */ > + > + __le64 hash[BTRFS_DEDUP_HASH_LEN]; > +} __attribute__ ((__packed__)); The handling of hashes in this