From: Denis Cheng <crquan@gmail.com>
To: "Hans J. Koch" <hjk@linutronix.de>, Greg Kroah-Hartman <gregkh@suse.de>
Cc: linux-kernel@vger.kernel.org, cr_quan@163.com
Subject: [PATCH 3/3] uio: vm_operations_struct ->nopage to ->fault method conversion
Date: Sat, 2 Feb 2008 17:51:37 +0800 [thread overview]
Message-ID: <1201945897-32297-3-git-send-email-crquan@gmail.com> (raw)
In-Reply-To: <1201945897-32297-2-git-send-email-crquan@gmail.com>
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
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)
--
1.5.3.8
next prev parent reply other threads:[~2008-02-02 9:52 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 ` Denis Cheng [this message]
2008-02-02 10:37 ` [PATCH 3/3] uio: vm_operations_struct ->nopage to ->fault method conversion Nick Piggin
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=1201945897-32297-3-git-send-email-crquan@gmail.com \
--to=crquan@gmail.com \
--cc=cr_quan@163.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