From: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: btrfs_extref_hash 64-bit vs. btrfs_crc32c 32-bit
Date: Sat, 23 Sep 2017 12:35:35 +0200 [thread overview]
Message-ID: <a77ac7e4-502d-046c-a116-b4a4c35133cb@mendix.com> (raw)
Hi,
When looking around in the kernel code, I ran into this (hash.h):
u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length);
[...]
static inline u64 btrfs_extref_hash(u64 parent_objectid, const char *name,
int len)
{
return (u64) btrfs_crc32c(parent_objectid, name, len);
}
[...]
What is the "official" behaviour of just stuffing a 64-bit
(parent_objectid) value into a 32-bit function argument (crc)? Does it
get truncated? Does this compile without a warning?
I would expect that the caller should do the housekeeping of deciding
how to transform the 64 bit parent_objectid into some 32 bit value.
--
Hans van Kranenburg
next reply other threads:[~2017-09-23 10:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-23 10:35 Hans van Kranenburg [this message]
2017-09-24 17:31 ` btrfs_extref_hash 64-bit vs. btrfs_crc32c 32-bit Hans van Kranenburg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a77ac7e4-502d-046c-a116-b4a4c35133cb@mendix.com \
--to=hans.van.kranenburg@mendix.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).