Commit cd7619d6 authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

[PATCH] Exterminate PAGE_BUG

Remove PAGE_BUG - repalce it with BUG and BUG_ON.
Signed-off-by: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c8538a7a
...@@ -92,8 +92,7 @@ static unsigned long __get_small_page(int priority, struct order *order) ...@@ -92,8 +92,7 @@ static unsigned long __get_small_page(int priority, struct order *order)
page = list_entry(order->queue.next, struct page, lru); page = list_entry(order->queue.next, struct page, lru);
again: again:
#ifdef PEDANTIC #ifdef PEDANTIC
if (USED_MAP(page) & ~order->all_used) BUG_ON(USED_MAP(page) & ~order->all_used);
PAGE_BUG(page);
#endif #endif
offset = ffz(USED_MAP(page)); offset = ffz(USED_MAP(page));
SET_USED(page, offset); SET_USED(page, offset);
...@@ -141,8 +140,7 @@ static void __free_small_page(unsigned long spage, struct order *order) ...@@ -141,8 +140,7 @@ static void __free_small_page(unsigned long spage, struct order *order)
goto non_small; goto non_small;
#ifdef PEDANTIC #ifdef PEDANTIC
if (USED_MAP(page) & ~order->all_used) BUG_ON(USED_MAP(page) & ~order->all_used);
PAGE_BUG(page);
#endif #endif
spage = spage >> order->shift; spage = spage >> order->shift;
......
...@@ -131,8 +131,7 @@ static int afs_file_readpage(struct file *file, struct page *page) ...@@ -131,8 +131,7 @@ static int afs_file_readpage(struct file *file, struct page *page)
vnode = AFS_FS_I(inode); vnode = AFS_FS_I(inode);
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
ret = -ESTALE; ret = -ESTALE;
if (vnode->flags & AFS_VNODE_DELETED) if (vnode->flags & AFS_VNODE_DELETED)
......
...@@ -2078,8 +2078,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block) ...@@ -2078,8 +2078,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
int nr, i; int nr, i;
int fully_mapped = 1; int fully_mapped = 1;
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
blocksize = 1 << inode->i_blkbits; blocksize = 1 << inode->i_blkbits;
if (!page_has_buffers(page)) if (!page_has_buffers(page))
create_empty_buffers(page, blocksize, 0); create_empty_buffers(page, blocksize, 0);
......
...@@ -79,8 +79,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) ...@@ -79,8 +79,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
D2(printk(KERN_DEBUG "jffs2_do_readpage_nolock(): ino #%lu, page at offset 0x%lx\n", inode->i_ino, pg->index << PAGE_CACHE_SHIFT)); 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)) BUG_ON(!PageLocked(pg));
PAGE_BUG(pg);
pg_buf = kmap(pg); pg_buf = kmap(pg);
/* FIXME: Can kmap fail? */ /* FIXME: Can kmap fail? */
......
...@@ -49,8 +49,7 @@ static int udf_adinicb_readpage(struct file *file, struct page * page) ...@@ -49,8 +49,7 @@ static int udf_adinicb_readpage(struct file *file, struct page * page)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
char *kaddr; char *kaddr;
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
kaddr = kmap(page); kaddr = kmap(page);
memset(kaddr, 0, PAGE_CACHE_SIZE); memset(kaddr, 0, PAGE_CACHE_SIZE);
...@@ -67,8 +66,7 @@ static int udf_adinicb_writepage(struct page *page, struct writeback_control *wb ...@@ -67,8 +66,7 @@ static int udf_adinicb_writepage(struct page *page, struct writeback_control *wb
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
char *kaddr; char *kaddr;
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
kaddr = kmap(page); kaddr = kmap(page);
memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size); memcpy(UDF_I_DATA(inode) + UDF_I_LENEATTR(inode), kaddr, inode->i_size);
......
...@@ -167,8 +167,8 @@ void udf_expand_file_adinicb(struct inode * inode, int newsize, int * err) ...@@ -167,8 +167,8 @@ void udf_expand_file_adinicb(struct inode * inode, int newsize, int * err)
} }
page = grab_cache_page(inode->i_mapping, 0); page = grab_cache_page(inode->i_mapping, 0);
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
if (!PageUptodate(page)) if (!PageUptodate(page))
{ {
kaddr = kmap(page); kaddr = kmap(page);
......
...@@ -77,10 +77,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; ...@@ -77,10 +77,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
} while (0) } while (0)
#define PAGE_BUG(page) do { \
BUG(); \
} while (0)
/* Pure 2^n version of get_order */ /* Pure 2^n version of get_order */
static inline int get_order(unsigned long size) static inline int get_order(unsigned long size)
{ {
......
...@@ -12,13 +12,6 @@ ...@@ -12,13 +12,6 @@
} while (0) } while (0)
#endif #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 #ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0) #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#endif #endif
...@@ -37,10 +30,6 @@ ...@@ -37,10 +30,6 @@
#define BUG() #define BUG()
#endif #endif
#ifndef HAVE_ARCH_PAGE_BUG
#define PAGE_BUG(page) do { if (page) ; } while (0)
#endif
#ifndef HAVE_ARCH_BUG_ON #ifndef HAVE_ARCH_BUG_ON
#define BUG_ON(condition) do { if (condition) ; } while(0) #define BUG_ON(condition) do { if (condition) ; } while(0)
#endif #endif
......
...@@ -17,10 +17,6 @@ ...@@ -17,10 +17,6 @@
BUG(); \ BUG(); \
} while(0) } while(0)
#define PAGE_BUG(page) do { \
BUG(); \
} while (0)
#define WARN_ON(condition) do { \ #define WARN_ON(condition) do { \
if (unlikely((condition)!=0)) { \ if (unlikely((condition)!=0)) { \
printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \ printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
......
...@@ -123,8 +123,7 @@ void remove_from_page_cache(struct page *page) ...@@ -123,8 +123,7 @@ void remove_from_page_cache(struct page *page)
{ {
struct address_space *mapping = page->mapping; struct address_space *mapping = page->mapping;
if (unlikely(!PageLocked(page))) BUG_ON(!PageLocked(page));
PAGE_BUG(page);
write_lock_irq(&mapping->tree_lock); write_lock_irq(&mapping->tree_lock);
__remove_from_page_cache(page); __remove_from_page_cache(page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment