Whamcloud - gitweb
LU-744 clio: save memory allocations for cl_page
[fs/lustre-release.git] / libcfs / include / libcfs / posix / libcfs.h
index 17d37ce..95ec2ab 100644 (file)
@@ -26,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -64,6 +66,7 @@
 #include <sys/socket.h>
 #include <sys/utsname.h>
 #include <ctype.h>
+#include <stdbool.h>
 
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
@@ -195,6 +198,10 @@ typedef struct dirent64 cfs_dirent_t;
 #define __swab64s(x)                            do { *(x) = __swab64(*(x)); } while (0)
 #endif
 
+#if !defined(ALIGN)
+#define __ALIGN_MASK(x, mask)  (((x) + (mask)) & ~(mask))
+#define ALIGN(x, a)            __ALIGN_MASK(x, (typeof(x))(a) - 1)
+#endif
 
 # ifndef THREAD_SIZE /* x86_64 linux has THREAD_SIZE in userspace */
 #  define CFS_THREAD_SIZE 8192