summaryrefslogtreecommitdiff
Diffstat
-rwxr-xr-xAndroid.mk138
-rwxr-xr-xAndroid.mk.bak89
-rwxr-xr-xCREDITS20
-rwxr-xr-xINSTALL200
-rwxr-xr-xMakefile715
-rwxr-xr-xMakefile.am106
-rwxr-xr-xMakefile.in955
-rwxr-xr-xNEWS4
-rwxr-xr-xREADME80
-rwxr-xr-xTODO.ntfsprogs126
-rwxr-xr-xaclocal.m47091
-rwxr-xr-xcompile21
-rwxr-xr-xconfig.guess292
-rw-r--r--[-rwxr-xr-x]config.h165
-rwxr-xr-xconfig.h.in110
-rwxr-xr-xconfig.log3290
-rwxr-xr-xconfig.status1220
-rwxr-xr-xconfig.sub104
-rwxr-xr-xconfigure26448
-rwxr-xr-xconfigure.ac291
-rwxr-xr-xdepcomp87
-rwxr-xr-xinclude/Makefile.in181
-rwxr-xr-xinclude/fuse-lite/Makefile.in112
-rwxr-xr-xinclude/fuse-lite/fuse.h61
-rwxr-xr-xinclude/fuse-lite/fuse_common.h49
-rwxr-xr-xinclude/fuse-lite/fuse_kernel.h6
-rwxr-xr-xinclude/fuse-lite/fuse_lowlevel.h20
-rwxr-xr-xinclude/ntfs-3g/Makefile.am4
-rwxr-xr-xinclude/ntfs-3g/Makefile.in163
-rwxr-xr-xinclude/ntfs-3g/acls.h3
-rwxr-xr-xinclude/ntfs-3g/attrib.h50
-rwxr-xr-xinclude/ntfs-3g/cache.h7
-rwxr-xr-xinclude/ntfs-3g/compat.h6
-rwxr-xr-xinclude/ntfs-3g/compress.h6
-rwxr-xr-xinclude/ntfs-3g/debug.h4
-rwxr-xr-xinclude/ntfs-3g/device.h18
-rwxr-xr-xinclude/ntfs-3g/device_io.h21
-rwxr-xr-xinclude/ntfs-3g/dir.h11
-rwxr-xr-xinclude/ntfs-3g/layout.h32
-rwxr-xr-xinclude/ntfs-3g/lcnalloc.h1
-rwxr-xr-xinclude/ntfs-3g/logging.h3
-rwxr-xr-xinclude/ntfs-3g/mst.h3
-rwxr-xr-xinclude/ntfs-3g/ntfstime.h12
-rwxr-xr-xinclude/ntfs-3g/param.h72
-rwxr-xr-xinclude/ntfs-3g/realpath.h24
-rwxr-xr-xinclude/ntfs-3g/runlist.h3
-rwxr-xr-xinclude/ntfs-3g/security.h20
-rwxr-xr-xinclude/ntfs-3g/types.h8
-rwxr-xr-xinclude/ntfs-3g/unistr.h13
-rwxr-xr-xinclude/ntfs-3g/volume.h78
-rwxr-xr-xinclude/ntfs-3g/xattrs.h75
-rwxr-xr-xinstall-sh5
-rwxr-xr-xlibfuse-lite/Makefile.am3
-rwxr-xr-xlibfuse-lite/Makefile.in188
-rwxr-xr-xlibfuse-lite/fuse.c418
-rwxr-xr-xlibfuse-lite/fuse_kern_chan.c2
-rwxr-xr-xlibfuse-lite/fuse_lowlevel.c53
-rwxr-xr-xlibfuse-lite/fuse_opt.c20
-rwxr-xr-xlibfuse-lite/fuse_session.c12
-rwxr-xr-xlibfuse-lite/fusermount.c97
-rwxr-xr-xlibfuse-lite/helper.c21
-rwxr-xr-xlibfuse-lite/mount.c486
-rwxr-xr-xlibfuse-lite/mount_util.c246
-rwxr-xr-xlibfuse-lite/mount_util.h11
-rwxr-xr-xlibntfs-3g/Makefile.am15
-rwxr-xr-xlibntfs-3g/Makefile.in420
-rwxr-xr-xlibntfs-3g/acls.c219
-rwxr-xr-xlibntfs-3g/attrib.c1205
-rwxr-xr-xlibntfs-3g/bootsect.c4
-rwxr-xr-xlibntfs-3g/cache.c7
-rwxr-xr-xlibntfs-3g/compress.c962
-rwxr-xr-xlibntfs-3g/device.c252
-rwxr-xr-xlibntfs-3g/dir.c374
-rwxr-xr-xlibntfs-3g/efs.c217
-rwxr-xr-xlibntfs-3g/index.c30
-rwxr-xr-xlibntfs-3g/inode.c46
-rwxr-xr-xlibntfs-3g/lcnalloc.c36
-rw-r--r--libntfs-3g/libntfs-3g.pc10
-rw-r--r--libntfs-3g/libntfs-3g.script.so2
-rwxr-xr-xlibntfs-3g/logfile.c23
-rwxr-xr-xlibntfs-3g/logging.c24
-rwxr-xr-xlibntfs-3g/mft.c12
-rwxr-xr-xlibntfs-3g/mst.c24
-rwxr-xr-xlibntfs-3g/object_id.c9
-rwxr-xr-xlibntfs-3g/realpath.c103
-rwxr-xr-xlibntfs-3g/reparse.c67
-rwxr-xr-xlibntfs-3g/runlist.c62
-rwxr-xr-xlibntfs-3g/security.c345
-rwxr-xr-xlibntfs-3g/unistr.c244
-rwxr-xr-xlibntfs-3g/unix_io.c19
-rwxr-xr-xlibntfs-3g/volume.c365
-rwxr-xr-xlibntfs-3g/win32_io.c708
-rwxr-xr-xlibntfs-3g/xattrs.c791
-rwxr-xr-xlibtool9301
-rwxr-xr-xltmain.sh8439
-rwxr-xr-xm4/libtool.m47377
-rwxr-xr-xm4/ltoptions.m4368
-rwxr-xr-xm4/ltsugar.m4123
-rwxr-xr-xm4/ltversion.m423
-rwxr-xr-xm4/lt~obsolete.m492
-rwxr-xr-xmissing49
-rwxr-xr-xntfsprogs/Makefile.am154
-rwxr-xr-xntfsprogs/Makefile.in1199
-rwxr-xr-xntfsprogs/attrdef.c168
-rwxr-xr-xntfsprogs/attrdef.h7
-rwxr-xr-xntfsprogs/boot.c268
-rwxr-xr-xntfsprogs/boot.h7
-rwxr-xr-xntfsprogs/cluster.c118
-rwxr-xr-xntfsprogs/cluster.h39
-rwxr-xr-xntfsprogs/list.h194
-rw-r--r--ntfsprogs/mkntfs.8290
-rwxr-xr-xntfsprogs/mkntfs.8.in290
-rwxr-xr-xntfsprogs/mkntfs.c5177
-rw-r--r--ntfsprogs/ntfscat.8136
-rwxr-xr-xntfsprogs/ntfscat.8.in136
-rwxr-xr-xntfsprogs/ntfscat.c440
-rwxr-xr-xntfsprogs/ntfscat.h46
-rwxr-xr-xntfsprogs/ntfsck.c883
-rw-r--r--ntfsprogs/ntfsclone.8391
-rwxr-xr-xntfsprogs/ntfsclone.8.in391
-rwxr-xr-xntfsprogs/ntfsclone.c2701
-rw-r--r--ntfsprogs/ntfscluster.8124
-rwxr-xr-xntfsprogs/ntfscluster.8.in124
-rwxr-xr-xntfsprogs/ntfscluster.c563
-rwxr-xr-xntfsprogs/ntfscluster.h63
-rw-r--r--ntfsprogs/ntfscmp.877
-rwxr-xr-xntfsprogs/ntfscmp.8.in77
-rwxr-xr-xntfsprogs/ntfscmp.c1012
-rw-r--r--ntfsprogs/ntfscp.8111
-rwxr-xr-xntfsprogs/ntfscp.8.in111
-rwxr-xr-xntfsprogs/ntfscp.c590
-rwxr-xr-xntfsprogs/ntfsdecrypt.c1436
-rwxr-xr-xntfsprogs/ntfsdump_logfile.c779
-rw-r--r--ntfsprogs/ntfsfix.881
-rwxr-xr-xntfsprogs/ntfsfix.8.in81
-rwxr-xr-xntfsprogs/ntfsfix.c1657
-rw-r--r--ntfsprogs/ntfsinfo.889
-rwxr-xr-xntfsprogs/ntfsinfo.8.in89
-rwxr-xr-xntfsprogs/ntfsinfo.c2384
-rw-r--r--ntfsprogs/ntfslabel.8118
-rwxr-xr-xntfsprogs/ntfslabel.8.in118
-rwxr-xr-xntfsprogs/ntfslabel.c458
-rw-r--r--ntfsprogs/ntfsls.8172
-rwxr-xr-xntfsprogs/ntfsls.8.in172
-rwxr-xr-xntfsprogs/ntfsls.c717
-rwxr-xr-xntfsprogs/ntfsmftalloc.c368
-rwxr-xr-xntfsprogs/ntfsmove.c923
-rwxr-xr-xntfsprogs/ntfsmove.h46
-rw-r--r--ntfsprogs/ntfsprogs.869
-rwxr-xr-xntfsprogs/ntfsprogs.8.in69
-rw-r--r--ntfsprogs/ntfsresize.8326
-rwxr-xr-xntfsprogs/ntfsresize.8.in326
-rwxr-xr-xntfsprogs/ntfsresize.c4497
-rwxr-xr-xntfsprogs/ntfstruncate.c809
-rw-r--r--ntfsprogs/ntfsundelete.8324
-rwxr-xr-xntfsprogs/ntfsundelete.8.in324
-rwxr-xr-xntfsprogs/ntfsundelete.c2490
-rwxr-xr-xntfsprogs/ntfsundelete.h112
-rwxr-xr-xntfsprogs/ntfswipe.c2131
-rwxr-xr-xntfsprogs/ntfswipe.h54
-rwxr-xr-xntfsprogs/sd.c607
-rwxr-xr-xntfsprogs/sd.h11
-rwxr-xr-xntfsprogs/utils.c1184
-rwxr-xr-xntfsprogs/utils.h137
-rwxr-xr-xprog.IAB1071
-rwxr-xr-xprog.IAD5
-rwxr-xr-xprog.IMB466
-rwxr-xr-xprog.IMD2
-rwxr-xr-xprog.PFI2
-rwxr-xr-xprog.PO1
-rwxr-xr-xprog.PR14
-rwxr-xr-xprog.PRI219
-rwxr-xr-xprog.PS979
-rwxr-xr-xprog.SearchResults3
-rwxr-xr-xprog.WK39
-rwxr-xr-xsrc/Makefile.am86
-rwxr-xr-xsrc/Makefile.in938
-rwxr-xr-xsrc/lowntfs-3g.c1538
-rw-r--r--src/ntfs-3g.8448
-rwxr-xr-xsrc/ntfs-3g.8.in217
-rwxr-xr-xsrc/ntfs-3g.c1357
-rw-r--r--src/ntfs-3g.probe.881
-rwxr-xr-xsrc/ntfs-3g.probe.8.in4
-rwxr-xr-xsrc/ntfs-3g.probe.c9
-rw-r--r--src/ntfs-3g.secaudit.8184
-rwxr-xr-xsrc/ntfs-3g.secaudit.8.in15
-rw-r--r--src/ntfs-3g.usermap.896
-rwxr-xr-xsrc/ntfs-3g_common.c745
-rwxr-xr-xsrc/ntfs-3g_common.h185
-rwxr-xr-xsrc/secaudit.c673
-rwxr-xr-xsrc/secaudit.h32
-rwxr-xr-xsrc/usermap.c3
-rw-r--r--[-rwxr-xr-x]stamp-h10
193 files changed, 80411 insertions, 44563 deletions
diff --git a/ntfsprogs/ntfsmftalloc.c b/ntfsprogs/ntfsmftalloc.c
new file mode 100755
index 0000000..246ab54
--- a/dev/null
+++ b/ntfsprogs/ntfsmftalloc.c
@@ -0,0 +1,368 @@
+/**
+ * ntfsmftalloc - Part of the Linux-NTFS project.
+ *
+ * Copyright (c) 2002-2005 Anton Altaparmakov
+ *
+ * This utility will allocate and initialize an mft record.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (in the main directory of the Linux-NTFS source
+ * in the file COPYING); if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
+#endif
+#ifdef HAVE_STDARG_H
+# include <stdarg.h>
+#endif
+#ifdef HAVE_STRING_H
+# include <string.h>
+#endif
+#ifdef HAVE_ERRNO_H
+# include <errno.h>
+#endif
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else
+ extern int optind;
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifndef LLONG_MAX
+# define LLONG_MAX 9223372036854775807LL
+#endif
+
+#include "types.h"
+#include "attrib.h"
+#include "inode.h"
+#include "layout.h"
+#include "volume.h"
+#include "mft.h"
+#include "utils.h"
+/* #include "version.h" */
+#include "logging.h"
+
+static const char *EXEC_NAME = "ntfsmftalloc";
+
+/* Need these global so ntfsmftalloc_exit can access them. */
+static BOOL success = FALSE;
+
+static char *dev_name;
+
+static ntfs_volume *vol;
+static ntfs_inode *ni = NULL;
+static ntfs_inode *base_ni = NULL;
+static s64 base_mft_no = -1;
+
+static struct {
+ /* -h, print usage and exit. */
+ int no_action; /* -n, do not write to device, only display
+ what would be done. */
+ int quiet; /* -q, quiet execution. */
+ int verbose; /* -v, verbose execution, given twice, really
+ verbose execution (debug mode). */
+ int force; /* -f, force allocation. */
+ /* -V, print version and exit. */
+} opts;
+
+/**
+ * err_exit - error output and terminate; ignores quiet (-q)
+ */
+__attribute__((noreturn))
+__attribute__((format(printf, 1, 2)))
+static void err_exit(const char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, "ERROR: ");
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "Aborting...\n");
+ exit(1);
+}
+
+/**
+ * copyright - print copyright statements
+ */
+static void copyright(void)
+{
+ ntfs_log_info("Copyright (c) 2004-2005 Anton Altaparmakov\n"
+ "Allocate and initialize a base or an extent mft "
+ "record. If a base mft record\nis not specified, a "
+ "base mft record is allocated and initialized. "
+ "Otherwise,\nan extent mft record is allocated and "
+ "initialized to point to the specified\nbase mft "
+ "record.\n");
+}
+
+/**
+ * license - print license statement
+ */
+static void license(void)
+{
+ ntfs_log_info("%s", ntfs_gpl);
+}
+
+/**
+ * usage - print a list of the parameters to the program
+ */
+__attribute__((noreturn))
+static void usage(void)
+{
+ copyright();
+ ntfs_log_info("Usage: %s [options] device [base-mft-record]\n"
+ " -n Do not write to disk\n"
+ " -f Force execution despite errors\n"
+ " -q Quiet execution\n"
+ " -v Verbose execution\n"
+ " -vv Very verbose execution\n"
+ " -V Display version information\n"
+ " -l Display licensing information\n"
+ " -h Display this help\n", EXEC_NAME);
+ ntfs_log_info("%s%s", ntfs_bugs, ntfs_home);
+ exit(1);
+}
+
+/**
+ * parse_options
+ */
+static void parse_options(int argc, char *argv[])
+{
+ long long ll;
+ char *s;
+ int c;
+
+ if (argc && *argv)
+ EXEC_NAME = *argv;
+ ntfs_log_info("%s v%s (libntfs-3g)\n", EXEC_NAME, VERSION);
+ while ((c = getopt(argc, argv, "fh?nqvVl")) != EOF) {
+ switch (c) {
+ case 'f':
+ opts.force = 1;
+ break;
+ case 'n':
+ opts.no_action = 1;
+ break;
+ case 'q':
+ opts.quiet = 1;
+ ntfs_log_clear_levels(NTFS_LOG_LEVEL_QUIET);
+ break;
+ case 'v':
+ opts.verbose++;
+ ntfs_log_set_levels(NTFS_LOG_LEVEL_VERBOSE);
+ break;
+ case 'V':
+ /* Version number already printed, so just exit. */
+ exit(0);
+ case 'l':
+ copyright();
+ license();
+ exit(0);
+ case 'h':
+ case '?':
+ default:
+ usage();
+ }
+ }
+
+ if (opts.verbose > 1)
+ ntfs_log_set_levels(NTFS_LOG_LEVEL_DEBUG | NTFS_LOG_LEVEL_TRACE |
+ NTFS_LOG_LEVEL_VERBOSE | NTFS_LOG_LEVEL_QUIET);
+
+ if (optind == argc)
+ usage();
+ /* Get the device. */
+ dev_name = argv[optind++];
+ ntfs_log_verbose("device name = %s\n", dev_name);
+ if (optind != argc) {
+ /* Get the base mft record number. */
+ ll = strtoll(argv[optind++], &s, 0);
+ if (*s || !ll || (ll >= LLONG_MAX && errno == ERANGE))
+ err_exit("Invalid base mft record number: %s\n",
+ argv[optind - 1]);
+ base_mft_no = ll;
+ ntfs_log_verbose("base mft record number = 0x%llx\n", (long long)ll);
+ }
+ if (optind != argc)
+ usage();
+}
+
+/**
+ * dump_mft_record
+ */
+static void dump_mft_record(MFT_RECORD *m)
+{
+ ATTR_RECORD *a;
+ unsigned int u;
+ MFT_REF r;
+
+ ntfs_log_info("-- Beginning dump of mft record. --\n");
+ u = le32_to_cpu(m->magic);
+ ntfs_log_info("Mft record signature (magic) = %c%c%c%c\n", u & 0xff,
+ u >> 8 & 0xff, u >> 16 & 0xff, u >> 24 & 0xff);
+ u = le16_to_cpu(m->usa_ofs);
+ ntfs_log_info("Update sequence array offset = %u (0x%x)\n", u, u);
+ ntfs_log_info("Update sequence array size = %u\n", le16_to_cpu(m->usa_count));
+ ntfs_log_info("$LogFile sequence number (lsn) = %llu\n",
+ (unsigned long long)le64_to_cpu(m->lsn));
+ ntfs_log_info("Sequence number = %u\n", le16_to_cpu(m->sequence_number));
+ ntfs_log_info("Reference (hard link) count = %u\n",
+ le16_to_cpu(m->link_count));
+ u = le16_to_cpu(m->attrs_offset);
+ ntfs_log_info("First attribute offset = %u (0x%x)\n", u, u);
+ ntfs_log_info("Flags = %u: ", le16_to_cpu(m->flags));
+ if (m->flags & MFT_RECORD_IN_USE)
+ ntfs_log_info("MFT_RECORD_IN_USE");
+ else
+ ntfs_log_info("MFT_RECORD_NOT_IN_USE");
+ if (m->flags & MFT_RECORD_IS_DIRECTORY)
+ ntfs_log_info(" | MFT_RECORD_IS_DIRECTORY");
+ ntfs_log_info("\n");
+ u = le32_to_cpu(m->bytes_in_use);
+ ntfs_log_info("Bytes in use = %u (0x%x)\n", u, u);
+ u = le32_to_cpu(m->bytes_allocated);
+ ntfs_log_info("Bytes allocated = %u (0x%x)\n", u, u);
+ r = le64_to_cpu(m->base_mft_record);
+ ntfs_log_info("Base mft record reference:\n\tMft record number = %llu\n\t"
+ "Sequence number = %u\n",
+ (unsigned long long)MREF(r), MSEQNO(r));
+ ntfs_log_info("Next attribute instance = %u\n",
+ le16_to_cpu(m->next_attr_instance));
+ a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset));
+ ntfs_log_info("-- Beginning dump of attributes within mft record. --\n");
+ while ((char*)a < (char*)m + le32_to_cpu(m->bytes_in_use)) {
+ if (a->type == AT_END)
+ break;
+ a = (ATTR_RECORD*)((char*)a + le32_to_cpu(a->length));
+ };
+ ntfs_log_info("-- End of attributes. --\n");
+}
+
+/**
+ * ntfsmftalloc_exit
+ */
+static void ntfsmftalloc_exit(void)
+{
+ if (success)
+ return;
+ /* If there is a base inode, close that instead of the extent inode. */
+ if (base_ni)
+ ni = base_ni;
+ /* Close the inode. */
+ if (ni && ntfs_inode_close(ni)) {
+ ntfs_log_perror("Warning: Failed to close inode 0x%llx",
+ (long long)ni->mft_no);
+ }
+ /* Unmount the volume. */
+ if (ntfs_umount(vol, 0) == -1)
+ ntfs_log_perror("Warning: Could not umount %s", dev_name);
+}
+
+/**
+ * main
+ */
+int main(int argc, char **argv)
+{
+ unsigned long mnt_flags, ul;
+ int err;
+
+ ntfs_log_set_handler(ntfs_log_handler_outerr);
+
+ /* Initialize opts to zero / required values. */
+ memset(&opts, 0, sizeof(opts));
+ /* Parse command line options. */
+ parse_options(argc, argv);
+ utils_set_locale();
+ /* Make sure the file system is not mounted. */
+ if (ntfs_check_if_mounted(dev_name, &mnt_flags))
+ ntfs_log_error("Failed to determine whether %s is mounted: %s\n",
+ dev_name, strerror(errno));
+ else if (mnt_flags & NTFS_MF_MOUNTED) {
+ ntfs_log_error("%s is mounted.\n", dev_name);
+ if (!opts.force)
+ err_exit("Refusing to run!\n");
+ ntfs_log_error("ntfsmftalloc forced anyway. Hope /etc/mtab "
+ "is incorrect.\n");
+ }
+ /* Mount the device. */
+ if (opts.no_action) {
+ ntfs_log_quiet("Running in READ-ONLY mode!\n");
+ ul = NTFS_MNT_RDONLY;
+ } else
+ ul = 0;
+ vol = ntfs_mount(dev_name, ul);
+ if (!vol)
+ err_exit("Failed to mount %s: %s\n", dev_name, strerror(errno));
+ /* Register our exit function which will unlock and close the device. */
+ err = atexit(&ntfsmftalloc_exit);
+ if (err == -1) {
+ ntfs_log_error("Could not set up exit() function because atexit() "
+ "failed: %s Aborting...\n", strerror(errno));
+ ntfsmftalloc_exit();
+ exit(1);
+ }
+ if (base_mft_no != -1) {
+ base_ni = ntfs_inode_open(vol, base_mft_no);
+ if (!base_ni)
+ err_exit("Failed to open base inode 0x%llx: %s\n",
+ (long long)base_mft_no,
+ strerror(errno));
+ }
+ /* Open the specified inode. */
+ ni = ntfs_mft_record_alloc(vol, base_ni);
+ if (!ni)
+ err_exit("Failed to allocate mft record: %s\n",
+ strerror(errno));
+ ntfs_log_info("Allocated %s mft record 0x%llx", base_ni ? "extent" : "base",
+ (long long)ni->mft_no);
+ if (base_ni)
+ ntfs_log_info(" with base mft record 0x%llx",
+ (long long)base_mft_no);
+ ntfs_log_info(".\n");
+ if (!opts.quiet && opts.verbose > 1) {
+ ntfs_log_verbose("Dumping allocated mft record 0x%llx:\n",
+ (long long)ni->mft_no);
+ dump_mft_record(ni->mrec);
+ }
+ /* Close the (base) inode. */
+ if (base_ni)
+ ni = base_ni;
+ err = ntfs_inode_close(ni);
+ if (err)
+ err_exit("Failed to close inode 0x%llx: %s\n",
+ (long long)ni->mft_no, strerror(errno));
+ /* Unmount the volume. */
+ err = ntfs_umount(vol, 0);
+ /* Disable our ntfsmftalloc_exit() handler. */
+ success = TRUE;
+ if (err == -1)
+ ntfs_log_perror("Warning: Failed to umount %s", dev_name);
+ else
+ ntfs_log_quiet("ntfsmftalloc completed successfully.\n");
+ return 0;
+}