Replace all le64 zero test conditions with "le64_cmpz(...)".
parent
17a2c5f58e
commit
65eea3fe0a
|
@ -186,7 +186,7 @@ static ntfs_inode *ntfs_inode_real_open(ntfs_volume *vol, const MFT_REF mref)
|
||||||
/* Receive some basic information about inode. */
|
/* Receive some basic information about inode. */
|
||||||
if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED,
|
if (ntfs_attr_lookup(AT_STANDARD_INFORMATION, AT_UNNAMED,
|
||||||
0, CASE_SENSITIVE, 0, NULL, 0, ctx)) {
|
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"
|
ntfs_log_perror("No STANDARD_INFORMATION in base record"
|
||||||
" %lld", (long long)MREF(mref));
|
" %lld", (long long)MREF(mref));
|
||||||
goto put_err_out;
|
goto put_err_out;
|
||||||
|
|
|
@ -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.
|
* no extents and no name cannot be in use.
|
||||||
* Otherwise apply standard procedure.
|
* Otherwise apply standard procedure.
|
||||||
*/
|
*/
|
||||||
if (!ext_ni->mrec->base_mft_record
|
if (le64_cmpz(ext_ni->mrec->base_mft_record)
|
||||||
&& !ext_ni->nr_extents)
|
&& !ext_ni->nr_extents)
|
||||||
forced_mft_data = TRUE;
|
forced_mft_data = TRUE;
|
||||||
ntfs_inode_close(ext_ni);
|
ntfs_inode_close(ext_ni);
|
||||||
|
|
|
@ -449,7 +449,7 @@ static ATTR_REC *check_attr_record(ATTR_REC *attr_rec, MFT_RECORD *mft_rec,
|
||||||
// If this is the first attribute:
|
// If this is the first attribute:
|
||||||
// todo: instance number must be smaller than next_instance.
|
// todo: instance number must be smaller than next_instance.
|
||||||
if ((u8*)attr_rec == ((u8*)mft_rec) + attrs_offset) {
|
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,
|
assert_u32_equal(attr_type, 0x10,
|
||||||
"First attribute type");
|
"First attribute type");
|
||||||
// The following not always holds.
|
// The following not always holds.
|
||||||
|
|
|
@ -972,7 +972,7 @@ static BOOL spare_record_selfloc_condition(struct MFT_SELF_LOCATED *selfloc)
|
||||||
mft2) == vol->mft_record_size)
|
mft2) == vol->mft_record_size)
|
||||||
&& !ntfs_mst_post_read_fixup((NTFS_RECORD*)mft2,
|
&& !ntfs_mst_post_read_fixup((NTFS_RECORD*)mft2,
|
||||||
vol->mft_record_size)) {
|
vol->mft_record_size)) {
|
||||||
if (!mft2->base_mft_record
|
if (le64_cmpz(mft2->base_mft_record)
|
||||||
&& (mft2->flags & MFT_RECORD_IN_USE)
|
&& (mft2->flags & MFT_RECORD_IN_USE)
|
||||||
&& !find_unnamed_attr(mft2,AT_ATTRIBUTE_LIST)
|
&& !find_unnamed_attr(mft2,AT_ATTRIBUTE_LIST)
|
||||||
&& !find_unnamed_attr(mft2,AT_FILE_NAME)) {
|
&& !find_unnamed_attr(mft2,AT_FILE_NAME)) {
|
||||||
|
|
|
@ -1033,7 +1033,7 @@ int mft_next_record(struct mft_search_ctx *ctx)
|
||||||
mrec = (MFT_RECORD*)NULL;
|
mrec = (MFT_RECORD*)NULL;
|
||||||
r = ntfs_file_record_read(ctx->vol,
|
r = ntfs_file_record_read(ctx->vol,
|
||||||
(MFT_REF) ctx->mft_num, &mrec, NULL);
|
(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(
|
ntfs_log_error(
|
||||||
"Error reading inode %lld.\n",
|
"Error reading inode %lld.\n",
|
||||||
(long long)ctx->mft_num);
|
(long long)ctx->mft_num);
|
||||||
|
|
Loading…
Reference in New Issue