na->ni->flags |= flag;
else
ntfs_log_trace("Denied setting flag %d for not unnamed data "
- "attribute\n", flag);
+ "attribute\n", le32_to_cpu(flag));
}
static void NAttrClearFlag(ntfs_attr *na, FILE_ATTR_FLAGS flag)
le16 cs;
ntfs_log_enter("Entering for inode %lld, attr 0x%x.\n",
- (unsigned long long)ni->mft_no, type);
+ (unsigned long long)ni->mft_no, le32_to_cpu(type));
if (!ni || !ni->vol || !ni->mrec) {
errno = EINVAL;
errno = EIO;
ntfs_log_perror("Inode %lld has corrupt attribute flags "
"(0x%x <> 0x%x)",(unsigned long long)ni->mft_no,
- a->flags, na->ni->flags);
+ le16_to_cpu(a->flags), le32_to_cpu(na->ni->flags));
goto put_err_out;
}
errno = EIO;
ntfs_log_perror("Compressed inode %lld attr 0x%x has "
"no compression unit",
- (unsigned long long)ni->mft_no, type);
+ (unsigned long long)ni->mft_no, le32_to_cpu(type));
goto put_err_out;
}
ntfs_attr_init(na, TRUE, a->flags,
ntfs_attr_search_ctx *ctx;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn 0x%llx.\n",
- (unsigned long long)na->ni->mft_no, na->type, (long long)vcn);
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type), (long long)vcn);
lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn);
if (lcn >= 0 || lcn == LCN_HOLE || lcn == LCN_ENOENT)
int not_mapped;
ntfs_log_enter("Entering for inode %llu, attr 0x%x.\n",
- (unsigned long long)na->ni->mft_no, na->type);
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type));
/* avoid multiple full runlist mappings */
if (NAttrFullyMapped(na)) {
return (LCN)LCN_EINVAL;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
- long)na->ni->mft_no, na->type);
+ long)na->ni->mft_no, le32_to_cpu(na->type));
retry:
/* Convert vcn to lcn. If that fails map the runlist and retry once. */
lcn = ntfs_rl_vcn_to_lcn(na->rl, vcn);
}
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, vcn %llx\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)vcn);
retry:
rl = na->rl;
ntfs_log_enter("Entering for inode %lld attr 0x%x pos %lld count "
"%lld\n", (unsigned long long)na->ni->mft_no,
- na->type, (long long)pos, (long long)count);
+ le32_to_cpu(na->type), (long long)pos, (long long)count);
ret = ntfs_attr_pread_i(na, pos, count, b);
BOOL compressed;
ntfs_log_enter("Entering for inode %lld, attr 0x%x, pos 0x%llx, count "
- "0x%llx.\n", (long long)na->ni->mft_no, na->type,
+ "0x%llx.\n", (long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)pos, (long long)count);
if (!na || !na->ni || !na->ni->vol || !b || pos < 0 || count < 0) {
BOOL compressed;
ntfs_log_enter("Entering for inode 0x%llx, attr 0x%x.\n",
- na->ni->mft_no, na->type);
+ na->ni->mft_no, le32_to_cpu(na->type));
if (!na || !na->ni || !na->ni->vol) {
errno = EINVAL;
BOOL warn;
ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)pos);
if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) {
errno = EINVAL;
s64 written, i;
ntfs_log_trace("Entering for inode 0x%llx, attr type 0x%x, pos 0x%llx.\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)pos);
if (bk_cnt < 0 || bk_size % NTFS_BLOCK_SIZE) {
errno = EINVAL;
ntfschar *upcase;
u32 upcase_len;
- ntfs_log_trace("attribute type 0x%x.\n", type);
+ ntfs_log_trace("attribute type 0x%x.\n", le32_to_cpu(type));
if (ctx->ntfs_ino) {
vol = ctx->ntfs_ino->vol;
ni = ctx->ntfs_ino;
base_ni = ctx->base_ntfs_ino;
ntfs_log_trace("Entering for inode %lld, attribute type 0x%x.\n",
- (unsigned long long)ni->mft_no, type);
+ (unsigned long long)ni->mft_no, le32_to_cpu(type));
if (!base_ni) {
/* First call happens with the base mft record. */
base_ni = ctx->base_ntfs_ino = ctx->ntfs_ino;
ntfs_inode *base_ni;
int ret = -1;
- ntfs_log_enter("Entering for attribute type 0x%x\n", type);
+ ntfs_log_enter("Entering for attribute type 0x%x\n", le32_to_cpu(type));
if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED &&
(!ctx->ntfs_ino || !(vol = ctx->ntfs_ino->vol) ||
if (!vol || !vol->attrdef || !type) {
errno = EINVAL;
- ntfs_log_perror("%s: type=%d", __FUNCTION__, type);
+ ntfs_log_perror("%s: type=%d", __FUNCTION__, le32_to_cpu(type));
return NULL;
}
for (ad = vol->attrdef; (u8*)ad - (u8*)vol->attrdef <
break;
}
errno = ENOENT;
- ntfs_log_perror("%s: type=%d", __FUNCTION__, type);
+ ntfs_log_perror("%s: type=%d", __FUNCTION__, le32_to_cpu(type));
return NULL;
}
((max_size > 0) && (size > max_size))) {
errno = ERANGE;
ntfs_log_perror("Attr type %d size check failed (min,size,max="
- "%lld,%lld,%lld)", type, (long long)min_size,
+ "%lld,%lld,%lld)", le32_to_cpu(type), (long long)min_size,
(long long)size, (long long)max_size);
return -1;
}
ntfs_inode *base_ni;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, flags 0x%x.\n",
- (long long) ni->mft_no, (unsigned) type, (unsigned) data_flags);
+ (long long) ni->mft_no, (unsigned) le32_to_cpu(type), (unsigned) le16_to_cpu(data_flags));
if (!ni || (!name && name_len)) {
errno = EINVAL;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x, lowest_vcn %lld, "
"dataruns_size %d, flags 0x%x.\n",
- (long long) ni->mft_no, (unsigned) type,
- (long long) lowest_vcn, dataruns_size, (unsigned) flags);
+ (long long) ni->mft_no, (unsigned) le32_to_cpu(type),
+ (long long) lowest_vcn, dataruns_size, (unsigned) le16_to_cpu(flags));
if (!ni || dataruns_size <= 0 || (!name && name_len)) {
errno = EINVAL;
if (!ntfs_attr_find(type, name, name_len, CASE_SENSITIVE, NULL, 0,
ctx)) {
err = EEXIST;
- ntfs_log_perror("Attribute 0x%x already present", type);
+ ntfs_log_perror("Attribute 0x%x already present", le32_to_cpu(type));
goto put_err_out;
}
if (errno != ENOENT) {
}
ntfs_log_trace("Entering for inode %lld, attr %x, size %lld.\n",
- (long long)ni->mft_no, type, (long long)size);
+ (long long)ni->mft_no, le32_to_cpu(type), (long long)size);
if (ni->nr_extents == -1)
ni = ni->base_ni;
}
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n",
- (long long) na->ni->mft_no, na->type);
+ (long long) na->ni->mft_no, le32_to_cpu(na->type));
/* Free cluster allocation. */
if (NAttrNonResident(na)) {
int mp_size, mp_ofs, name_ofs, arec_size, err;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
- long)na->ni->mft_no, na->type);
+ long)na->ni->mft_no, le32_to_cpu(na->type));
/* Some preliminary sanity checking. */
if (NAttrNonResident(na)) {
int err, ret = STATUS_ERROR;
ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)newsize);
/* Get the attribute record that needs modification. */
s64 arec_size, bytes_read;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x.\n", (unsigned long
- long)na->ni->mft_no, na->type);
+ long)na->ni->mft_no, le32_to_cpu(na->type));
/* Should be called for the first extent of the attribute. */
if (sle64_to_cpu(a->lowest_vcn)) {
int sparse, ret = 0;
ntfs_log_trace("Entering for inode 0x%llx, attr 0x%x\n",
- (unsigned long long)na->ni->mft_no, na->type);
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type));
if (a->lowest_vcn)
goto out;
}
ntfs_log_trace("Entering for inode %llu, attr 0x%x\n",
- (unsigned long long)na->ni->mft_no, na->type);
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type));
if (!NAttrNonResident(na)) {
errno = EINVAL;
int err;
ntfs_log_trace("Inode 0x%llx attr 0x%x new size %lld\n", (unsigned long long)
- na->ni->mft_no, na->type, (long long)newsize);
+ na->ni->mft_no, le32_to_cpu(na->type), (long long)newsize);
vol = na->ni->vol;
int err;
ntfs_log_trace("Inode %lld, attr 0x%x, new size %lld old size %lld\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)newsize, (long long)na->data_size);
vol = na->ni->vol;
}
ntfs_log_enter("Entering for inode %lld, attr 0x%x, size %lld\n",
- (unsigned long long)na->ni->mft_no, na->type,
+ (unsigned long long)na->ni->mft_no, le32_to_cpu(na->type),
(long long)newsize);
if (na->data_size == newsize) {
/* do not log removal of non-existent stream */
if (type != AT_DATA) {
ntfs_log_perror("Failed to open attribute 0x%02x of inode "
- "0x%llx", type, (unsigned long long)ni->mft_no);
+ "0x%llx", le32_to_cpu(type), (unsigned long long)ni->mft_no);
}
return -1;
}
ret = ntfs_attr_rm(na);
if (ret)
ntfs_log_perror("Failed to remove attribute 0x%02x of inode "
- "0x%llx", type, (unsigned long long)ni->mft_no);
+ "0x%llx", le32_to_cpu(type), (unsigned long long)ni->mft_no);
ntfs_attr_close(na);
return ret;