diff options
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 517e112c8a9a..f78b76ec4707 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -313,18 +313,19 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) | |||
313 | static pgoff_t __get_first_dirty_index(struct address_space *mapping, | 313 | static pgoff_t __get_first_dirty_index(struct address_space *mapping, |
314 | pgoff_t pgofs, int whence) | 314 | pgoff_t pgofs, int whence) |
315 | { | 315 | { |
316 | struct pagevec pvec; | 316 | struct page *page; |
317 | int nr_pages; | 317 | int nr_pages; |
318 | 318 | ||
319 | if (whence != SEEK_DATA) | 319 | if (whence != SEEK_DATA) |
320 | return 0; | 320 | return 0; |
321 | 321 | ||
322 | /* find first dirty page index */ | 322 | /* find first dirty page index */ |
323 | pagevec_init(&pvec, 0); | 323 | nr_pages = find_get_pages_tag(mapping, &pgofs, PAGECACHE_TAG_DIRTY, |
324 | nr_pages = pagevec_lookup_tag(&pvec, mapping, &pgofs, | 324 | 1, &page); |
325 | PAGECACHE_TAG_DIRTY, 1); | 325 | if (!nr_pages) |
326 | pgofs = nr_pages ? pvec.pages[0]->index : ULONG_MAX; | 326 | return ULONG_MAX; |
327 | pagevec_release(&pvec); | 327 | pgofs = page->index; |
328 | put_page(page); | ||
328 | return pgofs; | 329 | return pgofs; |
329 | } | 330 | } |
330 | 331 | ||