diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/fb_defio.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/fb_defio.c b/drivers/video/fb_defio.c index 804000183c5..32814e8800e 100644 --- a/drivers/video/fb_defio.c +++ b/drivers/video/fb_defio.c | |||
@@ -66,19 +66,26 @@ static int fb_deferred_io_fault(struct vm_area_struct *vma, | |||
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | 68 | ||
69 | int fb_deferred_io_fsync(struct file *file, int datasync) | 69 | int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
70 | { | 70 | { |
71 | struct fb_info *info = file->private_data; | 71 | struct fb_info *info = file->private_data; |
72 | struct inode *inode = file->f_path.dentry->d_inode; | ||
73 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); | ||
74 | if (err) | ||
75 | return err; | ||
72 | 76 | ||
73 | /* Skip if deferred io is compiled-in but disabled on this fbdev */ | 77 | /* Skip if deferred io is compiled-in but disabled on this fbdev */ |
74 | if (!info->fbdefio) | 78 | if (!info->fbdefio) |
75 | return 0; | 79 | return 0; |
76 | 80 | ||
81 | mutex_lock(&inode->i_mutex); | ||
77 | /* Kill off the delayed work */ | 82 | /* Kill off the delayed work */ |
78 | cancel_delayed_work_sync(&info->deferred_work); | 83 | cancel_delayed_work_sync(&info->deferred_work); |
79 | 84 | ||
80 | /* Run it immediately */ | 85 | /* Run it immediately */ |
81 | return schedule_delayed_work(&info->deferred_work, 0); | 86 | err = schedule_delayed_work(&info->deferred_work, 0); |
87 | mutex_unlock(&inode->i_mutex); | ||
88 | return err; | ||
82 | } | 89 | } |
83 | EXPORT_SYMBOL_GPL(fb_deferred_io_fsync); | 90 | EXPORT_SYMBOL_GPL(fb_deferred_io_fsync); |
84 | 91 | ||