Skip to content
Snippets Groups Projects
Commit 9aa6bba6 authored by Alessandro Rubini's avatar Alessandro Rubini
Browse files

sdbfs: kerne/sdbfs-int: define htonll/ntohll for kernel space



Signed-off-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent d82ea99f
Branches
Tags
No related merge requests found
......@@ -22,4 +22,20 @@ struct sdbfs_inode {
struct inode ino;
};
/* This is needed to convert endianness. Hoping it is not defined elsewhere */
static inline uint64_t htonll(uint64_t ll)
{
uint64_t res;
if (htonl(1) == 1)
return ll;
res = htonl(ll >> 32);
res |= (uint64_t)(htonl((uint32_t)ll)) << 32;
return res;
}
static inline uint64_t ntohll(uint64_t ll)
{
return htonll(ll);
}
#endif /* __SDBFS_INT_H__ */
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