[PATCH] Exterminate PAGE_BUG
Remove PAGE_BUG - repalce it with BUG and BUG_ON.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/arch/arm26/mm/small_page.c b/arch/arm26/mm/small_page.c
index 77be86c..3044710 100644
--- a/arch/arm26/mm/small_page.c
+++ b/arch/arm26/mm/small_page.c
@@ -92,8 +92,7 @@
page = list_entry(order->queue.next, struct page, lru);
again:
#ifdef PEDANTIC
- if (USED_MAP(page) & ~order->all_used)
- PAGE_BUG(page);
+ BUG_ON(USED_MAP(page) & ~order->all_used);
#endif
offset = ffz(USED_MAP(page));
SET_USED(page, offset);
@@ -141,8 +140,7 @@
goto non_small;
#ifdef PEDANTIC
- if (USED_MAP(page) & ~order->all_used)
- PAGE_BUG(page);
+ BUG_ON(USED_MAP(page) & ~order->all_used);
#endif
spage = spage >> order->shift;
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 6b6bb7c..23c1251 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -131,8 +131,7 @@
vnode = AFS_FS_I(inode);
- if (!PageLocked(page))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
ret = -ESTALE;
if (vnode->flags & AFS_VNODE_DELETED)
diff --git a/fs/buffer.c b/fs/buffer.c
index 188365c..792cbac 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2078,8 +2078,7 @@
int nr, i;
int fully_mapped = 1;
- if (!PageLocked(page))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
blocksize = 1 << inode->i_blkbits;
if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0);
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
index 0c607c1..771a554 100644
--- a/fs/jffs2/file.c
+++ b/fs/jffs2/file.c
@@ -79,8 +79,7 @@
D2(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT));
- if (!PageLocked(pg))
- PAGE_BUG(pg);
+ BUG_ON(!PageLocked(pg));
pg_buf = kmap(pg);
/* FIXME: Can kmap fail? */
diff --git a/fs/udf/file.c b/fs/udf/file.c
index 2faa417..bb40d63 100644
--- a/fs/udf/file.c
+++ b/fs/udf/file.c
@@ -49,8 +49,7 @@
struct inode *inode = page->mapping->host;
char *kaddr;
- if (!PageLocked(page))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
kaddr = kmap(page);
memset(kaddr, 0, PAGE_CACHE_SIZE);
@@ -67,8 +66,7 @@
struct inode *inode = page->mapping->host;
char *kaddr;
- if (!PageLocked(page))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
kaddr = kmap(page);
memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size);
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 0506e11..3d68de3 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -167,8 +167,8 @@
}
page = grab_cache_page(inode->i_mapping, 0);
- if (!PageLocked(page))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
+
if (!PageUptodate(page))
{
kaddr = kmap(page);
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index ddd8915..c767da1 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -77,10 +77,6 @@
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
} while (0)
-#define PAGE_BUG(page) do { \
- BUG(); \
-} while (0)
-
/* Pure 2^n version of get_order */
static inline int get_order(unsigned long size)
{
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 6e5aaaa..400c2b4 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -12,13 +12,6 @@
} while (0)
#endif
-#ifndef HAVE_ARCH_PAGE_BUG
-#define PAGE_BUG(page) do { \
- printk("page BUG for page at %p\n", page); \
- BUG(); \
-} while (0)
-#endif
-
#ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#endif
@@ -37,10 +30,6 @@
#define BUG()
#endif
-#ifndef HAVE_ARCH_PAGE_BUG
-#define PAGE_BUG(page) do { if (page) ; } while (0)
-#endif
-
#ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (condition) ; } while(0)
#endif
diff --git a/include/asm-sh64/bug.h b/include/asm-sh64/bug.h
index 3acd54d..5d659ec 100644
--- a/include/asm-sh64/bug.h
+++ b/include/asm-sh64/bug.h
@@ -17,10 +17,6 @@
BUG(); \
} while(0)
-#define PAGE_BUG(page) do { \
- BUG(); \
-} while (0)
-
#define WARN_ON(condition) do { \
if (unlikely((condition)!=0)) { \
printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
diff --git a/mm/filemap.c b/mm/filemap.c
index ee79b5d..c085af2 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -123,8 +123,7 @@
{
struct address_space *mapping = page->mapping;
- if (unlikely(!PageLocked(page)))
- PAGE_BUG(page);
+ BUG_ON(!PageLocked(page));
write_lock_irq(&mapping->tree_lock);
__remove_from_page_cache(page);