From owner-svn-src-all@freebsd.org Mon Oct 19 12:33:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD5FCA18A1F; Mon, 19 Oct 2015 12:33:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75064AF5; Mon, 19 Oct 2015 12:33:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9JCX9m2081424; Mon, 19 Oct 2015 12:33:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9JCX9o9081422; Mon, 19 Oct 2015 12:33:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510191233.t9JCX9o9081422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Oct 2015 12:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289579 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 12:33:10 -0000 Author: hselasky Date: Mon Oct 19 12:33:09 2015 New Revision: 289579 URL: https://svnweb.freebsd.org/changeset/base/289579 Log: Merge LinuxKPI changes from DragonflyBSD: - Implement more Linux kernel functions. Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/mm.h Modified: head/sys/ofed/include/linux/mm.h ============================================================================== --- head/sys/ofed/include/linux/mm.h Mon Oct 19 12:26:38 2015 (r289578) +++ head/sys/ofed/include/linux/mm.h Mon Oct 19 12:33:09 2015 (r289579) @@ -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 * 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 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_ */