include/linux/ioport.h: add missing macro argument for devm_release_* family
[pandora-kernel.git] / mm / truncate.c
index 894e9a7..6650c1d 100644 (file)
@@ -187,7 +187,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
                        if (page_index > next)
                                next = page_index;
                        next++;
-                       if (TestSetPageLocked(page))
+                       if (!trylock_page(page))
                                continue;
                        if (PageWriteback(page)) {
                                unlock_page(page);
@@ -280,7 +280,7 @@ unsigned long __invalidate_mapping_pages(struct address_space *mapping,
                        pgoff_t index;
                        int lock_failed;
 
-                       lock_failed = TestSetPageLocked(page);
+                       lock_failed = !trylock_page(page);
 
                        /*
                         * We really shouldn't be looking at the ->index of an
@@ -380,7 +380,7 @@ static int do_launder_page(struct address_space *mapping, struct page *page)
  * Any pages which are found to be mapped into pagetables are unmapped prior to
  * invalidation.
  *
- * Returns -EIO if any pages could not be invalidated.
+ * Returns -EBUSY if any pages could not be invalidated.
  */
 int invalidate_inode_pages2_range(struct address_space *mapping,
                                  pgoff_t start, pgoff_t end)
@@ -440,7 +440,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
                        ret2 = do_launder_page(mapping, page);
                        if (ret2 == 0) {
                                if (!invalidate_complete_page2(mapping, page))
-                                       ret2 = -EIO;
+                                       ret2 = -EBUSY;
                        }
                        if (ret2 < 0)
                                ret = ret2;