]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Merge LinuxKPI changes from DragonflyBSD:
authorhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 12:33:09 +0000 (12:33 +0000)
committerhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 12:33:09 +0000 (12:33 +0000)
- Implement more Linux kernel functions.

Sponsored by: Mellanox Technologies

sys/ofed/include/linux/mm.h

index b1a575c145fa7c5d8259ebf79d82a74ee91dceef..b61678dd2fcfaaba522187fadb0e0e08a1d15c8b 100644 (file)
@@ -2,7 +2,9 @@
  * Copyright (c) 2010 Isilon Systems, Inc.
  * Copyright (c) 2010 iX Systems, Inc.
  * Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
+ * Copyright (c) 2015 François Tigeot
+ * Copyright (c) 2015 Matthew Dillon <dillon@backplane.com>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -84,4 +86,24 @@ io_remap_pfn_range(struct vm_area_struct *vma,
        return (0);
 }
 
+static inline unsigned long
+vma_pages(struct vm_area_struct *vma)
+{
+       return ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT);
+}
+
+#define        offset_in_page(off)     ((off) & (PAGE_SIZE - 1))
+
+static inline void
+set_page_dirty(struct vm_page *page)
+{
+       vm_page_dirty(page);
+}
+
+static inline void
+get_page(struct vm_page *page)
+{
+       vm_page_hold(page);
+}
+
 #endif /* _LINUX_MM_H_ */