summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-08-26 08:23:23 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-08-31 14:48:44 -0400
commit20aa8c6f1244d0e063ae3676e7eedfb5236215ba (patch)
treefb1a022d48a538083bd1b0c5f52f1e1113993509
parent938e61d6d97c49d2af2a771519d5196c030945cb (diff)
cifs: convert to add_to_page_cache()
-rw-r--r--fs/cifs/file.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 8d41ca7bfcf1..a1537e2d4833 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -3689,20 +3689,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;
@@ -3721,11 +3713,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++;