From owner-svn-src-all@freebsd.org Fri Mar 17 08:02:48 2017 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 58EA1D0F080; Fri, 17 Mar 2017 08:02:48 +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 1C5FA1C85; Fri, 17 Mar 2017 08:02:48 +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 v2H82l7E014284; Fri, 17 Mar 2017 08:02:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2H82lK3014283; Fri, 17 Mar 2017 08:02:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201703170802.v2H82lK3014283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 17 Mar 2017 08:02:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315442 - head/sys/compat/linuxkpi/common/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.23 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: Fri, 17 Mar 2017 08:02:48 -0000 Author: hselasky Date: Fri Mar 17 08:02:46 2017 New Revision: 315442 URL: https://svnweb.freebsd.org/changeset/base/315442 Log: Add comment describing the use of pagefault_disable() and pagefault_enable() in the LinuxKPI. Suggested by: rpokala@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h Modified: head/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/uaccess.h Fri Mar 17 07:56:20 2017 (r315441) +++ head/sys/compat/linuxkpi/common/include/linux/uaccess.h Fri Mar 17 08:02:46 2017 (r315442) @@ -67,6 +67,13 @@ extern int linux_copyout(const void *kad extern size_t linux_clear_user(void *uaddr, size_t len); extern int linux_access_ok(int rw, const void *uaddr, size_t len); +/* + * NOTE: Each pagefault_disable() call must have a corresponding + * pagefault_enable() call in the same scope. The former creates a new + * block and defines a temporary variable, and the latter uses the + * temporary variable and closes the block. Failure to balance the + * calls will result in a compile-time error. + */ #define pagefault_disable(void) do { \ int __saved_pflags = \ vm_fault_disable_pagefaults()