Skip to content

Commit 81246cc

Browse files
hclee1Naim
authored andcommitted
ntfs: fix inconsistent indenting warnings
Detected by Smatch. ndex.c:2041 ntfs_index_walk_up() warn: inconsistent indenting mft.c:2462 ntfs_mft_record_alloc() warn: inconsistent indenting Signed-off-by: Hyunchul Lee <hyc.lee@gmail.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent fb05028 commit 81246cc

2 files changed

Lines changed: 35 additions & 35 deletions

File tree

fs/ntfs/index.c

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,43 +2007,43 @@ struct index_entry *ntfs_index_walk_down(struct index_entry *ie, struct ntfs_ind
20072007
static struct index_entry *ntfs_index_walk_up(struct index_entry *ie,
20082008
struct ntfs_index_context *ictx)
20092009
{
2010-
struct index_entry *entry;
2010+
struct index_entry *entry = ie;
20112011
s64 vcn;
20122012

2013-
entry = ie;
2014-
if (ictx->pindex > 0) {
2015-
do {
2016-
ictx->pindex--;
2017-
if (!ictx->pindex) {
2018-
/* we have reached the root */
2019-
kfree(ictx->ib);
2020-
ictx->ib = NULL;
2021-
ictx->is_in_root = true;
2022-
/* a new search context is to be allocated */
2023-
if (ictx->actx)
2024-
ntfs_attr_put_search_ctx(ictx->actx);
2025-
ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name,
2026-
ictx->name_len, &ictx->actx);
2027-
if (ictx->ir)
2028-
entry = ntfs_ie_get_by_pos(&ictx->ir->index,
2029-
ictx->parent_pos[ictx->pindex]);
2030-
else
2031-
entry = NULL;
2032-
} else {
2033-
/* up into non-root node */
2034-
vcn = ictx->parent_vcn[ictx->pindex];
2035-
if (!ntfs_ib_read(ictx, vcn, ictx->ib)) {
2036-
entry = ntfs_ie_get_by_pos(&ictx->ib->index,
2037-
ictx->parent_pos[ictx->pindex]);
2038-
} else
2039-
entry = NULL;
2040-
}
2041-
ictx->entry = entry;
2042-
} while (entry && (ictx->pindex > 0) &&
2043-
(entry->flags & INDEX_ENTRY_END));
2044-
} else
2045-
entry = NULL;
2013+
if (ictx->pindex <= 0)
2014+
return NULL;
20462015

2016+
do {
2017+
ictx->pindex--;
2018+
if (!ictx->pindex) {
2019+
/* we have reached the root */
2020+
kfree(ictx->ib);
2021+
ictx->ib = NULL;
2022+
ictx->is_in_root = true;
2023+
/* a new search context is to be allocated */
2024+
if (ictx->actx)
2025+
ntfs_attr_put_search_ctx(ictx->actx);
2026+
ictx->ir = ntfs_ir_lookup(ictx->idx_ni, ictx->name,
2027+
ictx->name_len, &ictx->actx);
2028+
if (ictx->ir)
2029+
entry = ntfs_ie_get_by_pos(
2030+
&ictx->ir->index,
2031+
ictx->parent_pos[ictx->pindex]);
2032+
else
2033+
entry = NULL;
2034+
} else {
2035+
/* up into non-root node */
2036+
vcn = ictx->parent_vcn[ictx->pindex];
2037+
if (!ntfs_ib_read(ictx, vcn, ictx->ib)) {
2038+
entry = ntfs_ie_get_by_pos(
2039+
&ictx->ib->index,
2040+
ictx->parent_pos[ictx->pindex]);
2041+
} else
2042+
entry = NULL;
2043+
}
2044+
ictx->entry = entry;
2045+
} while (entry && (ictx->pindex > 0) &&
2046+
(entry->flags & INDEX_ENTRY_END));
20472047
return entry;
20482048
}
20492049

fs/ntfs/mft.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,7 @@ int ntfs_mft_record_alloc(struct ntfs_volume *vol, const int mode,
24592459
m->flags &= cpu_to_le16(
24602460
~le16_to_cpu(MFT_RECORD_IN_USE));
24612461
/* Make sure the mft record is written out to disk. */
2462-
ntfs_mft_mark_dirty(folio);
2462+
ntfs_mft_mark_dirty(folio);
24632463
folio_unlock(folio);
24642464
kunmap_local(m);
24652465
folio_put(folio);

0 commit comments

Comments
 (0)