diff options
Diffstat (limited to 'sys/ofed')
-rw-r--r-- | sys/ofed/include/linux/mm.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/mm.h b/sys/ofed/include/linux/mm.h index b1a575c..b61678d 100644 --- a/sys/ofed/include/linux/mm.h +++ b/sys/ofed/include/linux/mm.h @@ -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_ */ |