summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++;