Skip to content

Commit

Permalink
Compile cityhash code into libzfs
Browse files Browse the repository at this point in the history
Make the cityhash code compile into libzfs, in preparation for the new
"zstream" command.

Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
  • Loading branch information
ahrens committed Mar 25, 2020
1 parent 652bdc9 commit 0b1f04a
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SUBDIRS = sys os

COMMON_H = \
$(top_srcdir)/include/cityhash.h \
$(top_srcdir)/include/zfeature_common.h \
$(top_srcdir)/include/zfs_comutil.h \
$(top_srcdir)/include/zfs_deleg.h \
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion include/sys/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ COMMON_H = \
$(top_srcdir)/include/sys/bptree.h \
$(top_srcdir)/include/sys/btree.h \
$(top_srcdir)/include/sys/bqueue.h \
$(top_srcdir)/include/sys/cityhash.h \
$(top_srcdir)/include/sys/dataset_kstats.h \
$(top_srcdir)/include/sys/dbuf.h \
$(top_srcdir)/include/sys/ddt.h \
Expand Down
1 change: 1 addition & 0 deletions lib/libzfs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ endif

KERNEL_C = \
algs/sha2/sha2.c \
cityhash.c \
zfeature_common.c \
zfs_comutil.c \
zfs_deleg.c \
Expand Down
1 change: 1 addition & 0 deletions module/zcommon/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ccflags-y := $(ZFS_MODULE_CFLAGS) $(ZFS_MODULE_CPPFLAGS)
# Suppress unused-value warnings in sparc64 architecture headers
ccflags-$(CONFIG_SPARC64) += -Wno-unused-value

$(MODULE)-objs += cityhash.o
$(MODULE)-objs += zfeature_common.o
$(MODULE)-objs += zfs_comutil.o
$(MODULE)-objs += zfs_deleg.o
Expand Down
6 changes: 5 additions & 1 deletion module/zfs/cityhash.c → module/zcommon/cityhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Copyright (c) 2017 by Delphix. All rights reserved.
*/

#include <sys/cityhash.h>
#include <cityhash.h>

#define HASH_K1 0xb492b66fbe98f273ULL
#define HASH_K2 0x9ae16a3b2f90404fULL
Expand Down Expand Up @@ -61,3 +61,7 @@ cityhash4(uint64_t w1, uint64_t w2, uint64_t w3, uint64_t w4)
a + rotate(b + HASH_K2, 18) + c, mul));

}

#if defined(_KERNEL)
EXPORT_SYMBOL(cityhash4);
#endif
1 change: 0 additions & 1 deletion module/zfs/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ $(MODULE)-objs += bpobj.o
$(MODULE)-objs += bptree.o
$(MODULE)-objs += btree.o
$(MODULE)-objs += bqueue.o
$(MODULE)-objs += cityhash.o
$(MODULE)-objs += dataset_kstats.o
$(MODULE)-objs += dbuf.o
$(MODULE)-objs += dbuf_stats.o
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
#include <sys/arc_impl.h>
#include <sys/trace_zfs.h>
#include <sys/aggsum.h>
#include <sys/cityhash.h>
#include <cityhash.h>

#ifndef _KERNEL
/* set with ZFS_DEBUG=watch, to enable watchpoints on frozen buffers */
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/dbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <sys/callb.h>
#include <sys/abd.h>
#include <sys/vdev.h>
#include <sys/cityhash.h>
#include <cityhash.h>
#include <sys/spa_impl.h>

kstat_t *dbuf_ksp;
Expand Down
2 changes: 1 addition & 1 deletion module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#include <sys/trace_zfs.h>
#include <sys/abd.h>
#include <sys/dsl_crypt.h>
#include <sys/cityhash.h>
#include <cityhash.h>

/*
* ==========================================================================
Expand Down

0 comments on commit 0b1f04a

Please sign in to comment.