libcfs.h \
libcfs_debug.h \
libcfs_fail.h \
- libcfs_hash.h \
libcfs_private.h
#include <linux/sched/signal.h>
#endif
+#include <libcfs/linux/linux-hash.h>
#include <libcfs/linux/linux-misc.h>
#include <libcfs/linux/linux-mem.h>
#include <libcfs/linux/linux-time.h>
#include <uapi/linux/lnet/libcfs_ioctl.h>
#include <libcfs/libcfs_debug.h>
#include <libcfs/libcfs_private.h>
-#include <libcfs/libcfs_hash.h>
#include <libcfs/libcfs_fail.h>
#define LIBCFS_VERSION "0.7.1"
int libcfs_setup(void);
int libcfs_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data);
-extern struct workqueue_struct *cfs_rehash_wq;
-
#ifdef HAVE_CONST_CTR_TABLE
#define DEFINE_CTL_TABLE_INIT(__name, init)\
const struct ctl_table *__name = init
libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs))
libcfs-crypto-objs := $(addprefix crypto/,$(libcfs-crypto-objs))
-libcfs-all-objs := debug.o fail.o module.o tracefile.o hash.o
+libcfs-all-objs := debug.o fail.o module.o tracefile.o
libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs)
@LLCRYPT_TRUE@libcfs-objs += $(libcfs-crypto-objs)
goto cleanup_lock;
}
- cfs_rehash_wq = alloc_workqueue("cfs_rh", WQ_SYSFS, 4);
- if (!cfs_rehash_wq) {
- rc = -ENOMEM;
- CERROR("libcfs: failed to start rehash workqueue: rc = %d\n",
- rc);
- libcfs_debug_cleanup();
- goto cleanup_lock;
- }
-
CDEBUG(D_OTHER, "libcfs setup OK\n");
libcfs_active = 1;
cleanup_lock:
CDEBUG(D_MALLOC, "before Portals cleanup: kmem %lld\n",
libcfs_kmem_read());
- if (cfs_rehash_wq)
- destroy_workqueue(cfs_rehash_wq);
-
/* the below message is checked in test-framework.sh check_mem_leak() */
if (libcfs_kmem_read() != 0)
CERROR("Portals memory leaked: %lld bytes\n",
DIST_SUBDIRS = lustre uapi/linux/lustre
EXTRA_DIST = \
+ cfs_hash.h \
cl_object.h \
dt_object.h \
erasure_code.h \
#include <linux/spinlock.h>
#include <linux/workqueue.h>
#include <linux/refcount.h>
+#include <libcfs/libcfs.h>
#include <libcfs/linux/linux-hash.h>
/* disable debug */
#ifndef _LUSTRE_DLM_H__
#define _LUSTRE_DLM_H__
+#include <cfs_hash.h>
#include <lustre_lib.h>
#include <lustre_net.h>
#include <lustre_import.h>
#include <libcfs/libcfs.h>
#include <obd.h>
+#include <cfs_hash.h>
#include <cl_object.h>
#include <lustre_crypto.h>
int obd_pool_get_free_objects(unsigned int order);
int pool_is_at_full_capacity(int order);
+/* cfs_hash.c */
+int cfs_hash_init(void);
+void cfs_hash_fini(void);
+
int encrypt_page_pools_seq_show(struct seq_file *m, void *v);
int page_pools_seq_show(struct seq_file *m, void *v);
#define DEBUG_SUBSYSTEM S_MDS
#include <libcfs/libcfs.h>
-#include <libcfs/libcfs_hash.h>
#include <obd_support.h>
#include <lustre_export.h>
#include <obd.h>
#define DEBUG_SUBSYSTEM S_MDS
#include <libcfs/libcfs.h>
-#include <libcfs/libcfs_hash.h>
#include <obd_support.h>
#include <lprocfs_status.h>
#include <linux/interval_tree_generic.h>
#define _MDT_INTERNAL_H
#include <libcfs/libcfs.h>
-#include <libcfs/libcfs_hash.h>
+#include <cfs_hash.h>
#include <upcall_cache.h>
#include <obd_class.h>
#include <lustre_disk.h>
default: all
obdclass-all-objs := llog.o llog_cat.o llog_obd.o llog_swab.o
-obdclass-all-objs += class_obd.o genops.o
+obdclass-all-objs += class_obd.o genops.o hash.o
obdclass-all-objs += lprocfs_status.o lprocfs_counters.o
obdclass-all-objs += lustre_handles.o lustre_peer.o
obdclass-all-objs += statfs_pack.o obdo.o obd_config.o obd_mount.o obd_sysfs.o
if (err)
goto cleanup_llog_info;
+ err = cfs_hash_init();
+ if (err)
+ goto cleanup_obd_pool;
#ifdef HAVE_SERVER_SUPPORT
err = dt_global_init();
if (err != 0)
- goto cleanup_obd_pool;
+ goto cleanup_cfs_hash;
err = lu_ucred_global_init();
if (err != 0)
cleanup_dt_global:
dt_global_fini();
-cleanup_obd_pool:
+cleanup_cfs_hash:
#endif /* HAVE_SERVER_SUPPORT */
+ cfs_hash_fini();
+cleanup_obd_pool:
obd_pool_fini();
cleanup_llog_info:
lu_ucred_global_fini();
dt_global_fini();
#endif /* HAVE_SERVER_SUPPORT */
+ cfs_hash_fini();
obd_pool_fini();
llog_info_fini();
cl_global_fini();
#include <linux/pid_namespace.h>
#include <linux/workqueue.h>
#include <lustre_compat.h>
+#include <cfs_hash.h>
#include <obd_class.h>
#include <lustre_log.h>
#include <lprocfs_status.h>
#include <linux/seq_file.h>
#include <linux/log2.h>
-#include <libcfs/linux/linux-list.h>
#include <libcfs/libcfs.h>
+#include <cfs_hash.h>
+#include <obd_class.h>
#if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1
static unsigned int warn_on_depth = 8;
struct workqueue_struct *cfs_rehash_wq;
+int cfs_hash_init(void)
+{
+ int rc = 0;
+
+ cfs_rehash_wq = alloc_workqueue("cfs_rh", WQ_SYSFS, 4);
+ if (!cfs_rehash_wq) {
+ rc = -ENOMEM;
+ CERROR("obdclass: failed to start rehash workqueue: rc = %d\n",
+ rc);
+ }
+ return rc;
+}
+
+void cfs_hash_fini(void)
+{
+ if (cfs_rehash_wq)
+ destroy_workqueue(cfs_rehash_wq);
+}
+
static inline void
cfs_hash_nl_lock(union cfs_hash_lock *lock, int exclusive) {}
#include <linux/utsname.h>
#include <libcfs/libcfs.h>
+#include <cfs_hash.h>
#include <obd_support.h>
#include <obd_class.h>
#include <lustre_net.h>
#include <linux/kobject.h>
#include <linux/sysfs.h>
+#include <cfs_hash.h>
#include <obd_class.h>
#include <lprocfs_status.h>
#include <lustre_nodemap.h>
#include <linux/kobject.h>
#include <linux/string.h>
+#ifdef HAVE_SERVER_SUPPORT
+#include <cfs_hash.h>
+#endif
#include <llog_swab.h>
#include <lprocfs_status.h>
#include <lustre_disk.h>
#include <linux/module.h>
#include <linux/sort.h>
#include <uapi/linux/lnet/nidstr.h>
+#include <cfs_hash.h>
#include <lustre_net.h>
#include <lustre_acl.h>
#include <obd_class.h>
#ifndef _NODEMAP_INTERNAL_H
#define _NODEMAP_INTERNAL_H
+#include <cfs_hash.h>
#include <lustre_nodemap.h>
#include <lustre_disk.h>
#include <linux/rbtree.h>
#define DEBUG_SUBSYSTEM S_RPC
#include <linux/delay.h>
+#include <cfs_hash.h>
#include <obd_support.h>
#include <obd_class.h>
#include <libcfs/libcfs.h>
#include <obd.h>
#include <dt_object.h>
+#include <cfs_hash.h>
#include <lustre_quota.h>
#ifndef _LQUOTA_INTERNAL_H