11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/errno.h>
14 #include <linux/string.h>
20 #include <linux/list.h>
31 if (is_vmalloc_addr(screen_base + offs))
48 if (offset >= info->
fix.smem_len)
49 return VM_FAULT_SIGBUS;
51 page = fb_deferred_io_page(info, offset);
53 return VM_FAULT_SIGBUS;
63 page->
index = vmf->pgoff;
96 struct page *page = vmf->page;
98 struct fb_deferred_io *fbdefio = info->fbdefio;
113 if (fbdefio->first_io && list_empty(&fbdefio->pagelist))
114 fbdefio->first_io(info);
135 goto page_already_added;
147 return VM_FAULT_LOCKED;
150 static const struct vm_operations_struct fb_deferred_io_vm_ops = {
151 .fault = fb_deferred_io_fault,
152 .page_mkwrite = fb_deferred_io_mkwrite,
155 static int fb_deferred_io_set_page_dirty(
struct page *page)
157 if (!PageDirty(page))
163 .set_page_dirty = fb_deferred_io_set_page_dirty,
168 vma->
vm_ops = &fb_deferred_io_vm_ops;
169 vma->
vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
183 struct fb_deferred_io *fbdefio = info->fbdefio;
194 fbdefio->deferred_io(info, &fbdefio->pagelist);
205 struct fb_deferred_io *fbdefio = info->fbdefio;
209 info->
fbops->fb_mmap = fb_deferred_io_mmap;
211 INIT_LIST_HEAD(&fbdefio->pagelist);
212 if (fbdefio->delay == 0)
221 file->
f_mapping->a_ops = &fb_deferred_io_aops;
227 struct fb_deferred_io *fbdefio = info->fbdefio;
236 page = fb_deferred_io_page(info, i);