Commit 5dd3e8c0 authored by Kemeng Shi's avatar Kemeng Shi Committed by Theodore Ts'o

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: default avatarKemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240514112438.1269037-4-shikemeng@huaweicloud.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent abe48a52
...@@ -325,7 +325,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, ...@@ -325,7 +325,6 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
struct buffer_head **bh_out, struct buffer_head **bh_out,
sector_t blocknr) sector_t blocknr)
{ {
int need_copy_out = 0;
int done_copy_out = 0; int done_copy_out = 0;
int do_escape = 0; int do_escape = 0;
char *mapped_data; char *mapped_data;
...@@ -380,16 +379,14 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction, ...@@ -380,16 +379,14 @@ int jbd2_journal_write_metadata_buffer(transaction_t *transaction,
/* /*
* Check for escaping * Check for escaping
*/ */
if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER)) { if (*((__be32 *)mapped_data) == cpu_to_be32(JBD2_MAGIC_NUMBER))
need_copy_out = 1;
do_escape = 1; do_escape = 1;
}
kunmap_local(mapped_data); kunmap_local(mapped_data);
/* /*
* Do we need to do a data copy? * Do we need to do a data copy?
*/ */
if (need_copy_out && !done_copy_out) { if (do_escape && !done_copy_out) {
char *tmp; char *tmp;
spin_unlock(&jh_in->b_state_lock); spin_unlock(&jh_in->b_state_lock);
......
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