diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-08-26 08:23:23 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2019-04-03 11:47:04 -0400 |
commit | 12caa7d326db9855483e1910748732c993af0c6c (patch) | |
tree | 229c44126d74579374239569b106018f408ae80b | |
parent | ba1861acebc9ee3f8dcd93dd42f6d64837372dfd (diff) |
cifs: convert to add_to_page_cache()
-rw-r--r-- | fs/cifs/file.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 659ce1b92c44..3b65cc1d4b36 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -3997,20 +3997,12 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, page = lru_to_page(page_list); - /* - * Lock the page and put it in the cache. Since no one else - * should have access to this page, we're safe to simply set - * PG_locked without checking it first. - */ - __SetPageLocked(page); - rc = add_to_page_cache_locked(page, mapping, - page->index, gfp); + rc = add_to_page_cache(page, mapping, + page->index, gfp); /* give up if we can't stick it in the cache */ - if (rc) { - __ClearPageLocked(page); + if (rc) return rc; - } /* move first page to the tmplist */ *offset = (loff_t)page->index << PAGE_SHIFT; @@ -4029,11 +4021,8 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, if (*bytes + PAGE_SIZE > rsize) break; - __SetPageLocked(page); - if (add_to_page_cache_locked(page, mapping, page->index, gfp)) { - __ClearPageLocked(page); + if (add_to_page_cache(page, mapping, page->index, gfp)) break; - } list_move_tail(&page->lru, tmplist); (*bytes) += PAGE_SIZE; expected_index++; |