From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Denis Cheng <crquan@gmail.com>
Cc: "Hans J. Koch" <hjk@linutronix.de>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, cr_quan@163.com
Subject: Re: [PATCH 3/3] uio: vm_operations_struct ->nopage to ->fault method conversion
Date: Sat, 2 Feb 2008 21:37:45 +1100 [thread overview]
Message-ID: <200802022137.45493.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <1201945897-32297-3-git-send-email-crquan@gmail.com>
On Saturday 02 February 2008 20:51, Denis Cheng wrote:
> Signed-off-by: Denis Cheng <crquan@gmail.com>
Thanks, but already patched in -mm.
> ---
> drivers/uio/uio.c | 19 ++++++++-----------
> 1 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
> index cc246fa..47e0c32 100644
> --- a/drivers/uio/uio.c
> +++ b/drivers/uio/uio.c
> @@ -417,30 +417,27 @@ static void uio_vma_close(struct vm_area_struct *vma)
> idev->vma_count--;
> }
>
> -static struct page *uio_vma_nopage(struct vm_area_struct *vma,
> - unsigned long address, int *type)
> +static int uio_vma_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
> {
> struct uio_device *idev = vma->vm_private_data;
> - struct page* page = NOPAGE_SIGBUS;
>
> int mi = uio_find_mem_index(vma);
> if (mi < 0)
> - return page;
> + return VM_FAULT_SIGBUS;
>
> if (idev->info->mem[mi].memtype == UIO_MEM_LOGICAL)
> - page = virt_to_page(idev->info->mem[mi].addr);
> + vmf->page = virt_to_page(idev->info->mem[mi].addr);
> else
> - page = vmalloc_to_page((void*)idev->info->mem[mi].addr);
> - get_page(page);
> - if (type)
> - *type = VM_FAULT_MINOR;
> - return page;
> + vmf->page = vmalloc_to_page((void *)idev->info->mem[mi].addr);
> + get_page(vmf->page);
> +
> + return 0;
> }
>
> static struct vm_operations_struct uio_vm_ops = {
> .open = uio_vma_open,
> .close = uio_vma_close,
> - .nopage = uio_vma_nopage,
> + .fault = uio_vma_fault,
> };
>
> static int uio_mmap_physical(struct vm_area_struct *vma)
next prev parent reply other threads:[~2008-02-02 10:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] < <1201945897-32297-1-git-send-email-crquan@gmail.com>
2008-02-02 9:51 ` [PATCH 1/3] uio: Kconfig improvements Denis Cheng
2008-02-02 9:51 ` [PATCH 2/3] uio: mark pci_device_id hilscher_pci_ids[] __devinitdata Denis Cheng
2008-02-02 9:51 ` [PATCH 3/3] uio: vm_operations_struct ->nopage to ->fault method conversion Denis Cheng
2008-02-02 10:37 ` Nick Piggin [this message]
2008-02-03 0:27 ` [PATCH 2/3] uio: mark pci_device_id hilscher_pci_ids[] __devinitdata Hans-Jürgen Koch
2008-02-03 0:12 ` [PATCH 1/3] uio: Kconfig improvements Hans-Jürgen Koch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200802022137.45493.nickpiggin@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=cr_quan@163.com \
--cc=crquan@gmail.com \
--cc=gregkh@suse.de \
--cc=hjk@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox