diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-08-26 08:23:23 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2020-05-06 17:14:15 -0400 |
commit | 01d2b5f0a13e7217ed6a6b7a405931da7e62fef7 (patch) | |
tree | 5c43244e5de5e3bf3f6e15fb30b356bb32b0244a | |
parent | 6c057850188e5e0bd9e0b3bea418b9480cdbeedd (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 cfb0d91289ec..be32c9fca03a 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -3771,20 +3771,12 @@ readpages_get_pages(struct address_space *mapping, struct list_head *page_list, page = list_entry(page_list->prev, struct page, lru); - /* - * 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; @@ -3803,11 +3795,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++; |