Replace all le64 zero test conditions with "le64_cmpz(...)".

edge.strict_endians
Erik Larsson 2016-01-28 08:28:42 +01:00
parent 17a2c5f58e
commit 65eea3fe0a
5 changed files with 5 additions and 5 deletions

View File

@ -186,7 +186,7 @@ static ntfs_inode *ntfs_inode_real_open(ntfs_volume *vol, const MFT_REF mref)
/* Receive some basic information about inode. */
if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED,
0, CASE_SENSITIVE, 0, NULL, 0, ctx)) {
if (!ni->mrec->base_mft_record)
if (le64_cmpz(ni->mrec->base_mft_record))
ntfs_log_perror("No STANDARD_INFORMATION in base record"
" %lld", (long long)MREF(mref));
goto put_err_out;

View File

@ -1395,7 +1395,7 @@ ntfs_inode *ntfs_mft_rec_alloc(ntfs_volume *vol, BOOL mft_data)
* no extents and no name cannot be in use.
* Otherwise apply standard procedure.
*/
if (!ext_ni->mrec->base_mft_record
if (le64_cmpz(ext_ni->mrec->base_mft_record)
&& !ext_ni->nr_extents)
forced_mft_data = TRUE;
ntfs_inode_close(ext_ni);

View File

@ -449,7 +449,7 @@ static ATTR_REC *check_attr_record(ATTR_REC *attr_rec, MFT_RECORD *mft_rec,
// If this is the first attribute:
// todo: instance number must be smaller than next_instance.
if ((u8*)attr_rec == ((u8*)mft_rec) + attrs_offset) {
if (!mft_rec->base_mft_record)
if (le64_cmpz(mft_rec->base_mft_record))
assert_u32_equal(attr_type, 0x10,
"First attribute type");
// The following not always holds.

View File

@ -972,7 +972,7 @@ static BOOL spare_record_selfloc_condition(struct MFT_SELF_LOCATED *selfloc)
mft2) == vol->mft_record_size)
&& !ntfs_mst_post_read_fixup((NTFS_RECORD*)mft2,
vol->mft_record_size)) {
if (!mft2->base_mft_record
if (le64_cmpz(mft2->base_mft_record)
&& (mft2->flags & MFT_RECORD_IN_USE)
&& !find_unnamed_attr(mft2,AT_ATTRIBUTE_LIST)
&& !find_unnamed_attr(mft2,AT_FILE_NAME)) {

View File

@ -1033,7 +1033,7 @@ int mft_next_record(struct mft_search_ctx *ctx)
mrec = (MFT_RECORD*)NULL;
r = ntfs_file_record_read(ctx->vol,
(MFT_REF) ctx->mft_num, &mrec, NULL);
if (r || !mrec || !mrec->base_mft_record)
if (r || !mrec || le64_cmpz(mrec->base_mft_record))
ntfs_log_error(
"Error reading inode %lld.\n",
(long long)ctx->mft_num);