From c214b9c11cc244db9dc5012ab9186f0e63324c39 Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 8 Jul 2007 20:45:14 +0000 Subject: [PATCH] No need to check for ENOSPC because ntfs_log_perror() does it now --- libntfs-3g/attrib.c | 11 +++-------- libntfs-3g/index.c | 8 +++----- src/ntfs-3g.c | 2 +- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index a89b77f1..ddfb150d 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -3489,9 +3489,7 @@ static int ntfs_attr_make_non_resident(ntfs_attr *na, rl = ntfs_cluster_alloc(vol, 0, new_allocated_size >> vol->cluster_size_bits, -1, DATA_ZONE); if (!rl) { - if (errno != ENOSPC) - ntfs_log_trace("Eeek! Failed to allocate " - "cluster(s). Aborting...\n"); + ntfs_log_perror("Failed to allocate clusters"); return -1; } } else @@ -4247,15 +4245,12 @@ retry: ntfs_attr_put_search_ctx(ctx); if (ntfs_inode_free_space(na->ni, mp_size - cur_max_mp_size)) { - if (errno != ENOSPC) - return -1; - ntfs_log_error("Attribute list mapping " - "pairs size to big, " + ntfs_log_perror("Attribute list mapping" + " pairs size to big, " "can't fit them in the " "base MFT record. " "Defragment volume and " "try once again.\n"); - errno = ENOSPC; return -1; } goto retry; diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c index e28d6457..383d27fb 100644 --- a/libntfs-3g/index.c +++ b/libntfs-3g/index.c @@ -87,10 +87,8 @@ static int ntfs_ib_write(ntfs_index_context *icx, VCN vcn, void *buf) ret = ntfs_attr_mst_pwrite(icx->ia_na, ntfs_ib_vcn_to_pos(icx, vcn), 1, icx->block_size, buf); if (ret != 1) { - if (errno != ENOSPC) - ntfs_log_perror("Failed to write index block %lld of " - "inode %llu", (long long)vcn, - (unsigned long long)icx->ni->mft_no); + ntfs_log_perror("Failed to write index block %lld, inode %llu", + (long long)vcn, (unsigned long long)icx->ni->mft_no); return STATUS_ERROR; } @@ -1222,7 +1220,7 @@ static int ntfs_ir_truncate(ntfs_index_context *icx, int data_size) icx->ir->index.allocated_size = cpu_to_le32(data_size); - } else if (errno != ENOSPC) + } else ntfs_log_perror("Failed to truncate INDEX_ROOT"); ntfs_attr_close(na); diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 0092b1a7..0d4283ac 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -742,7 +742,7 @@ static int ntfs_fuse_write(const char *org_path, const char *buf, size_t size, } while (size) { res = ntfs_attr_pwrite(na, offset, size, buf); - if (res < (s64)size && errno != ENOSPC) + if (res < (s64)size) ntfs_log_perror("ntfs_attr_pwrite partial write (%lld: " "%lld <> %d)", (s64)offset, (s64)size, res); if (res <= 0) {