mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
BUG_ON() Conversion in fs/ext2/
this changes if() BUG(); constructs to BUG_ON() which is cleaner, contains unlikely() and can better optimized away. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Adrian Bunk <bunk@stusta.de>
This commit is contained in:
parent
4d4ef9abe3
commit
309be53da6
@ -416,8 +416,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
|
|||||||
|
|
||||||
lock_page(page);
|
lock_page(page);
|
||||||
err = page->mapping->a_ops->prepare_write(NULL, page, from, to);
|
err = page->mapping->a_ops->prepare_write(NULL, page, from, to);
|
||||||
if (err)
|
BUG_ON(err);
|
||||||
BUG();
|
|
||||||
de->inode = cpu_to_le32(inode->i_ino);
|
de->inode = cpu_to_le32(inode->i_ino);
|
||||||
ext2_set_de_type (de, inode);
|
ext2_set_de_type (de, inode);
|
||||||
err = ext2_commit_chunk(page, from, to);
|
err = ext2_commit_chunk(page, from, to);
|
||||||
@ -554,8 +553,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
|
|||||||
from = (char*)pde - (char*)page_address(page);
|
from = (char*)pde - (char*)page_address(page);
|
||||||
lock_page(page);
|
lock_page(page);
|
||||||
err = mapping->a_ops->prepare_write(NULL, page, from, to);
|
err = mapping->a_ops->prepare_write(NULL, page, from, to);
|
||||||
if (err)
|
BUG_ON(err);
|
||||||
BUG();
|
|
||||||
if (pde)
|
if (pde)
|
||||||
pde->rec_len = cpu_to_le16(to-from);
|
pde->rec_len = cpu_to_le16(to-from);
|
||||||
dir->inode = 0;
|
dir->inode = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user