Commit 21a4989d authored by Chris Mason's avatar Chris Mason

Btrfs: Hash in the offset and owner for file extent backref keys

This makes searches for backrefs and backref insertion much more efficient
when there are many backrefs for a single extent
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 47e4bb98
...@@ -397,13 +397,12 @@ static u64 hash_extent_ref(u64 root_objectid, u64 ref_generation, ...@@ -397,13 +397,12 @@ static u64 hash_extent_ref(u64 root_objectid, u64 ref_generation,
high_crc = crc32c(high_crc, &lenum, sizeof(lenum)); high_crc = crc32c(high_crc, &lenum, sizeof(lenum));
lenum = cpu_to_le64(ref_generation); lenum = cpu_to_le64(ref_generation);
low_crc = crc32c(low_crc, &lenum, sizeof(lenum)); low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
if (owner >= BTRFS_FIRST_FREE_OBJECTID) {
#if 0
lenum = cpu_to_le64(owner); lenum = cpu_to_le64(owner);
low_crc = crc32c(low_crc, &lenum, sizeof(lenum)); low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
lenum = cpu_to_le64(owner_offset); lenum = cpu_to_le64(owner_offset);
low_crc = crc32c(low_crc, &lenum, sizeof(lenum)); low_crc = crc32c(low_crc, &lenum, sizeof(lenum));
#endif }
return ((u64)high_crc << 32) | (u64)low_crc; return ((u64)high_crc << 32) | (u64)low_crc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment