Replace all sle64 zero test conditions with "sle64_cmpz(...)".

edge.strict_endians
Erik Larsson 2016-01-28 08:28:44 +01:00
parent 97ccd587d6
commit 5097bb9ea3
5 changed files with 9 additions and 9 deletions

View File

@ -187,7 +187,7 @@ s64 ntfs_get_attribute_value(const ntfs_volume *vol,
/* Attribute is not resident. */
/* If no data, return 0. */
if (!(a->data_size)) {
if (sle64_cmpz(a->data_size)) {
errno = 0;
return 0;
}
@ -455,7 +455,7 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
a->flags = 0;
if (le32_eq(type, AT_DATA)
&& (a->non_resident ? !a->initialized_size : le32_cmpz(a->value_length))) {
&& (a->non_resident ? sle64_cmpz(a->initialized_size) : le32_cmpz(a->value_length))) {
/*
* Define/redefine the compression state if stream is
* empty, based on the compression mark on parent
@ -655,7 +655,7 @@ static int ntfs_attr_map_partial_runlist(ntfs_attr *na, VCN vcn)
done = TRUE;
}
needed = highest_vcn + 1;
if (!a->lowest_vcn)
if (sle64_cmpz(a->lowest_vcn))
startseen = TRUE;
}
} else {
@ -5654,7 +5654,7 @@ retry:
CASE_SENSITIVE, from_vcn, NULL, 0, ctx)) {
a = ctx->attr;
m = ctx->mrec;
if (!a->lowest_vcn)
if (sle64_cmpz(a->lowest_vcn))
first_updated = TRUE;
/*
* If runlist is updating not from the beginning, then set

View File

@ -940,7 +940,7 @@ mpa_err:
goto err_out;
}
/* Setup not mapped runlist element if this is the base extent. */
if (!attr->lowest_vcn) {
if (sle64_cmpz(attr->lowest_vcn)) {
VCN max_cluster;
max_cluster = ((sle64_to_cpu(attr->allocated_size) +

View File

@ -1739,7 +1739,7 @@ static void walk_runs(struct ntfs_walk_cluster *walk)
* because its logical blocks may be larger than
* a cluster and split over two extents.
*/
if (mft_data && !a->lowest_vcn) {
if (mft_data && sle64_cmpz(a->lowest_vcn)) {
na = ntfs_attr_open(walk->image->ni,
AT_DATA, NULL, 0);
if (na) {
@ -1755,7 +1755,7 @@ static void walk_runs(struct ntfs_walk_cluster *walk)
perr_exit("Failed to open data of inode %lld",
(long long)walk->image->ni->mft_no);
}
if (index_i30 && !a->lowest_vcn) {
if (index_i30 && sle64_cmpz(a->lowest_vcn)) {
na = ntfs_attr_open(walk->image->ni,
AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4);
if (na) {

View File

@ -1346,7 +1346,7 @@ static void ntfs_dump_attribute_header(ntfs_attr_search_ctx *ctx,
(unsigned)a->compression_unit);
/* TODO: dump the 5 reserved bytes here in verbose mode */
if (!a->lowest_vcn) {
if (sle64_cmpz(a->lowest_vcn)) {
printf("\tData size:\t\t %llu (0x%llx)\n",
(long long)sle64_to_cpu(a->data_size),
(unsigned long long)sle64_to_cpu(a->data_size));

View File

@ -900,7 +900,7 @@ static s64 wipe_tails(ntfs_volume *vol, int byte, enum action act)
NULL, 0, ctx)) {
a = ctx->attr;
if (!ctx->al_entry || !ctx->al_entry->lowest_vcn) {
if (!ctx->al_entry || sle64_cmpz(ctx->al_entry->lowest_vcn)) {
name = (ntfschar*)((u8*)a
+ le16_to_cpu(a->name_offset));
attr_wiped = wipe_attr_tail(ni, name,