diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/buffer.c | 9 | ||||
-rw-r--r-- | fs/dcache.c | 11 | ||||
-rw-r--r-- | fs/ext2/dir.c | 6 | ||||
-rw-r--r-- | fs/hfs/bnode.c | 9 | ||||
-rw-r--r-- | fs/hfs/btree.c | 3 |
5 files changed, 10 insertions, 28 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index a507b58550f1..d597758dd129 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -798,8 +798,7 @@ void mark_buffer_dirty_inode(struct buffer_head *bh, struct inode *inode) | |||
798 | if (!mapping->assoc_mapping) { | 798 | if (!mapping->assoc_mapping) { |
799 | mapping->assoc_mapping = buffer_mapping; | 799 | mapping->assoc_mapping = buffer_mapping; |
800 | } else { | 800 | } else { |
801 | if (mapping->assoc_mapping != buffer_mapping) | 801 | BUG_ON(mapping->assoc_mapping != buffer_mapping); |
802 | BUG(); | ||
803 | } | 802 | } |
804 | if (list_empty(&bh->b_assoc_buffers)) { | 803 | if (list_empty(&bh->b_assoc_buffers)) { |
805 | spin_lock(&buffer_mapping->private_lock); | 804 | spin_lock(&buffer_mapping->private_lock); |
@@ -1116,8 +1115,7 @@ grow_dev_page(struct block_device *bdev, sector_t block, | |||
1116 | if (!page) | 1115 | if (!page) |
1117 | return NULL; | 1116 | return NULL; |
1118 | 1117 | ||
1119 | if (!PageLocked(page)) | 1118 | BUG_ON(!PageLocked(page)); |
1120 | BUG(); | ||
1121 | 1119 | ||
1122 | if (page_has_buffers(page)) { | 1120 | if (page_has_buffers(page)) { |
1123 | bh = page_buffers(page); | 1121 | bh = page_buffers(page); |
@@ -1524,8 +1522,7 @@ void set_bh_page(struct buffer_head *bh, | |||
1524 | struct page *page, unsigned long offset) | 1522 | struct page *page, unsigned long offset) |
1525 | { | 1523 | { |
1526 | bh->b_page = page; | 1524 | bh->b_page = page; |
1527 | if (offset >= PAGE_SIZE) | 1525 | BUG_ON(offset >= PAGE_SIZE); |
1528 | BUG(); | ||
1529 | if (PageHighMem(page)) | 1526 | if (PageHighMem(page)) |
1530 | /* | 1527 | /* |
1531 | * This catches illegal uses and preserves the offset: | 1528 | * This catches illegal uses and preserves the offset: |
diff --git a/fs/dcache.c b/fs/dcache.c index aaca5e7970bc..19458d399502 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/swap.h> | 34 | #include <linux/swap.h> |
35 | #include <linux/bootmem.h> | 35 | #include <linux/bootmem.h> |
36 | 36 | ||
37 | /* #define DCACHE_DEBUG 1 */ | ||
38 | 37 | ||
39 | int sysctl_vfs_cache_pressure __read_mostly = 100; | 38 | int sysctl_vfs_cache_pressure __read_mostly = 100; |
40 | EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); | 39 | EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); |
@@ -603,10 +602,6 @@ resume: | |||
603 | */ | 602 | */ |
604 | if (!list_empty(&dentry->d_subdirs)) { | 603 | if (!list_empty(&dentry->d_subdirs)) { |
605 | this_parent = dentry; | 604 | this_parent = dentry; |
606 | #ifdef DCACHE_DEBUG | ||
607 | printk(KERN_DEBUG "select_parent: descending to %s/%s, found=%d\n", | ||
608 | dentry->d_parent->d_name.name, dentry->d_name.name, found); | ||
609 | #endif | ||
610 | goto repeat; | 605 | goto repeat; |
611 | } | 606 | } |
612 | } | 607 | } |
@@ -616,10 +611,6 @@ dentry->d_parent->d_name.name, dentry->d_name.name, found); | |||
616 | if (this_parent != parent) { | 611 | if (this_parent != parent) { |
617 | next = this_parent->d_u.d_child.next; | 612 | next = this_parent->d_u.d_child.next; |
618 | this_parent = this_parent->d_parent; | 613 | this_parent = this_parent->d_parent; |
619 | #ifdef DCACHE_DEBUG | ||
620 | printk(KERN_DEBUG "select_parent: ascending to %s/%s, found=%d\n", | ||
621 | this_parent->d_parent->d_name.name, this_parent->d_name.name, found); | ||
622 | #endif | ||
623 | goto resume; | 614 | goto resume; |
624 | } | 615 | } |
625 | out: | 616 | out: |
@@ -798,7 +789,7 @@ struct dentry *d_alloc_name(struct dentry *parent, const char *name) | |||
798 | 789 | ||
799 | void d_instantiate(struct dentry *entry, struct inode * inode) | 790 | void d_instantiate(struct dentry *entry, struct inode * inode) |
800 | { | 791 | { |
801 | if (!list_empty(&entry->d_alias)) BUG(); | 792 | BUG_ON(!list_empty(&entry->d_alias)); |
802 | spin_lock(&dcache_lock); | 793 | spin_lock(&dcache_lock); |
803 | if (inode) | 794 | if (inode) |
804 | list_add(&entry->d_alias, &inode->i_dentry); | 795 | list_add(&entry->d_alias, &inode->i_dentry); |
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index b3dbd716cd3a..0165388c425c 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
@@ -416,8 +416,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de, | |||
416 | 416 | ||
417 | lock_page(page); | 417 | lock_page(page); |
418 | err = page->mapping->a_ops->prepare_write(NULL, page, from, to); | 418 | err = page->mapping->a_ops->prepare_write(NULL, page, from, to); |
419 | if (err) | 419 | BUG_ON(err); |
420 | BUG(); | ||
421 | de->inode = cpu_to_le32(inode->i_ino); | 420 | de->inode = cpu_to_le32(inode->i_ino); |
422 | ext2_set_de_type (de, inode); | 421 | ext2_set_de_type (de, inode); |
423 | err = ext2_commit_chunk(page, from, to); | 422 | err = ext2_commit_chunk(page, from, to); |
@@ -554,8 +553,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) | |||
554 | from = (char*)pde - (char*)page_address(page); | 553 | from = (char*)pde - (char*)page_address(page); |
555 | lock_page(page); | 554 | lock_page(page); |
556 | err = mapping->a_ops->prepare_write(NULL, page, from, to); | 555 | err = mapping->a_ops->prepare_write(NULL, page, from, to); |
557 | if (err) | 556 | BUG_ON(err); |
558 | BUG(); | ||
559 | if (pde) | 557 | if (pde) |
560 | pde->rec_len = cpu_to_le16(to-from); | 558 | pde->rec_len = cpu_to_le16(to-from); |
561 | dir->inode = 0; | 559 | dir->inode = 0; |
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c index a7a7d77f3fd3..1e44dcfe49c4 100644 --- a/fs/hfs/bnode.c +++ b/fs/hfs/bnode.c | |||
@@ -306,8 +306,7 @@ void hfs_bnode_unhash(struct hfs_bnode *node) | |||
306 | for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; | 306 | for (p = &node->tree->node_hash[hfs_bnode_hash(node->this)]; |
307 | *p && *p != node; p = &(*p)->next_hash) | 307 | *p && *p != node; p = &(*p)->next_hash) |
308 | ; | 308 | ; |
309 | if (!*p) | 309 | BUG_ON(!*p); |
310 | BUG(); | ||
311 | *p = node->next_hash; | 310 | *p = node->next_hash; |
312 | node->tree->node_hash_cnt--; | 311 | node->tree->node_hash_cnt--; |
313 | } | 312 | } |
@@ -415,8 +414,7 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num) | |||
415 | spin_lock(&tree->hash_lock); | 414 | spin_lock(&tree->hash_lock); |
416 | node = hfs_bnode_findhash(tree, num); | 415 | node = hfs_bnode_findhash(tree, num); |
417 | spin_unlock(&tree->hash_lock); | 416 | spin_unlock(&tree->hash_lock); |
418 | if (node) | 417 | BUG_ON(node); |
419 | BUG(); | ||
420 | node = __hfs_bnode_create(tree, num); | 418 | node = __hfs_bnode_create(tree, num); |
421 | if (!node) | 419 | if (!node) |
422 | return ERR_PTR(-ENOMEM); | 420 | return ERR_PTR(-ENOMEM); |
@@ -459,8 +457,7 @@ void hfs_bnode_put(struct hfs_bnode *node) | |||
459 | 457 | ||
460 | dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", | 458 | dprint(DBG_BNODE_REFS, "put_node(%d:%d): %d\n", |
461 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); | 459 | node->tree->cnid, node->this, atomic_read(&node->refcnt)); |
462 | if (!atomic_read(&node->refcnt)) | 460 | BUG_ON(!atomic_read(&node->refcnt)); |
463 | BUG(); | ||
464 | if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) | 461 | if (!atomic_dec_and_lock(&node->refcnt, &tree->hash_lock)) |
465 | return; | 462 | return; |
466 | for (i = 0; i < tree->pages_per_bnode; i++) { | 463 | for (i = 0; i < tree->pages_per_bnode; i++) { |
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index 7bb11edd1488..d20131ce4b95 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c | |||
@@ -36,8 +36,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke | |||
36 | tree->inode = iget_locked(sb, id); | 36 | tree->inode = iget_locked(sb, id); |
37 | if (!tree->inode) | 37 | if (!tree->inode) |
38 | goto free_tree; | 38 | goto free_tree; |
39 | if (!(tree->inode->i_state & I_NEW)) | 39 | BUG_ON(!(tree->inode->i_state & I_NEW)); |
40 | BUG(); | ||
41 | { | 40 | { |
42 | struct hfs_mdb *mdb = HFS_SB(sb)->mdb; | 41 | struct hfs_mdb *mdb = HFS_SB(sb)->mdb; |
43 | HFS_I(tree->inode)->flags = 0; | 42 | HFS_I(tree->inode)->flags = 0; |