summaryrefslogtreecommitdiff
path: root/kerncompat.h
diff options
context:
space:
mode:
Diffstat (limited to 'kerncompat.h')
-rw-r--r--kerncompat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/kerncompat.h b/kerncompat.h
index 1a2bc18c..c33e485f 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -263,6 +263,8 @@ static inline int IS_ERR_OR_NULL(const void *ptr)
return !ptr || IS_ERR(ptr);
}
+#define div_u64(x, y) ((x) / (y))
+
/**
* swap - swap values of @a and @b
* @a: first value
@@ -297,6 +299,10 @@ static inline int IS_ERR_OR_NULL(const void *ptr)
#define kfree(x) free(x)
#define vmalloc(x) malloc(x)
#define vfree(x) free(x)
+#define kvzalloc(x, y) kzalloc(x,y)
+#define kvfree(x) free(x)
+#define memalloc_nofs_save() (0)
+#define memalloc_nofs_restore(x) ((void)(x))
#ifndef BTRFS_DISABLE_BACKTRACE
static inline void assert_trace(const char *assertion, const char *filename,