drm/i915: Only print "nothing to do" debug message as required.
[safe/jmp/linux-2.6] / fs / nilfs2 / page.c
index 7b18be8..8de3e1e 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/list.h>
 #include <linux/highmem.h>
 #include <linux/pagevec.h>
+#include <linux/gfp.h>
 #include "nilfs.h"
 #include "page.h"
 #include "mdt.h"
@@ -128,7 +129,8 @@ void nilfs_forget_buffer(struct buffer_head *bh)
 
        lock_buffer(bh);
        clear_buffer_nilfs_volatile(bh);
-       if (test_clear_buffer_dirty(bh) && nilfs_page_buffers_clean(page))
+       clear_buffer_dirty(bh);
+       if (nilfs_page_buffers_clean(page))
                __nilfs_clear_page_dirty(page);
 
        clear_buffer_uptodate(bh);
@@ -291,7 +293,7 @@ void nilfs_free_private_page(struct page *page)
  * @src: source page
  * @copy_dirty: flag whether to copy dirty states on the page's buffer heads.
  *
- * This fuction is for both data pages and btnode pages.  The dirty flag
+ * This function is for both data pages and btnode pages.  The dirty flag
  * should be treated by caller.  The page must not be under i/o.
  * Both src and dst page must be locked
  */
@@ -387,7 +389,7 @@ repeat:
 }
 
 /**
- * nilfs_copy_back_pages -- copy back pages to orignal cache from shadow cache
+ * nilfs_copy_back_pages -- copy back pages to original cache from shadow cache
  * @dmap: destination page cache
  * @smap: source page cache
  *
@@ -417,7 +419,7 @@ repeat:
                dpage = find_lock_page(dmap, offset);
                if (dpage) {
                        /* override existing page on the destination cache */
-                       BUG_ON(PageDirty(dpage));
+                       WARN_ON(PageDirty(dpage));
                        nilfs_copy_page(dpage, page, 0);
                        unlock_page(dpage);
                        page_cache_release(dpage);
@@ -427,17 +429,15 @@ repeat:
                        /* move the page to the destination cache */
                        spin_lock_irq(&smap->tree_lock);
                        page2 = radix_tree_delete(&smap->page_tree, offset);
-                       if (unlikely(page2 != page))
-                               NILFS_PAGE_BUG(page, "page removal failed "
-                                              "(offset=%lu, page2=%p)",
-                                              offset, page2);
+                       WARN_ON(page2 != page);
+
                        smap->nrpages--;
                        spin_unlock_irq(&smap->tree_lock);
 
                        spin_lock_irq(&dmap->tree_lock);
                        err = radix_tree_insert(&dmap->page_tree, offset, page);
                        if (unlikely(err < 0)) {
-                               BUG_ON(err == -EEXIST);
+                               WARN_ON(err == -EEXIST);
                                page->mapping = NULL;
                                page_cache_release(page); /* for cache */
                        } else {