/*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, 2013, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
typedef unsigned long long cfs_cycles_t;
#define IS_ERR(a) ((unsigned long)(a) > (unsigned long)-1000L)
+#define IS_ERR_VALUE(a) (IS_ERR(a))
#define PTR_ERR(a) ((long)(a))
#define ERR_PTR(a) ((void*)((long)(a)))
#include <mntent.h>
#endif
-typedef struct file cfs_file_t;
-typedef struct dentry cfs_dentry_t;
-#ifdef __linux__
-typedef struct dirent64 cfs_dirent_t;
-#endif
-
-#define cfs_get_fd(x) NULL
-#define cfs_put_file(f) do {} while (0)
+#define fget(x) NULL
+#define fput(f) do {} while (0)
#ifdef __linux__
/* Userpace byte flipping */
#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
typedef ssize_t (*read_actor_t)();
-#define CFS_IFSHIFT 12
-
-#define CFS_IFTODT(type) (((type) & S_IFMT) >> CFS_IFSHIFT)
-#define CFS_DTTOIF(dirtype) ((dirtype) << CFS_IFSHIFT)
+# ifndef IFTODT
+# define IFSHIFT 12
+# define IFTODT(type) (((type) & S_IFMT) >> IFSHIFT)
+# define DTTOIF(dirtype) ((dirtype) << IFSHIFT)
+# endif
#endif