diff options
author | jon ernst <jonernst07@gmx.com> | 2013-07-01 08:12:39 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-07-01 08:12:39 -0400 |
commit | 353eefd3386982ab8f7e14de079ec347dfe05509 (patch) | |
tree | 5ad4ae184bef151e1b0a325153091051a20a6baf /fs/ext4 | |
parent | 64cb927371cd2ec43758d8a094a003d27bc3d0dc (diff) |
ext4: delete unnecessary C statements
Comparing unsigned variable with 0 always returns false.
err = 0 is duplicated and unnecessary.
[ tytso: Also cleaned up error handling in ext4_block_zero_page_range() ]
Signed-off-by: "Jon Ernst" <jonernst07@gmx.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/inode.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 753c15683809..6d051deafc39 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1100,8 +1100,6 @@ static int ext4_write_end(struct file *file, | |||
1100 | if (i_size_changed) | 1100 | if (i_size_changed) |
1101 | ext4_mark_inode_dirty(handle, inode); | 1101 | ext4_mark_inode_dirty(handle, inode); |
1102 | 1102 | ||
1103 | if (copied < 0) | ||
1104 | ret = copied; | ||
1105 | if (pos + len > inode->i_size && ext4_can_truncate(inode)) | 1103 | if (pos + len > inode->i_size && ext4_can_truncate(inode)) |
1106 | /* if we have allocated more blocks and copied | 1104 | /* if we have allocated more blocks and copied |
1107 | * less. We will have blocks allocated outside | 1105 | * less. We will have blocks allocated outside |
@@ -3368,13 +3366,10 @@ int ext4_block_zero_page_range(handle_t *handle, | |||
3368 | iblock++; | 3366 | iblock++; |
3369 | pos += blocksize; | 3367 | pos += blocksize; |
3370 | } | 3368 | } |
3371 | |||
3372 | err = 0; | ||
3373 | if (buffer_freed(bh)) { | 3369 | if (buffer_freed(bh)) { |
3374 | BUFFER_TRACE(bh, "freed: skip"); | 3370 | BUFFER_TRACE(bh, "freed: skip"); |
3375 | goto unlock; | 3371 | goto unlock; |
3376 | } | 3372 | } |
3377 | |||
3378 | if (!buffer_mapped(bh)) { | 3373 | if (!buffer_mapped(bh)) { |
3379 | BUFFER_TRACE(bh, "unmapped"); | 3374 | BUFFER_TRACE(bh, "unmapped"); |
3380 | ext4_get_block(inode, iblock, bh, 0); | 3375 | ext4_get_block(inode, iblock, bh, 0); |
@@ -3397,22 +3392,19 @@ int ext4_block_zero_page_range(handle_t *handle, | |||
3397 | if (!buffer_uptodate(bh)) | 3392 | if (!buffer_uptodate(bh)) |
3398 | goto unlock; | 3393 | goto unlock; |
3399 | } | 3394 | } |
3400 | |||
3401 | if (ext4_should_journal_data(inode)) { | 3395 | if (ext4_should_journal_data(inode)) { |
3402 | BUFFER_TRACE(bh, "get write access"); | 3396 | BUFFER_TRACE(bh, "get write access"); |
3403 | err = ext4_journal_get_write_access(handle, bh); | 3397 | err = ext4_journal_get_write_access(handle, bh); |
3404 | if (err) | 3398 | if (err) |
3405 | goto unlock; | 3399 | goto unlock; |
3406 | } | 3400 | } |
3407 | |||
3408 | zero_user(page, offset, length); | 3401 | zero_user(page, offset, length); |
3409 | |||
3410 | BUFFER_TRACE(bh, "zeroed end of block"); | 3402 | BUFFER_TRACE(bh, "zeroed end of block"); |
3411 | 3403 | ||
3412 | err = 0; | ||
3413 | if (ext4_should_journal_data(inode)) { | 3404 | if (ext4_should_journal_data(inode)) { |
3414 | err = ext4_handle_dirty_metadata(handle, inode, bh); | 3405 | err = ext4_handle_dirty_metadata(handle, inode, bh); |
3415 | } else { | 3406 | } else { |
3407 | err = 0; | ||
3416 | mark_buffer_dirty(bh); | 3408 | mark_buffer_dirty(bh); |
3417 | if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE)) | 3409 | if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE)) |
3418 | err = ext4_jbd2_file_inode(handle, inode); | 3410 | err = ext4_jbd2_file_inode(handle, inode); |