Skip to content

Commit 5dd3e8c

Browse files
Kemeng Shitytso
authored andcommitted
jbd2: remove unnedded "need_copy_out" in jbd2_journal_write_metadata_buffer
As we only need to copy out when we should do escape, need_copy_out could be simply replaced by "do_escape". Signed-off-by: Kemeng Shi <[email protected]> Reviewed-by: Zhang Yi <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent abe48a5 commit 5dd3e8c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/jbd2/journal.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
325325
struct buffer_head **bh_out,
326326
sector_t blocknr)
327327
{
328-
int need_copy_out = 0;
329328
int done_copy_out = 0;
330329
int do_escape = 0;
331330
char *mapped_data;
@@ -380,16 +379,14 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
380379
/*
381380
* Check for escaping
382381
*/
383-
if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) {
384-
need_copy_out = 1;
382+
if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER))
385383
do_escape = 1;
386-
}
387384
kunmap_local(mapped_data);
388385

389386
/*
390387
* Do we need to do a data copy?
391388
*/
392-
if (need_copy_out && !done_copy_out) {
389+
if (do_escape && !done_copy_out) {
393390
char *tmp;
394391

395392
spin_unlock(&jh_in->b_state_lock);

0 commit comments

Comments
 (0)