From: Szabolcs S. <sz...@us...> - 2007-07-20 21:52:07
|
Update of /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6706/libntfs-3g Modified Files: mft.c Log Message: ntfs_mft_bitmap_extend_allocation: rename ret to err to match similar function Index: mft.c =================================================================== RCS file: /cvsroot/ntfs-3g/ntfs-3g/libntfs-3g/mft.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- mft.c 16 Jul 2007 20:39:26 -0000 1.10 +++ mft.c 20 Jul 2007 21:52:07 -0000 1.11 @@ -565,7 +565,7 @@ ntfs_attr_search_ctx *ctx; MFT_RECORD *m = NULL; /* silence compiler warning */ ATTR_RECORD *a = NULL; /* silence compiler warning */ - int ret, mp_size; + int err, mp_size; u32 old_alen = 0; /* silence compiler warning */ u8 b, tb; struct { @@ -595,21 +595,21 @@ * hand as it may be in the MFT zone so the allocator would not give it * to us. */ - ret = (int)ntfs_attr_pread(lcnbmp_na, lcn >> 3, 1, &b); - if (ret < 0) { + err = (int)ntfs_attr_pread(lcnbmp_na, lcn >> 3, 1, &b); + if (err < 0) { ntfs_log_error("Failed to read from lcn bitmap.\n"); return -1; } - ntfs_log_debug("Read %i byte%s.\n", ret, ret == 1 ? "" : "s"); + ntfs_log_debug("Read %i byte%s.\n", err, err == 1 ? "" : "s"); tb = 1 << (lcn & 7ull); - if (ret == 1 && b != 0xff && !(b & tb)) { + if (err == 1 && b != 0xff && !(b & tb)) { /* Next cluster is free, allocate it. */ b |= tb; - ret = (int)ntfs_attr_pwrite(lcnbmp_na, lcn >> 3, 1, &b); - if (ret < 1) { + err = (int)ntfs_attr_pwrite(lcnbmp_na, lcn >> 3, 1, &b); + if (err < 1) { ntfs_log_error("Failed to write to lcn " "bitmap.\n"); - if (!ret) + if (!err) errno = EIO; return -1; } @@ -628,14 +628,14 @@ } rl = ntfs_runlists_merge(mftbmp_na->rl, rl2); if (!rl) { - ret = errno; + err = errno; ntfs_log_error("Failed to merge runlists for mft " "bitmap.\n"); if (ntfs_cluster_free_from_rl(vol, rl2)) ntfs_log_error("Failed to deallocate " "cluster.%s\n", es); free(rl2); - errno = ret; + errno = err; return -1; } mftbmp_na->rl = rl; @@ -727,7 +727,7 @@ ntfs_attr_put_search_ctx(ctx); return 0; restore_undo_alloc: - ret = errno; + err = errno; ntfs_attr_reinit_search_ctx(ctx); if (ntfs_attr_lookup(mftbmp_na->type, mftbmp_na->name, mftbmp_na->name_len, 0, rl[1].vcn, NULL, 0, ctx)) { @@ -739,15 +739,15 @@ * The only thing that is now wrong is ->allocated_size of the * base attribute extent which chkdsk should be able to fix. */ - errno = ret; + errno = err; return -1; } m = ctx->mrec; a = ctx->attr; a->highest_vcn = cpu_to_sle64(rl[1].vcn - 2); - errno = ret; + errno = err; undo_alloc: - ret = errno; + err = errno; if (status.added_cluster) { /* Truncate the last run in the runlist by one cluster. */ rl->length--; @@ -775,7 +775,7 @@ } if (ctx) ntfs_attr_put_search_ctx(ctx); - errno = ret; + errno = err; return -1; } |