From a337c4c1eb75638026bfe4b385a3335801f5b001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 19 Jul 2021 09:23:23 +0200 Subject: [PATCH] Renamed ntfs_index_entry_consistent() as ntfs_index_entry_inconsistent() The original name was error prone when checking the condition. --- include/ntfs-3g/index.h | 2 +- libntfs-3g/dir.c | 8 ++++---- libntfs-3g/index.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/ntfs-3g/index.h b/include/ntfs-3g/index.h index 22dcbb80..d001863a 100644 --- a/include/ntfs-3g/index.h +++ b/include/ntfs-3g/index.h @@ -141,7 +141,7 @@ extern void ntfs_index_ctx_reinit(ntfs_index_context *ictx); extern int ntfs_index_block_inconsistent(const INDEX_BLOCK *ib, u32 block_size, u64 inum, VCN vcn); -extern int ntfs_index_entry_consistent(const INDEX_ENTRY *ie, +extern int ntfs_index_entry_inconsistent(const INDEX_ENTRY *ie, COLLATION_RULES collation_rule, u64 inum); extern int ntfs_index_lookup(const void *key, const int key_len, ntfs_index_context *ictx) __attribute_warn_unused_result__; diff --git a/libntfs-3g/dir.c b/libntfs-3g/dir.c index 142c6826..5cab5c54 100644 --- a/libntfs-3g/dir.c +++ b/libntfs-3g/dir.c @@ -321,7 +321,7 @@ u64 ntfs_inode_lookup_by_name(ntfs_inode *dir_ni, break; /* The file name must not overflow from the entry */ - if (ntfs_index_entry_consistent(ie, COLLATION_FILE_NAME, + if (ntfs_index_entry_inconsistent(ie, COLLATION_FILE_NAME, dir_ni->mft_no)) { errno = EIO; goto put_err_out; @@ -442,7 +442,7 @@ descend_into_child_node: break; /* The file name must not overflow from the entry */ - if (ntfs_index_entry_consistent(ie, COLLATION_FILE_NAME, + if (ntfs_index_entry_inconsistent(ie, COLLATION_FILE_NAME, dir_ni->mft_no)) { errno = EIO; goto close_err_out; @@ -1247,7 +1247,7 @@ int ntfs_readdir(ntfs_inode *dir_ni, s64 *pos, continue; /* The file name must not overflow from the entry */ - if (ntfs_index_entry_consistent(ie, COLLATION_FILE_NAME, + if (ntfs_index_entry_inconsistent(ie, COLLATION_FILE_NAME, dir_ni->mft_no)) { errno = EIO; goto dir_err_out; @@ -1389,7 +1389,7 @@ find_next_index_buffer: continue; /* The file name must not overflow from the entry */ - if (ntfs_index_entry_consistent(ie, COLLATION_FILE_NAME, + if (ntfs_index_entry_inconsistent(ie, COLLATION_FILE_NAME, dir_ni->mft_no)) { errno = EIO; goto dir_err_out; diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c index 943450e2..e48d6aaf 100644 --- a/libntfs-3g/index.c +++ b/libntfs-3g/index.c @@ -522,7 +522,7 @@ int ntfs_index_block_inconsistent(const INDEX_BLOCK *ib, u32 block_size, * -1 otherwise (with errno unchanged) */ -int ntfs_index_entry_consistent(const INDEX_ENTRY *ie, +int ntfs_index_entry_inconsistent(const INDEX_ENTRY *ie, COLLATION_RULES collation_rule, u64 inum) { int ret; @@ -614,7 +614,7 @@ static int ntfs_ie_lookup(const void *key, const int key_len, return STATUS_ERROR; } /* Make sure key and data do not overflow from entry */ - if (ntfs_index_entry_consistent(ie, icx->ir->collation_rule, + if (ntfs_index_entry_inconsistent(ie, icx->ir->collation_rule, icx->ni->mft_no)) { errno = EIO; return STATUS_ERROR;