From owner-svn-src-head@freebsd.org Thu Jul 30 19:12:03 2015 Return-Path: Delivered-To: svn-src-head@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 EE9129ABDD3 for ; Thu, 30 Jul 2015 19:12:02 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 886D81CD9 for ; Thu, 30 Jul 2015 19:12:02 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wibxm9 with SMTP id xm9so4618768wib.0 for ; Thu, 30 Jul 2015 12:11:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=a91Wdvc7+DWxjfqleHVqMqPk3YfVOw5gfix9LM2usdo=; b=eqRZ0doK/X4Y6wvohxzNPOGJTsB2lfjoUFrjTCWa8ZMRXe5ObTtaNRa5nnojIfimQo +lSHT1ufCiC06IO2aQjai4th6l28DkSTxjeuDj9J7pTHSxcHctcDJv3asuDnglIvGTzW Gw7VVYms4AH7Mp2zOw5nreOCJL6yQdTstBKLLzqcXmLZ4A5jdswcd2DOpt30AR8AaCCv 3qQbLuAIMXu4pqTScOiKXhRpvrglFgJLzmWcv+yBnkM/kXznW7tfE/qSQcn5hmIurv/t NJOPZrJAs/67UnZO1g1f9iE0btdgQxxXgz+SIx6GqdZWyz+VQRAQabN+NSOEOwx0mOAD Byzw== X-Gm-Message-State: ALoCoQm5RJ9D9EDRSu7oGEpZbmdyRBcm3S5GgWX/Z21WWSflsD0N+CxouUQrE8c2T9bEWHXwJJ12 MIME-Version: 1.0 X-Received: by 10.194.143.6 with SMTP id sa6mr2684442wjb.67.1438283514842; Thu, 30 Jul 2015 12:11:54 -0700 (PDT) Received: by 10.194.73.6 with HTTP; Thu, 30 Jul 2015 12:11:54 -0700 (PDT) In-Reply-To: <201506041941.t54JfGAA075455@svn.freebsd.org> References: <201506041941.t54JfGAA075455@svn.freebsd.org> Date: Thu, 30 Jul 2015 21:11:54 +0200 Message-ID: Subject: Re: svn commit: r283998 - in head/sys: dev/drm dev/drm2 fs/devfs kern sys vm From: Oliver Pinter To: John Baldwin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jul 2015 19:12:03 -0000 Hi John! On Thu, Jun 4, 2015 at 9:41 PM, John Baldwin wrote: > Author: jhb > Date: Thu Jun 4 19:41:15 2015 > New Revision: 283998 > URL: https://svnweb.freebsd.org/changeset/base/283998 > > Log: > Add a new file operations hook for mmap operations. File type-specific > logic is now placed in the mmap hook implementation rather than requiring > it to be placed in sys/vm/vm_mmap.c. This hook allows new file types to > support mmap() as well as potentially allowing mmap() for existing file > types that do not currently support any mapping. > > The vm_mmap() function is now split up into two functions. A new > vm_mmap_object() function handles the "back half" of vm_mmap() and accepts > a referenced VM object to map rather than a (handle, handle_type) tuple. > vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a > a VM object and then calling vm_mmap_object() to handle the actual mapping. > The vm_mmap() function remains for use by other parts of the kernel > (e.g. device drivers and exec) but now only supports mapping vnodes, > character devices, and anonymous memory. > > The mmap() system call invokes vm_mmap_object() directly with a NULL object > for anonymous mappings. For mappings using a file descriptor, the > descriptors fo_mmap() hook is invoked instead. The fo_mmap() hook is > responsible for performing type-specific checks and adjustments to > arguments as well as possibly modifying mapping parameters such as flags > or the object offset. The fo_mmap() hook routines then call > vm_mmap_object() to handle the actual mapping. > > The fo_mmap() hook is optional. If it is not set, then fo_mmap() will > fail with ENODEV. A fo_mmap() hook is implemented for regular files, > character devices, and shared memory objects (created via shm_open()). > > While here, consistently use the VM_PROT_* constants for the vm_prot_t > type for the 'prot' variable passed to vm_mmap() and vm_mmap_object() > as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines. > Previously some places were using the mmap()-specific PROT_* constants > instead. While this happens to work because PROT_xx == VM_PROT_xx, > using VM_PROT_* is more correct. > > Differential Revision: https://reviews.freebsd.org/D2658 > Reviewed by: alc (glanced over), kib > MFC after: 1 month > Sponsored by: Chelsio > > Modified: > head/sys/dev/drm/drm_bufs.c > head/sys/dev/drm2/drm_bufs.c > head/sys/fs/devfs/devfs_vnops.c > head/sys/kern/subr_uio.c > head/sys/kern/uipc_shm.c > head/sys/kern/vfs_vnops.c > head/sys/sys/file.h > head/sys/sys/mman.h > head/sys/vm/vm_extern.h > head/sys/vm/vm_mmap.c > > ... patch trimmed... When plan you to MFC this change to 10-STABLE? Thank, Oliver > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"