Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e841b88d23d0ea0a6ee4e76c489899d4d23ce25
Commit:     5e841b88d23d0ea0a6ee4e76c489899d4d23ce25
Parent:     7bf1ea33ad70cf49638092367d52859fbbc44fee
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Tue May 8 00:37:41 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue May 8 11:15:27 2007 -0700

    fb: fsync() method for deferred I/O flush.
    
    There are cases when we do not want to wait on the delay for automatically
    updating the "real" framebuffer, this implements a simple ->fsync() hook
    for explicitly flushing the deferred I/O work.  The ->page_mkwrite()
    handler will rearm the work queue normally.
    
    (akpm: nuke unneeded ifdefs, forward-delcare struct dentry)
    
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
    Cc: Jaya Kumar <[EMAIL PROTECTED]>
    Acked-by: Antonino Daplas <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/video/fb_defio.c |   12 ++++++++++++
 drivers/video/fbmem.c    |    3 +++
 include/linux/fb.h       |    6 ++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c
index 65f4e6e..f963f5f 100644
--- a/drivers/video/fb_defio.c
+++ b/drivers/video/fb_defio.c
@@ -47,6 +47,18 @@ static struct page* fb_deferred_io_nopage(struct 
vm_area_struct *vma,
        return page;
 }
 
+int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int 
datasync)
+{
+       struct fb_info *info = file->private_data;
+
+       /* Kill off the delayed work */
+       cancel_rearming_delayed_work(&info->deferred_work);
+
+       /* Run it immediately */
+       return schedule_delayed_work(&info->deferred_work, 0);
+}
+EXPORT_SYMBOL_GPL(fb_deferred_io_fsync);
+
 /* vm_ops->page_mkwrite handler */
 static int fb_deferred_io_mkwrite(struct vm_area_struct *vma,
                                  struct page *page)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 2822526..44cf0e4 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1266,6 +1266,9 @@ static const struct file_operations fb_fops = {
 #ifdef HAVE_ARCH_FB_UNMAPPED_AREA
        .get_unmapped_area = get_fb_unmapped_area,
 #endif
+#ifdef CONFIG_FB_DEFERRED_IO
+       .fsync =        fb_deferred_io_fsync,
+#endif
 };
 
 struct class *fb_class;
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 8a8255b..0de4260 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -4,6 +4,8 @@
 #include <asm/types.h>
 #include <linux/i2c.h>
 
+struct dentry;
+
 /* Definitions of frame buffers                                                
*/
 
 #define FB_MAJOR               29
@@ -927,11 +929,11 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 
d_pitch,
        }
 }
 
-#ifdef CONFIG_FB_DEFERRED_IO
 /* drivers/video/fb_defio.c */
 extern void fb_deferred_io_init(struct fb_info *info);
 extern void fb_deferred_io_cleanup(struct fb_info *info);
-#endif
+extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry,
+                               int datasync);
 
 /* drivers/video/fbsysfs.c */
 extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to