Commit e827f923 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Adrian Bunk

BUG_ON() Conversion in fs/buffer.c

this changes if() BUG(); constructs to BUG_ON() which is
cleaner and can better optimized away
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent fddaaae1
...@@ -796,8 +796,7 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode) ...@@ -796,8 +796,7 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode)
if (!mapping->assoc_mapping) { if (!mapping->assoc_mapping) {
mapping->assoc_mapping = buffer_mapping; mapping->assoc_mapping = buffer_mapping;
} else { } else {
if (mapping->assoc_mapping != buffer_mapping) BUG_ON(mapping->assoc_mapping != buffer_mapping);
BUG();
} }
if (list_empty(&bh->b_assoc_buffers)) { if (list_empty(&bh->b_assoc_buffers)) {
spin_lock(&buffer_mapping->private_lock); spin_lock(&buffer_mapping->private_lock);
...@@ -1114,8 +1113,7 @@ grow_dev_page(struct block_device *bdev, sector_t block, ...@@ -1114,8 +1113,7 @@ grow_dev_page(struct block_device *bdev, sector_t block,
if (!page) if (!page)
return NULL; return NULL;
if (!PageLocked(page)) BUG_ON(!PageLocked(page));
BUG();
if (page_has_buffers(page)) { if (page_has_buffers(page)) {
bh = page_buffers(page); bh = page_buffers(page);
...@@ -1522,8 +1520,7 @@ void set_bh_page(struct buffer_head *bh, ...@@ -1522,8 +1520,7 @@ void set_bh_page(struct buffer_head *bh,
struct page *page, unsigned long offset) struct page *page, unsigned long offset)
{ {
bh->b_page = page; bh->b_page = page;
if (offset >= PAGE_SIZE) BUG_ON(offset >= PAGE_SIZE);
BUG();
if (PageHighMem(page)) if (PageHighMem(page))
/* /*
* This catches illegal uses and preserves the offset: * This catches illegal uses and preserves the offset:
......
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