@@ -241,6 +241,13 @@ xfs_attr_hashname(
const uint8_t *name,
unsigned int namelen)
{
+ if ((attr_flags & XFS_ATTR_VERITY) &&
+ namelen == sizeof(struct xfs_verity_merkle_key)) {
+ uint64_t off = xfs_verity_merkle_key_from_disk(name);
+
+ return off >> XFS_VERITY_MIN_MERKLE_BLOCKLOG;
+ }
+
return xfs_da_hashname(name, namelen);
}
@@ -951,4 +951,6 @@ xfs_verity_merkle_key_from_disk(
#define XFS_VERITY_DESCRIPTOR_NAME "vdesc"
#define XFS_VERITY_DESCRIPTOR_NAME_LEN (sizeof(XFS_VERITY_DESCRIPTOR_NAME) - 1)
+#define XFS_VERITY_MIN_MERKLE_BLOCKLOG (10)
+
#endif /* __XFS_DA_FORMAT_H__ */