]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/swapfile.c
[SCSI] refactor sdev/starget/shost busy checking
[linux-2.6-omap-h63xx.git] / mm / swapfile.c
index 6beb6251e99d78dcd7de0dae4347bc10dfd2e2d4..1e330f2998fa259d2733f73f4c50ce0d649c5dc0 100644 (file)
@@ -403,7 +403,7 @@ void free_swap_and_cache(swp_entry_t entry)
        if (p) {
                if (swap_entry_free(p, swp_offset(entry)) == 1) {
                        page = find_get_page(&swapper_space, entry.val);
-                       if (page && unlikely(TestSetPageLocked(page))) {
+                       if (page && unlikely(!trylock_page(page))) {
                                page_cache_release(page);
                                page = NULL;
                        }
@@ -656,8 +656,8 @@ static int unuse_mm(struct mm_struct *mm,
 
        if (!down_read_trylock(&mm->mmap_sem)) {
                /*
-                * Activate page so shrink_cache is unlikely to unmap its
-                * ptes while lock is dropped, so swapoff can make progress.
+                * Activate page so shrink_inactive_list is unlikely to unmap
+                * its ptes while lock is dropped, so swapoff can make progress.
                 */
                activate_page(page);
                unlock_page(page);