* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#define ARRAY_SIZE(a) ((sizeof (a)) / (sizeof ((a)[0])))
#endif
+#if !defined(swap)
+#define swap(x,y) do { typeof(x) z = x; x = y; y = z; } while (0)
+#endif
+
#if !defined(container_of)
/* given a pointer @ptr to the field @member embedded into type (usually
* struct) @type, return pointer to the embedding instance of @type. */
/* standard allocator flag combination */
CFS_ALLOC_STD = CFS_ALLOC_FS | CFS_ALLOC_IO,
CFS_ALLOC_USER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO,
+ CFS_ALLOC_NOFS = CFS_ALLOC_WAIT | CFS_ALLOC_IO,
+ CFS_ALLOC_KERNEL = CFS_ALLOC_WAIT | CFS_ALLOC_IO | CFS_ALLOC_FS,
};
/* flags for cfs_page_alloc() in addition to enum cfs_alloc_flags */
enum cfs_alloc_page_flags {
- /* allow to return page beyond KVM. It has to be mapped into KVM by
- * cfs_page_map(); */
- CFS_ALLOC_HIGH = 0x40,
- CFS_ALLOC_HIGHUSER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO | CFS_ALLOC_HIGH,
+ /* allow to return page beyond KVM. It has to be mapped into KVM by
+ * cfs_kmap() and unmapped with cfs_kunmap(). */
+ CFS_ALLOC_HIGHMEM = 0x40,
+ CFS_ALLOC_HIGHUSER = CFS_ALLOC_WAIT | CFS_ALLOC_FS | CFS_ALLOC_IO |
+ CFS_ALLOC_HIGHMEM,
};
/*
#include <libcfs/libcfs_kernelcomm.h>
#include <libcfs/libcfs_workitem.h>
#include <libcfs/libcfs_hash.h>
+#include <libcfs/libcfs_heap.h>
#include <libcfs/libcfs_fail.h>
#include <libcfs/params_tree.h>
+#include <libcfs/libcfs_crypto.h>
/* container_of depends on "likely" which is defined in libcfs_private.h */
static inline void *__container_of(void *ptr, unsigned long shift)