Merge LinuxKPI changes from DragonflyBSD:

- Implement more Linux kernel functions.

Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2015-10-19 12:33:09 +00:00
parent f556cede8a
commit e490164bee
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=289579

View 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_ */