Changes by: flatcap
Update of /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2642/ntfsprogs
Modified Files:
mkntfs.c ntfscat.c ntfsclone.c ntfscluster.c ntfscluster.h
ntfscp.c ntfsdump_logfile.c ntfsfix.c ntfsinfo.c ntfsmove.c
ntfsresize.c ntfsrm.c ntfsrm.h ntfstruncate.c ntfsundelete.c
ntfswipe.c sd.c
Log Message:
Tidy whitespace: trailing space; <space><tab> at the beginning of lines
Fix warnings about sign differences
Fix warnings about unused parameters
Tidy a few functions that didn't have { on a new line
Index: mkntfs.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/mkntfs.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -p -r1.57 -r1.58
--- mkntfs.c 6 Jun 2005 14:29:47 -0000 1.57
+++ mkntfs.c 19 Jun 2005 21:09:41 -0000 1.58
@@ -135,8 +135,7 @@ switch if you want to be able to build t
extern const unsigned char attrdef_ntfs12_array[2400];
extern const unsigned char boot_array[3429];
-extern void init_system_file_sd(int sys_file_no, char **sd_val,
- int *sd_val_len);
+extern void init_system_file_sd(int sys_file_no, u8 **sd_val, int *sd_val_len);
extern void init_upcase_table(ntfschar *uc, u32 uc_len);
/* Page size on ia32. Can change to 8192 on Alpha. */
@@ -145,13 +144,13 @@ extern void init_upcase_table(ntfschar *
const char *EXEC_NAME = "mkntfs";
/* Need these global so mkntfs_exit can access them. */
-char *buf = NULL;
-char *buf2 = NULL;
+u8 *buf = NULL;
+u8 *buf2 = NULL;
int buf2_size = 0;
int mft_bitmap_size, mft_bitmap_byte_size;
-unsigned char *mft_bitmap = NULL;
+u8 *mft_bitmap = NULL;
int lcn_bitmap_byte_size;
-unsigned char *lcn_bitmap = NULL;
+u8 *lcn_bitmap = NULL;
runlist *rl_mft = NULL, *rl_mft_bmp = NULL, *rl_mftmirr = NULL;
runlist *rl_logfile = NULL, *rl_boot = NULL, *rl_bad = NULL, *rl_index;
INDEX_ALLOCATION *index_block = NULL;
@@ -174,7 +173,7 @@ struct {
long long logfile_lcn; /* lcn of $LogFile, $DATA. */
int logfile_size; /* in bytes, determined from
volume_size. */
- int mft_zone_multiplier; /* -z, value from 1 to 4. Default is
+ int mft_zone_multiplier; /* -z, value from 1 to 4. Default is
1. */
long long mft_zone_end; /* Determined from volume_size and
mft_zone_multiplier, in clusters. */
@@ -251,7 +250,7 @@ GEN_PRINTF(Qprintf, stdout, &opts.quiet,
/**
* err_exit - error output and terminate; ignores quiet (-q)
*/
-static void err_exit(const char *fmt, ...)
+static void err_exit(const char *fmt, ...)
__attribute__((noreturn))
__attribute__((format(printf, 1, 2)));
static void err_exit(const char *fmt, ...)
@@ -520,7 +519,7 @@ static __inline__ long long mkntfs_write
* Note: Might not return.
*/
static s64 ntfs_rlwrite(struct ntfs_device *dev, const runlist *rl,
- const char *val, const s64 val_len, s64 *inited_size)
+ const u8 *val, const s64 val_len, s64 *inited_size)
{
s64 bytes_written, total, length, delta;
int retry, i;
@@ -1191,7 +1190,7 @@ err_end:
static int insert_positioned_attr_in_mft_record(MFT_RECORD *m,
const ATTR_TYPES type, const char *name, u32 name_len,
const IGNORE_CASE_BOOL ic, const ATTR_FLAGS flags,
- const runlist *rl, const char *val, const s64 val_len)
+ const runlist *rl, const u8 *val, const s64 val_len)
{
ntfs_attr_search_ctx *ctx;
ATTR_RECORD *a;
@@ -1376,7 +1375,7 @@ err_out:
static int insert_non_resident_attr_in_mft_record(MFT_RECORD *m,
const ATTR_TYPES type, const char *name, u32 name_len,
const IGNORE_CASE_BOOL ic, const ATTR_FLAGS flags,
- const char *val, const s64 val_len)
+ const u8 *val, const s64 val_len)
{
ntfs_attr_search_ctx *ctx;
ATTR_RECORD *a;
@@ -1568,7 +1567,7 @@ static int insert_resident_attr_in_mft_r
const ATTR_TYPES type, const char *name, u32 name_len,
const IGNORE_CASE_BOOL ic, const ATTR_FLAGS flags,
const RESIDENT_ATTR_FLAGS res_flags,
- const char *val, const u32 val_len)
+ const u8 *val, const u32 val_len)
{
ntfs_attr_search_ctx *ctx;
ATTR_RECORD *a;
@@ -1698,7 +1697,7 @@ static int add_attr_std_info(MFT_RECORD
}
/* NTFS 1.2: size of si = 48, NTFS 3.0: size of si = 72 */
err = insert_resident_attr_in_mft_record(m, AT_STANDARD_INFORMATION,
- NULL, 0, 0, 0, 0, (char*)&si,
+ NULL, 0, 0, 0, 0, (u8*)&si,
vol->major_ver < 3 ? 48 : 72);
if (err < 0)
Eprintf("add_attr_std_info failed: %s\n", strerror(-err));
@@ -1778,7 +1777,7 @@ static int add_attr_file_name(MFT_RECORD
fn->file_name_length = i;
fn_size = sizeof(FILE_NAME_ATTR) + i * sizeof(ntfschar);
i = insert_resident_attr_in_mft_record(m, AT_FILE_NAME, NULL, 0, 0,
- 0, RESIDENT_ATTR_IS_INDEXED, (char*)fn, fn_size);
+ 0, RESIDENT_ATTR_IS_INDEXED, (u8*)fn, fn_size);
free(fn);
if (i < 0)
Eprintf("add_attr_file_name failed: %s\n", strerror(-i));
@@ -1792,7 +1791,7 @@ static int add_attr_file_name(MFT_RECORD
*
* Return 0 on success or -errno on error.
*/
-static int add_attr_sd(MFT_RECORD *m, const char *sd, const s64 sd_len)
+static int add_attr_sd(MFT_RECORD *m, const u8 *sd, const s64 sd_len)
{
int err;
@@ -1817,7 +1816,7 @@ static int add_attr_sd(MFT_RECORD *m, co
*/
static int add_attr_data(MFT_RECORD *m, const char *name, const u32 name_len,
const IGNORE_CASE_BOOL ic, const ATTR_FLAGS flags,
- const char *val, const s64 val_len)
+ const u8 *val, const s64 val_len)
{
int err;
@@ -1857,7 +1856,7 @@ static int add_attr_data(MFT_RECORD *m,
static int add_attr_data_positioned(MFT_RECORD *m, const char *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
const ATTR_FLAGS flags, const runlist *rl,
- const char *val, const s64 val_len)
+ const u8 *val, const s64 val_len)
{
int err;
@@ -1904,7 +1903,7 @@ static int add_attr_vol_name(MFT_RECORD
len = 0;
}
i = insert_resident_attr_in_mft_record(m, AT_VOLUME_NAME, NULL, 0, 0,
- 0, 0, (char*)uname, len);
+ 0, 0, (u8*)uname, len);
if (uname)
free(uname);
if (i < 0)
@@ -1927,7 +1926,7 @@ static int add_attr_vol_info(MFT_RECORD
vi.minor_ver = minor_ver;
vi.flags = flags & VOLUME_FLAGS_MASK;
err = insert_resident_attr_in_mft_record(m, AT_VOLUME_INFORMATION, NULL,
- 0, 0, 0, 0, (char*)&vi, sizeof(vi));
+ 0, 0, 0, 0, (u8*)&vi, sizeof(vi));
if (err < 0)
Eprintf("add_attr_vol_info failed: %s\n", strerror(-err));
return err;
@@ -2006,7 +2005,7 @@ static int add_attr_index_root(MFT_RECOR
e->flags = INDEX_ENTRY_END;
e->reserved = cpu_to_le16(0);
err = insert_resident_attr_in_mft_record(m, AT_INDEX_ROOT, name,
- name_len, ic, 0, 0, (char*)r, val_len);
+ name_len, ic, 0, 0, (u8*)r, val_len);
free(r);
if (err < 0)
Eprintf("add_attr_index_root failed: %s\n", strerror(-err));
@@ -2019,7 +2018,7 @@ static int add_attr_index_root(MFT_RECOR
*/
static int add_attr_index_alloc(MFT_RECORD *m, const char *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
- const char *index_alloc_val, const u32 index_alloc_val_len)
+ const u8 *index_alloc_val, const u32 index_alloc_val_len)
{
int err;
@@ -2036,7 +2035,7 @@ static int add_attr_index_alloc(MFT_RECO
* Return 0 on success or -errno on error.
*/
static int add_attr_bitmap(MFT_RECORD *m, const char *name, const u32 name_len,
- const IGNORE_CASE_BOOL ic, const char *bitmap,
+ const IGNORE_CASE_BOOL ic, const u8 *bitmap,
const u32 bitmap_len)
{
int err;
@@ -2065,7 +2064,7 @@ static int add_attr_bitmap(MFT_RECORD *m
*/
static int add_attr_bitmap_positioned(MFT_RECORD *m, const char *name,
const u32 name_len, const IGNORE_CASE_BOOL ic,
- const runlist *rl, const char *bitmap, const u32 bitmap_len)
+ const runlist *rl, const u8 *bitmap, const u32 bitmap_len)
{
int err;
@@ -2095,7 +2094,7 @@ static int upgrade_to_large_index(MFT_RE
INDEX_ENTRY *re;
INDEX_ALLOCATION *ia_val = NULL;
ntfschar *uname;
- char bmp[8];
+ u8 bmp[8];
char *re_start, *re_end;
int i, err, index_block_size;
@@ -2147,7 +2146,7 @@ static int upgrade_to_large_index(MFT_RE
memset(bmp, 0, sizeof(bmp));
ntfs_bit_set(bmp, 0ULL, 1);
/* Bitmap has to be at least 8 bytes in size. */
- err = add_attr_bitmap(m, name, name_len, ic, (char*)&bmp, sizeof(bmp));
+ err = add_attr_bitmap(m, name, name_len, ic, bmp, sizeof(bmp));
if (err)
goto err_out;
ia_val = calloc(1, index_block_size);
@@ -2224,7 +2223,7 @@ static int upgrade_to_large_index(MFT_RE
"upgrade_to_large_index.\n");
goto err_out;
}
- err = add_attr_index_alloc(m, name, name_len, ic, (char*)ia_val,
+ err = add_attr_index_alloc(m, name, name_len, ic, (u8*)ia_val,
index_block_size);
ntfs_mst_post_write_fixup((NTFS_RECORD*)ia_val);
if (err) {
@@ -2491,7 +2490,7 @@ static int create_hardlink(INDEX_BLOCK *
m_file->link_count = cpu_to_le16(i + 1);
/* Add the file_name to @m_file. */
i = insert_resident_attr_in_mft_record(m_file, AT_FILE_NAME, NULL, 0, 0,
- 0, RESIDENT_ATTR_IS_INDEXED, (char*)fn, fn_size);
+ 0, RESIDENT_ATTR_IS_INDEXED, (u8*)fn, fn_size);
if (i < 0) {
Eprintf("create_hardlink failed adding file name attribute: "
"%s\n", strerror(-i));
@@ -2883,7 +2882,7 @@ static void mkntfs_override_phys_params(
static void mkntfs_initialize_bitmaps(void)
{
int i, j;
-
+
/* Determine lcn bitmap byte size and allocate it. */
lcn_bitmap_byte_size = (opts.nr_clusters + 7) >> 3;
/* Needs to be multiple of 8 bytes. */
@@ -2949,7 +2948,7 @@ static void mkntfs_initialize_bitmaps(vo
static void mkntfs_initialize_rl_mft(void)
{
int i, j;
-
+
/* If user didn't specify the mft lcn, determine it now. */
if (!opts.mft_lcn) {
/*
@@ -3224,7 +3223,7 @@ static void mkntfs_fill_device_with_zero
static void create_file_volume(MFT_RECORD *m, MFT_REF root_ref, VOLUME_FLAGS fl)
{
int i, err;
- char *sd;
+ u8 *sd;
Vprintf("Creating $Volume (mft record 3)\n");
m = (MFT_RECORD*)(buf + 3 * vol->mft_record_size);
@@ -3256,7 +3255,7 @@ static void create_file_volume(MFT_RECOR
*
* Return 0 on success or 1 if it couldn't be created.
*/
-static int create_backup_boot_sector(char *buff, int size)
+static int create_backup_boot_sector(u8 *buff, int size)
{
ssize_t bw;
int _e = errno;
@@ -3304,7 +3303,7 @@ static void mkntfs_create_root_structure
MFT_RECORD *m;
MFT_REF root_ref;
int i, j, err;
- char *sd;
+ u8 *sd;
VOLUME_FLAGS volume_flags = 0;
Qprintf("Creating NTFS volume structures.\n");
@@ -3473,7 +3472,7 @@ static void mkntfs_create_root_structure
buf2_size = 36000;
else
buf2_size = opts.attr_defs_len;
- buf2 = (char*)calloc(1, buf2_size);
+ buf2 = calloc(1, buf2_size);
if (!buf2)
err_exit("Failed to allocate internal buffer: %s\n",
strerror(errno));
@@ -3598,7 +3597,7 @@ static void mkntfs_create_root_structure
}
if (err < 0)
err_exit("Couldn't create $Boot: %s\n", strerror(-err));
-
+
if (create_backup_boot_sector(buf2, i) != 0) {
/*
* Pre-2.6 kernels couldn't access the last sector
@@ -3651,7 +3650,7 @@ static void mkntfs_create_root_structure
//dump_mft_record(m);
Vprintf("Creating $UpCase (mft record 0xa)\n");
m = (MFT_RECORD*)(buf + 0xa * vol->mft_record_size);
- err = add_attr_data(m, NULL, 0, 0, 0, (char*)vol->upcase,
+ err = add_attr_data(m, NULL, 0, 0, 0, (u8*)vol->upcase,
vol->upcase_len << 1);
if (!err)
err = create_hardlink(index_block, root_ref, m,
@@ -3790,7 +3789,7 @@ int main(int argc, char **argv)
if (err)
err_exit("ntfs_mst_pre_write_fixup() failed while syncing "
"root directory index block.\n");
- lw = ntfs_rlwrite(vol->dev, rl_index, (char*)index_block, i, NULL);
+ lw = ntfs_rlwrite(vol->dev, rl_index, (u8*)index_block, i, NULL);
if (lw != i)
err_exit("Error writing $INDEX_ALLOCATION.\n");
/* No more changes to @index_block below here so no need for fixup: */
Index: ntfscat.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscat.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -p -r1.14 -r1.15
--- ntfscat.c 12 Jun 2005 18:12:56 -0000 1.14
+++ ntfscat.c 19 Jun 2005 21:09:41 -0000 1.15
@@ -215,7 +215,7 @@ static int cat (ntfs_volume *vol __attri
int namelen __attribute__((unused)))
{
/* increase 1024 only if you fix partial writes below */
- const int bufsize = 1024;
+ const int bufsize = 1024;
char *buffer;
ntfs_attr *attr;
s64 bytes_read, written;
@@ -279,25 +279,25 @@ int main (int argc, char *argv[])
vol = utils_mount_volume (opts.device, MS_RDONLY, opts.force);
if (!vol) {
- perror("ERROR: couldn't mount volume");
+ perror("ERROR: couldn't mount volume");
return 1;
}
- if (opts.inode != -1)
- inode = ntfs_inode_open (vol, opts.inode);
- else
- inode = ntfs_pathname_to_inode (vol, NULL, opts.file);
+ if (opts.inode != -1)
+ inode = ntfs_inode_open (vol, opts.inode);
+ else
+ inode = ntfs_pathname_to_inode (vol, NULL, opts.file);
if (!inode) {
- perror("ERROR: Couldn't open inode");
+ perror("ERROR: Couldn't open inode");
return 1;
}
- attr = AT_DATA;
- if (opts.attr != (ATTR_TYPES)-1)
- attr = opts.attr;
-
- result = cat (vol, inode, attr, NULL, 0);
+ attr = AT_DATA;
+ if (opts.attr != (ATTR_TYPES)-1)
+ attr = opts.attr;
+
+ result = cat (vol, inode, attr, NULL, 0);
ntfs_inode_close (inode);
ntfs_umount (vol, FALSE);
Index: ntfsclone.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsclone.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -p -r1.44 -r1.45
--- ntfsclone.c 12 Jun 2005 14:35:57 -0000 1.44
+++ ntfsclone.c 19 Jun 2005 21:09:41 -0000 1.45
@@ -60,7 +60,7 @@ struct {
int force;
int overwrite;
int std_out;
- int blkdev_out; /* output file is block device */
+ int blkdev_out; /* output file is block device */
int metadata_only;
int ignore_fs_check;
int rescue;
@@ -300,7 +300,7 @@ static void parse_options(int argc, char
usage();
}
}
-
+
if (opt.output == NULL) {
err_printf("You must specify an output file.\n");
usage();
@@ -321,7 +321,7 @@ static void parse_options(int argc, char
if (opt.metadata_only && opt.restore_image)
err_exit("Restoring only metadata from an image is not "
"supported!\n");
-
+
if (opt.metadata_only && opt.std_out)
err_exit("Cloning only metadata to stdout isn't supported!\n");
@@ -332,13 +332,13 @@ static void parse_options(int argc, char
if (opt.save_image && opt.restore_image)
err_exit("Saving and restoring an image at the same time "
"is not supported!\n");
-
+
if (!opt.std_out) {
struct stat st;
-
+
if (stat(opt.output, &st) == -1) {
if (errno != ENOENT)
- perr_exit("Couldn't access '%s'", opt.output);
+ perr_exit("Couldn't access '%s'", opt.output);
} else {
if (!opt.overwrite)
err_exit("Output file '%s' already exists.\n"
@@ -352,16 +352,16 @@ static void parse_options(int argc, char
"block device isn't supported!\n");
}
}
- }
-
+ }
+
msg_out = stdout;
-
+
/* FIXME: this is a workaround for loosing debug info if stdout != stderr
and for the uncontrollable verbose messages in libntfs. Ughhh. */
if (opt.std_out)
msg_out = stderr;
else if (opt.debug)
- stderr = stdout;
+ stderr = stdout;
else
if (!(stderr = fopen("/dev/null", "rw")))
perr_exit("Couldn't open /dev/null");
@@ -413,7 +413,7 @@ static s64 is_critical_metadata(ntfs_wal
s64 inode = image->ni->mft_no;
if (inode <= LAST_METADATA_INODE) {
-
+
/* Don't save bad sectors (both $Bad and unnamed are ignored */
if (inode == FILE_BadClus && image->ctx->attr->type == AT_DATA)
return 0;
@@ -434,7 +434,7 @@ static s64 is_critical_metadata(ntfs_wal
return 0;
}
}
-
+
if (image->ctx->attr->type != AT_DATA)
return rl->length;
@@ -446,7 +446,7 @@ static int io_all(void *fd, void *buf, i
{
int i;
struct ntfs_device *dev = fd;
-
+
while (count > 0) {
if (do_write)
i = write(*(int *)fd, buf, count);
@@ -494,7 +494,7 @@ static void copy_cluster(int rescue, off
/* vol is NULL if opt.restore_image is set */
u32 csize = image_hdr.cluster_size;
void *fd = (void *)&fd_in;
-
+
if (!opt.restore_image) {
csize = vol->cluster_size;
fd = vol->dev;
@@ -516,7 +516,7 @@ static void copy_cluster(int rescue, off
if (write_all(&fd_out, &cmd, sizeof(cmd)) == -1)
perr_exit("write_all");
}
-
+
if (write_all(&fd_out, buff, csize) == -1) {
int err = errno;
perr_printf("Write failed");
@@ -532,9 +532,9 @@ static void copy_cluster(int rescue, off
static void lseek_to_cluster(s64 lcn)
{
off_t pos;
-
+
pos = (off_t)(lcn * vol->cluster_size);
-
+
if (vol->dev->d_ops->seek(vol->dev, pos, SEEK_SET) == (off_t)-1)
perr_exit("lseek input");
@@ -552,7 +552,7 @@ static void image_skip_clusters(s64 coun
buff[0] = 0;
memcpy(buff + 1, &count, sizeof(count));
-
+
if (write_all(&fd_out, buff, sizeof(buff)) == -1)
perr_exit("write_all");
}
@@ -561,15 +561,15 @@ static void image_skip_clusters(s64 coun
static void dump_clusters(ntfs_walk_clusters_ctx *image, runlist *rl)
{
s64 i, len; /* number of clusters to copy */
-
+
if (opt.std_out || !opt.metadata_only)
return;
-
+
if (!(len = is_critical_metadata(image, rl)))
return;
-
+
lseek_to_cluster(rl->lcn);
-
+
/* FIXME: this could give pretty suboptimal performance */
for (i = 0; i < len; i++)
copy_cluster(opt.rescue, rl->lcn + i);
@@ -597,19 +597,19 @@ static void clone_ntfs(u64 nr_clusters)
if (write_all(&fd_out, &image_hdr, sizeof(image_hdr)) == -1)
perr_exit("write_all");
}
-
+
for (last_cl = cl = 0; cl < (u64)vol->nr_clusters; cl++) {
-
+
if (ntfs_bit_get(lcn_bitmap.bm, cl)) {
progress_update(&progress, ++p_counter);
lseek_to_cluster(cl);
image_skip_clusters(cl - last_cl - 1);
-
+
copy_cluster(opt.rescue, cl);
last_cl = cl;
continue;
}
-
+
if (opt.std_out && !opt.save_image) {
progress_update(&progress, ++p_counter);
if (write_all(&fd_out, buf, csize) == -1)
@@ -624,7 +624,7 @@ static void write_empty_clusters(s32 csi
{
s64 i;
char buff[NTFS_MAX_CLUSTER_SIZE];
-
+
memset(buff, 0, csize);
for (i = 0; i < count; i++) {
@@ -689,14 +689,14 @@ do { \
static void wipe_timestamps(ntfs_walk_clusters_ctx *image)
{
ATTR_RECORD *a = image->ctx->attr;
-
+
if (image->ni->mft_no <= LAST_METADATA_INODE)
return;
- if (a->type == AT_FILE_NAME)
+ if (a->type == AT_FILE_NAME)
WIPE_TIMESTAMPS(FILE_NAME_ATTR, a);
- else if (a->type == AT_STANDARD_INFORMATION)
+ else if (a->type == AT_STANDARD_INFORMATION)
WIPE_TIMESTAMPS(STANDARD_INFORMATION, a);
}
@@ -709,27 +709,27 @@ static void wipe_resident_data(ntfs_walk
a = image->ctx->attr;
p = (u8*)a + le16_to_cpu(a->value_offset);
-
+
if (image->ni->mft_no <= LAST_METADATA_INODE)
return;
-
+
if (a->type != AT_DATA)
return;
-
+
for (i = 0; i < le32_to_cpu(a->value_length); i++) {
if (p[i]) {
p[i] = 0;
n++;
- }
- }
-
+ }
+ }
+
wiped_resident_data += n;
}
static void clone_logfile_parts(ntfs_walk_clusters_ctx *image, runlist *rl)
{
s64 offset = 0, lcn, vcn;
-
+
while (1) {
vcn = offset / image->ni->vol->cluster_size;
@@ -781,10 +781,10 @@ static void walk_runs(struct ntfs_walk_c
"%llx length %llx\n", ctx->ntfs_ino->mft_no,
(unsigned int)le32_to_cpu(a->type), lcn,
lcn_length);
-
+
if (!wipe)
dump_clusters(walk->image, rl + i);
-
+
for (j = 0; j < lcn_length; j++) {
u64 k = (u64)lcn + j;
if (ntfs_bit_get_and_set(lcn_bitmap.bm, k, 1))
@@ -799,7 +799,7 @@ static void walk_runs(struct ntfs_walk_c
walk->image->ni->mft_no == FILE_LogFile &&
walk->image->ctx->attr->type == AT_DATA)
clone_logfile_parts(walk->image, rl);
-
+
free(rl);
}
@@ -847,7 +847,7 @@ static void compare_bitmaps(struct bitma
}
for (i = 0; i < count; i++, pos++) {
- s64 cl; /* current cluster */
+ s64 cl; /* current cluster */
if (a->bm[pos] == bm[i])
continue;
@@ -858,7 +858,7 @@ static void compare_bitmaps(struct bitma
bit = ntfs_bit_get(a->bm, cl);
if (bit == ntfs_bit_get(bm, i * 8 + cl % 8))
continue;
-
+
if (opt.ignore_fs_check) {
lseek_to_cluster(cl);
copy_cluster(opt.rescue, cl);
@@ -892,13 +892,13 @@ static void compare_bitmaps(struct bitma
static int wipe_data(char *p, int pos, int len)
{
int wiped = 0;
-
+
for (p += pos; --len >= 0;) {
if (p[len]) {
p[len] = 0;
wiped++;
- }
- }
+ }
+ }
return wiped;
}
@@ -907,11 +907,11 @@ static void wipe_unused_mft_data(ntfs_in
{
int unused;
MFT_RECORD *m = ni->mrec;
-
+
/* FIXME: broken MFTMirr update was fixed in libntfs, check if OK now */
if (ni->mft_no <= LAST_METADATA_INODE)
return;
-
+
unused = le32_to_cpu(m->bytes_allocated) - le32_to_cpu(m->bytes_in_use);
wiped_unused_mft_data += wipe_data((char *)m,
le32_to_cpu(m->bytes_in_use), unused);
@@ -921,11 +921,11 @@ static void wipe_unused_mft(ntfs_inode *
{
int unused;
MFT_RECORD *m = ni->mrec;
-
+
/* FIXME: broken MFTMirr update was fixed in libntfs, check if OK now */
if (ni->mft_no <= LAST_METADATA_INODE)
return;
-
+
unused = le32_to_cpu(m->bytes_in_use) - sizeof(MFT_RECORD);
wiped_unused_mft += wipe_data((char *)m, sizeof(MFT_RECORD), unused);
}
@@ -945,7 +945,7 @@ static int walk_clusters(ntfs_volume *vo
progress_init(&progress, inode, last_mft_rec, 100);
for (; inode <= last_mft_rec; inode++) {
-
+
int err, deleted_inode;
MFT_REF mref = (MFT_REF)inode;
@@ -956,14 +956,14 @@ static int walk_clusters(ntfs_volume *vo
ni = (ntfs_inode*)calloc(1, sizeof(ntfs_inode));
if (!ni)
perr_exit("walk_clusters");
-
+
ni->vol = volume;
err = ntfs_file_record_read(volume, mref, &ni->mrec, NULL);
if (err == -1) {
free(ni);
continue;
- }
+ }
deleted_inode = !(ni->mrec->flags & MFT_RECORD_IN_USE);
@@ -975,16 +975,16 @@ static int walk_clusters(ntfs_volume *vo
wipe_unused_mft_data(ni);
if (ntfs_mft_record_write(volume, ni->mft_no, ni->mrec))
perr_exit("ntfs_mft_record_write");
- }
+ }
}
if (ni->mrec)
free(ni->mrec);
free(ni);
- if (deleted_inode)
+ if (deleted_inode)
continue;
-
+
if ((ni = ntfs_inode_open(volume, mref)) == NULL) {
/* FIXME: continue only if it make sense, e.g.
MFT record not in use based on $MFT bitmap */
@@ -1001,17 +1001,17 @@ static int walk_clusters(ntfs_volume *vo
walk->image->ni = ni;
walk_attributes(walk);
-out:
+out:
if (wipe) {
wipe_unused_mft_data(ni);
if (ntfs_mft_record_write(volume, ni->mft_no, ni->mrec))
perr_exit("ntfs_mft_record_write");
- }
+ }
if (ntfs_inode_close(ni))
perr_exit("ntfs_inode_close for inode %lld", inode);
}
-
+
return 0;
}
@@ -1088,7 +1088,7 @@ static void print_image_info(void)
static void check_if_mounted(const char *device, unsigned long new_mntflag)
{
unsigned long mntflag;
-
+
if (ntfs_check_if_mounted(device, &mntflag))
perr_exit("Failed to check '%s' mount state", device);
@@ -1110,7 +1110,7 @@ static void check_if_mounted(const char
static void mount_volume(unsigned long new_mntflag)
{
check_if_mounted(opt.volume, new_mntflag);
-
+
if (!(vol = ntfs_mount(opt.volume, new_mntflag))) {
int err = errno;
@@ -1129,7 +1129,7 @@ static void mount_volume(unsigned long n
if (opt.force-- <= 0)
err_exit("Volume is dirty. Run chkdsk and "
"please try again (or see -f option).\n");
-
+
if (NTFS_MAX_CLUSTER_SIZE < vol->cluster_size)
err_exit("Cluster size %u is too large!\n",
(unsigned int)vol->cluster_size);
@@ -1144,7 +1144,7 @@ static void mount_volume(unsigned long n
volume_size(vol, vol->nr_clusters));
}
-struct ntfs_walk_cluster backup_clusters = { NULL, NULL };
+struct ntfs_walk_cluster backup_clusters = { NULL, NULL };
static int device_offset_valid(int fd, s64 ofs)
{
@@ -1163,7 +1163,7 @@ static s64 device_size_get(int fd)
if (ioctl(fd, BLKGETSIZE64, &size) >= 0) {
Dprintf("BLKGETSIZE64 nr bytes = %llu (0x%llx)\n",
- (unsigned long long)size,
+ (unsigned long long)size,
(unsigned long long)size);
return (s64)size;
}
@@ -1250,7 +1250,7 @@ static void set_filesize(s64 filesize)
static s64 open_image(void)
{
if (strcmp(opt.volume, "-") == 0) {
- if ((fd_in = fileno(stdin)) == -1)
+ if ((fd_in = fileno(stdin)) == -1)
perr_exit("fileno for stdout failed");
} else {
if ((fd_in = open(opt.volume, O_RDONLY)) == -1)
@@ -1269,15 +1269,15 @@ static s64 open_image(void)
static s64 open_volume(void)
{
s64 device_size;
-
+
mount_volume(MS_RDONLY);
-
+
device_size = ntfs_device_size_get(vol->dev, 1);
if (device_size <= 0)
err_exit("Couldn't get device size (%lld)!\n", device_size);
-
+
print_volume_size("Current device size", device_size);
-
+
if (device_size < vol->nr_clusters * vol->cluster_size)
err_exit("Current NTFS volume size is bigger than the device "
"size (%lld)!\nCorrupt partition table or incorrect "
@@ -1304,7 +1304,7 @@ static void check_output_device(s64 inpu
if (dest_size < input_size)
err_exit("Output device is too small (%lld) to fit the "
"NTFS image (%lld).\n", dest_size, input_size);
-
+
check_if_mounted(opt.output, 0);
} else
set_filesize(input_size);
@@ -1331,7 +1331,7 @@ static int str2unicode(const char *aname
*ustr = AT_UNNAMED;
*len = 0;
}
-
+
return 0;
}
@@ -1348,10 +1348,10 @@ static ntfs_attr_search_ctx *lookup_data
if ((ctx = attr_get_search_ctx(ni, NULL)) == NULL)
return NULL;
-
+
if (str2unicode(aname, &ustr, &len) == -1)
goto error_out;
-
+
if (ntfs_attr_lookup(AT_DATA, ustr, len, 0, 0, NULL, 0, ctx)) {
perr_printf("ntfs_attr_lookup");
goto error_out;
@@ -1364,14 +1364,14 @@ error_out:
ntfs_attr_put_search_ctx(ctx);
return NULL;
}
-
+
static void ignore_bad_clusters(ntfs_walk_clusters_ctx *image)
{
ntfs_inode *ni;
ntfs_attr_search_ctx *ctx = NULL;
runlist *rl;
s64 nr_bad_clusters = 0;
-
+
if (!(ni = ntfs_inode_open(vol, FILE_BadClus)))
perr_exit("ntfs_open_inode");
@@ -1380,10 +1380,10 @@ static void ignore_bad_clusters(ntfs_wal
if (!(rl = ntfs_mapping_pairs_decompress(vol, ctx->attr, NULL)))
perr_exit("ntfs_mapping_pairs_decompress");
-
+
for (; rl->length; rl++) {
s64 lcn = rl->lcn;
-
+
if (lcn == LCN_HOLE || lcn < 0)
continue;
@@ -1413,7 +1413,7 @@ int main(int argc, char **argv)
msg_out = stderr;
parse_options(argc, argv);
-
+
utils_set_locale();
if (opt.restore_image) {
@@ -1426,19 +1426,19 @@ int main(int argc, char **argv)
ntfs_size += 512; /* add backup boot sector */
if (opt.std_out) {
- if ((fd_out = fileno(stdout)) == -1)
+ if ((fd_out = fileno(stdout)) == -1)
perr_exit("fileno for stdout failed");
} else {
/* device_size_get() might need to read() */
int flags = O_RDWR;
-
+
if (!opt.blkdev_out) {
flags |= O_CREAT | O_TRUNC;
if (!opt.overwrite)
flags |= O_EXCL;
}
- if ((fd_out = open(opt.output, flags, S_IRWXU)) == -1)
+ if ((fd_out = open(opt.output, flags, S_IRWXU)) == -1)
perr_exit("Opening file '%s' failed", opt.output);
if (!opt.save_image)
@@ -1451,20 +1451,20 @@ int main(int argc, char **argv)
fsync_clone(fd_out);
exit(0);
}
-
+
setup_lcn_bitmap();
memset(&image, 0, sizeof(image));
- backup_clusters.image = ℑ
+ backup_clusters.image = ℑ
walk_clusters(vol, &backup_clusters);
compare_bitmaps(&lcn_bitmap);
print_disk_usage(vol->cluster_size, vol->nr_clusters, image.inuse);
-
+
ignore_bad_clusters(&image);
if (opt.save_image)
initialise_image_hdr(device_size, image.inuse);
-
+
/* FIXME: save backup boot sector */
if (opt.std_out || !opt.metadata_only) {
@@ -1477,9 +1477,9 @@ int main(int argc, char **argv)
exit(0);
}
- wipe = 1;
+ wipe = 1;
opt.volume = opt.output;
- /* 'force' again mount for dirty volumes (e.g. after resize).
+ /* 'force' again mount for dirty volumes (e.g. after resize).
FIXME: use mount flags to avoid potential side-effects in future */
opt.force++;
mount_volume(0);
@@ -1487,26 +1487,26 @@ int main(int argc, char **argv)
free(lcn_bitmap.bm);
setup_lcn_bitmap();
memset(&image, 0, sizeof(image));
- backup_clusters.image = ℑ
+ backup_clusters.image = ℑ
walk_clusters(vol, &backup_clusters);
-
+
Printf("Num of MFT records = %10lld\n",
(long long)vol->mft_na->initialized_size >>
- vol->mft_record_size_bits);
- Printf("Num of used MFT records = %10u\n", nr_used_mft_records);
-
- Printf("Wiped unused MFT data = %10u\n", wiped_unused_mft_data);
- Printf("Wiped deleted MFT data = %10u\n", wiped_unused_mft);
+ vol->mft_record_size_bits);
+ Printf("Num of used MFT records = %10u\n", nr_used_mft_records);
+
+ Printf("Wiped unused MFT data = %10u\n", wiped_unused_mft_data);
+ Printf("Wiped deleted MFT data = %10u\n", wiped_unused_mft);
Printf("Wiped resident user data = %10u\n", wiped_resident_data);
Printf("Wiped timestamp data = %10u\n", wiped_timestamp_data);
-
+
wiped_total += wiped_unused_mft_data;
wiped_total += wiped_unused_mft;
wiped_total += wiped_resident_data;
wiped_total += wiped_timestamp_data;
Printf("Wiped totally = %10u\n", wiped_total);
-
+
fsync_clone(fd_out);
exit(0);
}
Index: ntfscluster.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscluster.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -p -r1.24 -r1.25
--- ntfscluster.c 12 Jun 2005 18:12:56 -0000 1.24
+++ ntfscluster.c 19 Jun 2005 21:09:41 -0000 1.25
@@ -357,7 +357,7 @@ static int info (ntfs_volume *vol)
*/
static int dump_file (ntfs_volume *vol, ntfs_inode *ino)
{
- u8 buffer[1024];
+ char buffer[1024];
ntfs_attr_search_ctx *ctx;
ATTR_RECORD *rec;
int i;
Index: ntfscluster.h
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscluster.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- ntfscluster.h 20 Aug 2004 12:01:17 -0000 1.9
+++ ntfscluster.h 19 Jun 2005 21:09:41 -0000 1.10
@@ -46,8 +46,8 @@ struct options {
int force; /* Override common sense */
char *filename; /* File to examine */
u64 inode; /* Inode to examine */
- u64 range_begin; /* Look for objects in this range */
- u64 range_end;
+ s64 range_begin; /* Look for objects in this range */
+ s64 range_end;
};
struct match {
Index: ntfscp.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfscp.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- ntfscp.c 12 Jun 2005 18:12:56 -0000 1.19
+++ ntfscp.c 19 Jun 2005 21:09:41 -0000 1.20
@@ -115,7 +115,7 @@ static int parse_options (int argc, char
{ "inode", no_argument, NULL, 'i' },
{ "force", no_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
- { "attr-name", required_argument, NULL, 'N' },
+ { "attr-name", required_argument, NULL, 'N' },
{ "no-action", no_argument, NULL, 'n' },
{ "quiet", no_argument, NULL, 'q' },
{ "version", no_argument, NULL, 'V' },
@@ -129,7 +129,7 @@ static int parse_options (int argc, char
int ver = 0;
int help = 0;
s64 attr;
-
+
opts.device = NULL;
opts.src_file = NULL;
opts.dest_file = NULL;
@@ -182,7 +182,7 @@ static int parse_options (int argc, char
Eprintf("You can specify only one attribute "
"name.\n");
err++;
- } else
+ } else
opts.attr_name = argv[optind - 1];
break;
case 'n':
@@ -286,7 +286,7 @@ int main (int argc, char *argv[])
vol = utils_mount_volume(opts.device, flags, opts.force);
if (!vol) {
- perror("ERROR: couldn't mount volume");
+ perror("ERROR: couldn't mount volume");
return 1;
}
@@ -322,7 +322,7 @@ int main (int argc, char *argv[])
} else
out = ntfs_pathname_to_inode(vol, NULL, opts.dest_file);
if (!out) {
- perror("ERROR: Couldn't open destination file");
+ perror("ERROR: Couldn't open destination file");
goto close_src;
}
if ((le16_to_cpu(out->mrec->flags) & MFT_RECORD_IS_DIRECTORY) &&
@@ -362,7 +362,7 @@ int main (int argc, char *argv[])
}
}
- if (opts.attr_name) {
+ if (opts.attr_name) {
attr_name_len = ntfs_mbstoucs(opts.attr_name, &attr_name, 0);
if (attr_name_len == -1) {
perror("ERROR: Failed to parse attribute name");
Index: ntfsdump_logfile.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsdump_logfile.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- ntfsdump_logfile.c 13 Jan 2005 15:55:15 -0000 1.25
+++ ntfsdump_logfile.c 19 Jun 2005 21:09:41 -0000 1.26
@@ -505,7 +505,7 @@ skip_rstr_pass:
++pass;
goto rstr_pass_loc;
}
-
+
return rstr;
}
@@ -714,7 +714,7 @@ int main(int argc, char **argv)
puts("$LogFile is not initialized.");
return 0;
}
-
+
/*
* First, verify the restart page header for consistency.
*/
@@ -739,7 +739,7 @@ int main(int argc, char **argv)
*/
rcrd = (RECORD_PAGE_HEADER*)dump_restart_areas(rstr, buf, page_size);
printf("\n\nFinished with restart pages. "
- "Beginning with log pages.\n");
+ "Beginning with log pages.\n");
/*
* Dump the log areas.
Index: ntfsfix.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsfix.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- ntfsfix.c 1 Mar 2005 23:11:20 -0000 1.13
+++ ntfsfix.c 19 Jun 2005 21:09:41 -0000 1.14
@@ -91,7 +91,7 @@ static int usage(void)
" -h, --help Display this help\n"
" -V, --version Display version information\n"
"\n"
- "For example: %s /dev/hda6\n\n",
+ "For example: %s /dev/hda6\n\n",
EXEC_NAME, VERSION, EXEC_NAME, EXEC_NAME);
printf("%s%s", ntfs_bugs, ntfs_home);
exit(1);
@@ -139,7 +139,7 @@ static void parse_options(int argc, char
usage();
}
}
-
+
if (opt.volume == NULL) {
printf("ERROR: You must specify a device.\n");
usage();
Index: ntfsinfo.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsinfo.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -p -r1.64 -r1.65
--- ntfsinfo.c 12 Jun 2005 18:12:56 -0000 1.64
+++ ntfsinfo.c 19 Jun 2005 21:09:41 -0000 1.65
@@ -300,7 +300,7 @@ static char *ntfs_attr_get_name(ATTR_REC
ntfschar *ucs_attr_name;
char *mbs_attr_name = NULL;
int mbs_attr_name_size;
-
+
/* calculate name position */
ucs_attr_name = (ntfschar *)((char *)attr + le16_to_cpu(attr->name_offset));
/* convert unicode to printable format */
@@ -330,7 +330,7 @@ static void ntfs_dump_volume(ntfs_volume
printf("\tCluster Size: %u\n", (unsigned int)vol->cluster_size);
printf("\tVolume Size in Clusters: %lld\n",
(long long)vol->nr_clusters);
-
+
printf("MFT Information \n");
printf("\tMFT Record Size: %u\n", (unsigned int)vol->mft_record_size);
printf("\tMFT Zone Multiplier: %u\n", vol->mft_zone_multiplier);
@@ -349,7 +349,7 @@ static void ntfs_dump_volume(ntfs_volume
(long long)vol->mftmirr_lcn);
printf("\tSize of Attribute Definition Table: %d\n",
(int)vol->attrdef_len);
-
+
printf("FILE_Bitmap Information \n");
printf("\tFILE_Bitmap MFT Record Number: %llu\n",
(unsigned long long)vol->lcnbmp_ni->mft_no);
@@ -361,7 +361,7 @@ static void ntfs_dump_volume(ntfs_volume
(int)vol->lcnbmp_ni->nr_extents);
/* FIXME: need to add code for the union if nr_extens != 0, but
i dont know if it will ever != 0 with FILE_Bitmap */
-
+
printf("FILE_Bitmap Data Attribute Information\n");
printf("\tDecompressed Runlist: not done yet\n");
printf("\tBase Inode: %llu\n",
@@ -385,7 +385,7 @@ static void ntfs_dump_volume(ntfs_volume
vol->lcnbmp_na->compression_block_size_bits);
printf("\tCompression Block Clusters: %u\n",
vol->lcnbmp_na->compression_block_clusters);
-
+
//TODO: Still need to add a few more attributes
}
@@ -501,7 +501,7 @@ static void ntfs_dump_attr_standard_info
le16_to_cpu(attr->value_offset));
printf("Dumping attribute $STANDARD_INFORMATION (0x10)\n");
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
/* let's start with mandatory? fields */
@@ -509,18 +509,18 @@ static void ntfs_dump_attr_standard_info
/* time conversion stuff */
if (!opts.notime) {
char *ntfs_time_str = NULL;
-
+
ntfs_time_str = ntfsinfo_time_to_str(standard_attr->creation_time);
printf("\tFile Creation Time:\t %s",ntfs_time_str);
-
+
ntfs_time_str = ntfsinfo_time_to_str(
standard_attr->last_data_change_time);
printf("\tFile Altered Time:\t %s",ntfs_time_str);
-
+
ntfs_time_str = ntfsinfo_time_to_str(
standard_attr->last_mft_change_time);
printf("\tMFT Changed Time:\t %s",ntfs_time_str);
-
+
ntfs_time_str = ntfsinfo_time_to_str(standard_attr->last_access_time);
printf("\tLast Accessed Time:\t %s",ntfs_time_str);
}
@@ -532,7 +532,7 @@ static void ntfs_dump_attr_standard_info
(unsigned int)le32_to_cpu(standard_attr->version_number));
printf("\tClass ID:\t\t %u \n",
(unsigned int)le32_to_cpu(standard_attr->class_id));
-
+
value_length = le32_to_cpu(attr->value_length);
if (value_length == 48) {
/* printf("\t$STANDARD_INFORMATION fields owner_id, security_id, quota \n"
@@ -559,7 +559,7 @@ static void ntfs_dump_attr_list(ATTR_REC
s64 l;
printf("Dumping attribute AT_ATTRIBUTE_LIST (0x20)\n");
-
+
/* Dump list's name */
if (attr->name_length) {
char *stream_name = NULL;
@@ -576,7 +576,7 @@ static void ntfs_dump_attr_list(ATTR_REC
} else {
printf("\tList name:\t\t unnamed\n");
}
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
/* Dump list's size */
@@ -592,10 +592,10 @@ static void ntfs_dump_attr_list(ATTR_REC
printf("\tList's size:\t\t %u bytes\n",
(unsigned int)le32_to_cpu(attr->value_length));
}
-
+
if (!opts.verbose)
return;
-
+
l = ntfs_get_attribute_value_length(attr);
if (!l) {
perror("ntfs_get_attribute_value_length failed");
@@ -659,7 +659,7 @@ static void ntfs_dump_attr_file_name(ATT
le16_to_cpu(attr->value_offset));
printf("Dumping attribute $FILE_NAME (0x30)\n");
-
+
/* let's start with the obvious - file name */
if (file_name_attr->file_name_length>0) {
@@ -688,7 +688,7 @@ static void ntfs_dump_attr_file_name(ATT
ntfs_dump_namespace(file_name_attr->file_name_type);
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
-
+
/* other basic stuff about the file */
printf("\tAllocated File Size:\t %lld\n",
(long long)sle64_to_cpu(file_name_attr->allocated_size));
@@ -701,7 +701,7 @@ static void ntfs_dump_attr_file_name(ATT
/* time stuff stuff */
if (!opts.notime) {
char *ntfs_time_str;
-
+
ntfs_time_str = ntfsinfo_time_to_str(file_name_attr->creation_time);
printf("\tFile Creation Time:\t %s",ntfs_time_str);
@@ -731,7 +731,7 @@ static void ntfs_dump_attr_object_id(ATT
le16_to_cpu(attr->value_offset));
printf("Dumping attribute $OBJECT_ID (0x40)\n");
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
if (vol->major_ver >= 3.0) {
@@ -786,7 +786,7 @@ static void ntfs_dump_acl(const char *pr
unsigned int i;
u16 ace_count;
ACCESS_ALLOWED_ACE *ace;
-
+
printf("%sRevision\t %u\n",prefix,acl->revision);
/* don't recalc le16_to_cpu every iteration (minor speedup on big-endians */
@@ -799,7 +799,7 @@ static void ntfs_dump_acl(const char *pr
for (i=0;i<acl->ace_count;i++) {
const char *ace_type;
char *sid;
-
+
/* set ace_type. */
switch (ace->type) {
case ACCESS_ALLOWED_ACE_TYPE:
@@ -815,7 +815,7 @@ static void ntfs_dump_acl(const char *pr
ace_type = "unknown";
break;
}
-
+
printf("%sACE:\t\t type:%s flags:0x%x access:0x%x\n",prefix,ace_type,
(unsigned int)le16_to_cpu(ace->flags),(unsigned int)le32_to_cpu(ace->mask));
/* get a SID string */
@@ -823,7 +823,7 @@ static void ntfs_dump_acl(const char *pr
printf("%s\t\t SID: %s\n",prefix,sid);
if (sid)
free(sid);
-
+
/* proceed to next ACE */
ace = (ACCESS_ALLOWED_ACE *)(((char *)ace) + le32_to_cpu(ace->size));
}
@@ -838,9 +838,9 @@ static void ntfs_dump_attr_security_desc
{
SECURITY_DESCRIPTOR_ATTR *sec_desc_attr;
char *sid;
-
+
printf("Dumping attribute $SECURITY_DESCRIPTOR (0x50)\n");
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
if (attr->non_resident) {
@@ -895,7 +895,7 @@ static void ntfs_dump_attr_security_desc
} else {
printf("missing\n");
}
-
+
printf("\tDiscretionary ACL:\t\t ");
if (sec_desc_attr->control & SE_DACL_PRESENT) {
if (sec_desc_attr->control & SE_SACL_DEFAULTED) {
@@ -907,7 +907,7 @@ static void ntfs_dump_attr_security_desc
} else {
printf("missing\n");
}
-
+
if (attr->non_resident) free(sec_desc_attr);
}
@@ -921,7 +921,7 @@ static void ntfs_dump_attr_volume_name(A
ntfschar *ucs_vol_name = NULL;
printf("Dumping attribute $VOLUME_NAME (0x60)\n");
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
if (attr->value_length>0) {
@@ -958,12 +958,12 @@ static void ntfs_dump_attr_volume_name(A
static void ntfs_dump_attr_volume_information(ATTR_RECORD *attr)
{
VOLUME_INFORMATION *vol_information = NULL;
-
+
vol_information = (VOLUME_INFORMATION*)((char *)attr+
le16_to_cpu(attr->value_offset));
printf("Dumping attribute $VOLUME_INFORMATION (0x70)\n");
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
printf("\tVolume Version:\t %d.%d\n", vol_information->major_ver,
@@ -1018,12 +1018,12 @@ static void ntfs_dump_attr_data(ATTR_REC
} else {
printf("\tStream name:\t\t unnamed\n");
}
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
/* TODO: parse the flags */
printf("\tFlags:\t\t\t 0x%04hx\n",le16_to_cpu(attr->flags));
-
+
/* fork by residence */
if (attr->non_resident) {
/* VCN lowest_vcn; Lowest valid virtual cluster number
@@ -1079,7 +1079,7 @@ static int ntfs_dump_index_entries(INDEX
{
int numb_entries = 1;
char *name = NULL;
-
+
Vprintf("\tDumping index entries:");
while(1) {
if (!opts.verbose) {
@@ -1099,7 +1099,7 @@ static int ntfs_dump_index_entries(INDEX
if (entry->flags & INDEX_ENTRY_END)
break;
-
+
switch(type) {
case(AT_FILE_NAME):
Vprintf("\t\tFILE record number:\t %llu\n",
@@ -1154,16 +1154,16 @@ static void ntfs_dump_attr_index_root(AT
unsigned int type;
INDEX_ROOT *index_root = NULL;
INDEX_ENTRY *entry;
-
+
index_root = (INDEX_ROOT*)((u8*)attr + le16_to_cpu(attr->value_offset));
-
+
printf("Dumping attribute $INDEX_ROOT (0x90)\n");
-
+
/* Dump index name */
if (attr->name_length) {
char *index_name = NULL;
index_name = ntfs_attr_get_name(attr);
-
+
if (index_name) {
printf("\tIndex name:\t\t '%s'\n",index_name);
free(index_name);
@@ -1175,7 +1175,7 @@ static void ntfs_dump_attr_index_root(AT
} else {
printf("\tIndex name:\t\t unnamed\n");
}
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
/* attr_type dumping */
@@ -1206,7 +1206,7 @@ static void ntfs_dump_attr_index_root(AT
(unsigned int)le32_to_cpu(index_root->index_block_size));
printf("\tClusters Per Block:\t %u\n",
index_root->clusters_per_index_block);
-
+
/* index header starts here */
printf("\tAllocated Size:\t\t %u\n",
(unsigned int)le32_to_cpu(index_root->index.allocated_size));
@@ -1233,14 +1233,14 @@ static int get_type_and_size_of_indx(ntf
ntfs_attr_search_ctx *ctx;
ntfschar *name = 0;
INDEX_ROOT *root;
-
+
if (attr->name_length) {
name = malloc(attr->name_length * sizeof(ntfschar));
if (!name) {
perror("malloc failed");
return -1;
}
- memcpy(name, (u8 *)attr + attr->name_offset,
+ memcpy(name, (u8 *)attr + attr->name_offset,
attr->name_length * sizeof(ntfschar));
}
ctx = ntfs_attr_get_search_ctx(ni, 0);
@@ -1256,7 +1256,7 @@ static int get_type_and_size_of_indx(ntf
free(name);
return -1;
}
-
+
root = (INDEX_ROOT*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
*size = le32_to_cpu(root->index_block_size);
@@ -1305,7 +1305,7 @@ static void ntfs_dump_index_allocation(A
}
ntfs_attr_close(na);
byte = bitmap;
-
+
na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, name, attr->name_length);
if (!na) {
perror("ntfs_attr_open failed");
@@ -1327,7 +1327,7 @@ static void ntfs_dump_index_allocation(A
}
ntfs_attr_close(na);
tmp_alloc = allocation;
-
+
bit = 0;
while((u8 *)tmp_alloc < (u8 *)allocation + na->data_size) {
if (*byte & (1 << bit)) {
@@ -1369,7 +1369,7 @@ static void ntfs_dump_attr_index_allocat
if (attr->name_length) {
char *index_name = NULL;
index_name = ntfs_attr_get_name(attr);
-
+
if (index_name) {
printf("\tIndex name:\t\t '%s'\n",index_name);
free(index_name);
@@ -1398,7 +1398,7 @@ static void ntfs_dump_attr_index_allocat
Eprintf("Invalid $INDEX_ALLOCTION attribute. Should be be"
" non-resident\n");
}
-
+
ntfs_dump_index_allocation(attr, ni);
}
@@ -1415,7 +1415,7 @@ static void ntfs_dump_attr_bitmap(ATTR_R
if (attr->name_length) {
char *bitmap_name = NULL;
bitmap_name = ntfs_attr_get_name(attr);
-
+
if (bitmap_name) {
printf("\tBitmap name:\t\t '%s'\n",bitmap_name);
free(bitmap_name);
@@ -1427,7 +1427,7 @@ static void ntfs_dump_attr_bitmap(ATTR_R
} else {
printf("\tBitmap name:\t\t unnamed\n");
}
-
+
printf("\tAttribute instance:\t %u\n", le16_to_cpu(attr->instance));
/* dump bitmap size */
@@ -1518,12 +1518,12 @@ static void ntfs_hex_dump(void *buf,unsi
unsigned char c = *((char *)buf + j);
printf("%02hhX ",c);
}
-
+
/* realign */
for (;j<i+16;j++) {
printf(" ");
}
-
+
/* char content */
for (j=i;(j<length) && (j<i+16);j++) {
unsigned char c = *((char *)buf + j);
@@ -1533,7 +1533,7 @@ static void ntfs_hex_dump(void *buf,unsi
}
printf("%c",c);
}
-
+
/* end line */
printf("\n");
i=j;
@@ -1617,9 +1617,9 @@ static void ntfs_dump_attr_unknown(ATTR_
static void ntfs_dump_inode_general_info(ntfs_inode *inode)
{
u16 inode_flags = inode->mrec->flags;
-
+
printf("Dumping Inode #%llu\n",(long long)inode->mft_no);
-
+
printf("Update Sequence Array Count:\t %hu\n",
le16_to_cpu(inode->mrec->usa_count));
printf("$LogFile seqNum for this Inode:\t 0x%llx\n",
@@ -1649,7 +1649,7 @@ static void ntfs_dump_inode_general_info
(unsigned int)le32_to_cpu(inode->mrec->bytes_in_use));
printf("Size - Allocated:\t\t %u bytes\n",
(unsigned int)le32_to_cpu(inode->mrec->bytes_allocated));
-
+
if (inode->mrec->base_mft_record) {
printf("base MFT record:\t\t %llu\n",
MREF_LE(inode->mrec->base_mft_record));
@@ -1729,7 +1729,7 @@ static void ntfs_dump_file_attributes(nt
ntfs_dump_attr_unknown(ctx->attr);
}
}
-
+
/* if we exited the loop before we're done - notify the user */
if (errno != ENOENT) {
fprintf(stderr, "ntfsinfo error: stopped before finished "
@@ -1741,7 +1741,7 @@ static void ntfs_dump_file_attributes(nt
/* close all data-structures we used */
ntfs_attr_put_search_ctx(ctx);
ntfs_inode_close(inode);
-
+
/* happily exit */
}
Index: ntfsmove.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsmove.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -p -r1.11 -r1.12
--- ntfsmove.c 12 Jun 2005 18:12:56 -0000 1.11
+++ ntfsmove.c 19 Jun 2005 21:09:41 -0000 1.12
@@ -365,7 +365,8 @@ static void dump_runs (u8 *buffer, int l
/**
* find_unused
*/
-static runlist * find_unused (ntfs_volume *vol, s64 size, u64 loc, int flags)
+static runlist * find_unused (ntfs_volume *vol, s64 size, u64 loc
+ __attribute__((unused)), int flags __attribute__((unused)))
{
const int bufsize = 8192;
u8 *buffer;
@@ -703,7 +704,7 @@ static s64 move_datarun (ntfs_volume *vo
Eprintf ("!move_runlist\n");
return -1;
}
-
+
// wipe orig runs
memset (((u8*)rec) +rec->mapping_pairs_offset, 0, need_to - rec->mapping_pairs_offset);
Index: ntfsresize.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/ntfsprogs/ntfsresize.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -p -r1.65 -r1.66
--- ntfsresize.c 12 Jun 2005 13:44:34 -0000 1.65
+++ ntfsresize.c 19 Jun 2005 21:09:41 -0000 1.66
@@ -116,7 +116,7 @@ struct progress_bar {
struct llcn_t {
s64 lcn; /* last used LCN for a "special" file/attr type */
s64 inode; /* inode using it */
-};
+};
#define NTFSCK_PROGBAR 0x0001
@@ -508,7 +508,7 @@ static int parse_options(int argc, char
static void print_advise(ntfs_volume *vol, s64 supp_lcn)
{
s64 old_b, new_b, freed_b, old_mb, new_mb, freed_mb;
-
+
old_b = vol->nr_clusters * vol->cluster_size;
old_mb = rounded_up_division(old_b, NTFS_MBYTE);
@@ -539,7 +539,7 @@ static void print_advise(ntfs_volume *vo
else
printf("%lld bytes", (long long)freed_b);
printf(").\n");
-
+
printf("Please make a test run using both the -n and -s options "
"before real resizing!\n");
}
@@ -554,10 +554,10 @@ static void rl_set(runlist *rl, VCN vcn,
static int rl_items(runlist *rl)
{
int i = 0;
-
+
while (rl[i++].length)
;
-
+
return i;
}
@@ -599,7 +599,7 @@ static int str2unicode(const char *aname
*ustr = AT_UNNAMED;
*len = 0;
}
-
+
return 0;
}
@@ -608,7 +608,7 @@ static int has_bad_sectors(ntfs_resize_t
int len, ret = 0;
ntfschar *ustr = NULL;
ATTR_RECORD *a = resize->ctx->attr;
-
+
if (resize->ni->mft_no != FILE_BadClus)
return 0;
@@ -617,13 +617,13 @@ static int has_bad_sectors(ntfs_resize_t
if (ustr && ntfs_names_are_equal(ustr, len,
(ntfschar*)((u8*)a + le16_to_cpu(a->name_offset)),
- a->name_length, 0, NULL, 0))
+ a->name_length, 0, NULL, 0))
ret = 1;
-
+
if (ustr != AT_UNNAMED)
free(ustr);
- return ret;
+ return ret;
}
static void collect_resize_constraints(ntfs_resize_t *resize, runlist *rl)
@@ -637,35 +637,35 @@ static void collect_resize_constraints(n
inode = resize->ni->mft_no;
flags = resize->ctx->attr->flags;
-
+
if ((ret = has_bad_sectors(resize)) != 0) {
if (ret == -1)
perr_exit("Couldn't convert string to Unicode");
err_exit("Your disk has bad sectors (manufacturing faults or "
"dying disk).\nThis situation isn't supported yet.\n");
- }
+ }
if (NInoAttrList(resize->ni)) {
llcn = &resize->last_multi_mft;
if (inode != FILE_MFT && inode != FILE_MFTMirr)
supported = 1;
-
+
} else if (flags & ATTR_IS_SPARSE) {
llcn = &resize->last_sparse;
supported = 1;
-
+
} else if (flags & ATTR_IS_COMPRESSED) {
llcn = &resize->last_compressed;
supported = 1;
-
+
} else if (inode == FILE_MFT) {
llcn = &resize->last_mft;
/* First run of $MFT DATA attribute isn't supported yet */
if (resize->ctx->attr->type != AT_DATA || rl->vcn)
supported = 1;
-
+
} else if (inode == FILE_MFTMirr) {
llcn = &resize->last_mftmir;
supported = 1;
@@ -678,11 +678,11 @@ static void collect_resize_constraints(n
llcn = &resize->last_lcn;
supported = 1;
}
-
+
if (llcn->lcn < last_lcn) {
llcn->lcn = last_lcn;
llcn->inode = inode;
- }
+ }
if (supported)
return;
@@ -696,12 +696,12 @@ static void collect_relocation_info(ntfs
{
s64 lcn, lcn_length, start, len, inode;
s64 new_vol_size; /* (last LCN on the volume) + 1 */
-
+
lcn = rl->lcn;
lcn_length = rl->length;
inode = resize->ni->mft_no;
new_vol_size = resize->new_volume_size;
-
+
if (lcn + lcn_length <= new_vol_size)
return;
@@ -727,7 +727,7 @@ static void collect_relocation_info(ntfs
if (!opt.info || !resize->new_volume_size)
return;
-
+
printf("Relocation needed for inode %8lld attr 0x%x LCN 0x%08llx "
"length %6lld\n", (long long)inode,
(unsigned int)le32_to_cpu(resize->ctx->attr->type),
@@ -764,7 +764,7 @@ static void build_lcn_usage_bitmap(ntfs_
printf(corrupt_volume_msg);
exit(1);
}
-
+
for (i = 0; rl[i].length; i++) {
s64 lcn = rl[i].lcn;
@@ -788,7 +788,7 @@ static void build_lcn_usage_bitmap(ntfs_
if (k >= (u64)vol->nr_clusters) {
long long outsiders = lcn_length - j;
-
+
fsck->outsider += outsiders;
if (++fsck->show_outsider <= 10 || opt.verbose)
@@ -802,7 +802,7 @@ static void build_lcn_usage_bitmap(ntfs_
if (ntfs_bit_get_and_set(lcn_bitmap->bm, k, 1)) {
if (++fsck->multi_ref <= 10 || opt.verbose)
printf("Cluster %lld is referenced "
- "multiply times!\n",
+ "multiply times!\n",
(long long)k);
continue;
}
@@ -879,7 +879,7 @@ static void compare_bitmaps(ntfs_volume
pos + count, a->size);
for (i = 0; i < count; i++, pos++) {
- s64 cl; /* current cluster */
+ s64 cl; /* current cluster */
if (a->bm[pos] == bm[i])
continue;
@@ -891,14 +891,14 @@ static void compare_bitmaps(ntfs_volume
if (bit == ntfs_bit_get(bm, i * 8 + cl % 8))
continue;
- if (!mismatch && !bit && !backup_boot &&
+ if (!mismatch && !bit && !backup_boot &&
cl == vol->nr_clusters / 2) {
/* FIXME: call also boot sector check */
backup_boot = 1;
printf("Found backup boot sector in "
"the middle of the volume.\n");
- continue;
- }
+ continue;
+ }
if (++mismatch > 10)
continue;
@@ -942,12 +942,12 @@ static void progress_init(struct progres
static void progress_update(struct progress_bar *p, u64 current)
{
float percent;
-
+
if (!(p->flags & NTFS_PROGBAR))
return;
if (p->flags & NTFS_PROGBAR_SUPPRESS)
return;
-
+
/* WARNING: don't modify the texts, external tools grep for them */
percent = p->unit * current;
if (current != p->stop) {
@@ -1028,7 +1028,7 @@ static void build_resize_constrains(ntfs
if (!resize->ctx->attr->non_resident)
return;
- if (!(rl = ntfs_mapping_pairs_decompress(resize->vol,
+ if (!(rl = ntfs_mapping_pairs_decompress(resize->vol,
resize->ctx->attr, NULL)))
perr_exit("ntfs_decompress_mapping_pairs");
@@ -1036,7 +1036,7 @@ static void build_resize_constrains(ntfs
/* CHECKME: LCN_RL_NOT_MAPPED check isn't needed */
if (rl[i].lcn == LCN_HOLE || rl[i].lcn == LCN_RL_NOT_MAPPED)
continue;
-
+
collect_resize_constraints(resize, rl + i);
if (resize->shrink)
collect_relocation_info(resize, rl + i);
@@ -1117,19 +1117,19 @@ static void rl_fixup(runlist **rl)
}
}
-static void replace_attribute_runlist(ntfs_volume *vol,
- ntfs_attr_search_ctx *ctx,
+static void replace_attribute_runlist(ntfs_volume *vol,
+ ntfs_attr_search_ctx *ctx,
runlist *rl)
{
int mp_size, l;
void *mp;
ATTR_RECORD *a = ctx->attr;
-
+
rl_fixup(&rl);
if ((mp_size = ntfs_get_size_for_mapping_pairs(vol, rl, 0)) == -1)
perr_exit("ntfs_get_size_for_mapping_pairs");
-
+
if (a->name_length) {
u16 name_offs = le16_to_cpu(a->name_offset);
u16 mp_offs = le16_to_cpu(a->mapping_pairs_offset);
@@ -1147,17 +1147,17 @@ static void replace_attribute_runlist(nt
char *next_attr;
Vprintf("Enlarging attribute header ...\n");
-
+
mp_size = (mp_size + 7) & ~7;
-
+
Vprintf("Old mp size : %d\n", l);
Vprintf("New mp size : %d\n", mp_size);
Vprintf("Bytes in use : %u\n", (unsigned int)
le32_to_cpu(ctx->mrec->bytes_in_use));
-
+
next_attr = (char *)a + le16_to_cpu(a->length);
l = mp_size - l;
-
+
Vprintf("Bytes in use new : %u\n", l + (unsigned int)
le32_to_cpu(ctx->mrec->bytes_in_use));
Vprintf("Bytes allocated : %u\n", (unsigned int)
@@ -1168,7 +1168,7 @@ static void replace_attribute_runlist(nt
Vprintf("increase : %d\n", l);
Vprintf("shift : %lld\n", (long long)remains_size);
-
+
if (le32_to_cpu(ctx->mrec->bytes_in_use) + l >
le32_to_cpu(ctx->mrec->bytes_allocated))
err_exit("Extended record needed (%u > %u), not yet "
@@ -1221,9 +1221,9 @@ static void set_max_free_zone(s64 length
}
}
-static int find_free_cluster(struct bitmap *bm,
+static int find_free_cluster(struct bitmap *bm,
runlist_element *rle,
- s64 nr_vol_clusters,
+ s64 nr_vol_clusters,
int hint)
{
/* FIXME: get rid of this 'static' variable */
@@ -1278,9 +1278,9 @@ static int find_free_cluster(struct bitm
return 0;
}
-static runlist *alloc_cluster(struct bitmap *bm,
- s64 items,
- s64 nr_vol_clusters,
+static runlist *alloc_cluster(struct bitmap *bm,
+ s64 items,
+ s64 nr_vol_clusters,
int hint)
{
runlist_element rle;
@@ -1300,7 +1300,7 @@ static runlist *alloc_cluster(struct bit
rle.length = items;
if (find_free_cluster(bm, &rle, nr_vol_clusters, hint) == -1)
return NULL;
-
+
rl_size = (runs + 2) * sizeof(runlist_element);
if (!(rl = (runlist *)realloc(rl, rl_size)))
return NULL;
@@ -1313,7 +1313,7 @@ static runlist *alloc_cluster(struct bit
}
rl_set(rl + runs, vcn, -1LL, 0LL);
-
+
if (runs > 1) {
Vprintf("Multi-run allocation: \n");
dump_runlist(rl);
@@ -1324,9 +1324,9 @@ static runlist *alloc_cluster(struct bit
static int read_all(struct ntfs_device *dev, void *buf, int count)
{
int i;
-
+
while (count > 0) {
-
+
i = count;
if (!NDevReadOnly(dev))
i = dev->d_ops->read(dev, buf, count);
@@ -1346,7 +1346,7 @@ static int read_all(struct ntfs_device *
static int write_all(struct ntfs_device *dev, void *buf, int count)
{
int i;
-
+
while (count > 0) {
i = count;
@@ -1384,9 +1384,9 @@ static int write_mft_record(ntfs_volume
static void lseek_to_cluster(ntfs_volume *vol, s64 lcn)
{
off_t pos;
-
+
pos = (off_t)(lcn * vol->cluster_size);
-
+
if (vol->dev->d_ops->seek(vol->dev, pos, SEEK_SET) == (off_t)-1)
perr_exit("seek failed to position %lld", lcn);
}
@@ -1400,15 +1400,15 @@ static void copy_clusters(ntfs_resize_t
for (i = 0; i < len; i++) {
lseek_to_cluster(vol, src + i);
-
+
if (read_all(vol->dev, buff, vol->cluster_size) == -1)
perr_exit("read_all");
-
+
lseek_to_cluster(vol, dest + i);
-
+
if (write_all(vol->dev, buff, vol->cluster_size) == -1)
perr_exit("write_all");
-
+
resize->relocations++;
progress_update(&resize->progress, resize->relocations);
}
@@ -1429,13 +1429,13 @@ static void relocate_clusters(ntfs_resiz
for (; dest_rl->length; src_lcn += dest_rl->length, dest_rl++)
copy_clusters(r, dest_rl->lcn, src_lcn, dest_rl->length);
}
-
+
static void rl_split_run(runlist **rl, int run, s64 pos)
{
runlist *rl_new, *rle_new, *rle;
int items, new_size, size_head, size_tail;
s64 len_head, len_tail;
-
+
items = rl_items(*rl);
new_size = (items + 1) * sizeof(runlist_element);
size_head = run * sizeof(runlist_element);
@@ -1452,10 +1452,10 @@ static void rl_split_run(runlist **rl, i
len_tail = rle->length - (pos - rle->lcn);
len_head = rle->length - len_tail;
-
+
rl_set(rle_new, rle->vcn, rle->lcn, len_head);
rl_set(rle_new + 1, rle->vcn + len_head, rle->lcn + len_head, len_tail);
-
+
Vprintf("Splitting run at cluster %lld:\n", (long long)pos);
dump_run(rle); dump_run(rle_new); dump_run(rle_new + 1);
@@ -1503,7 +1503,7 @@ static void relocate_run(ntfs_resize_t *
lcn = (*rl + run)->lcn;
lcn_length = (*rl + run)->length;
new_vol_size = resize->new_volume_size;
-
+
if (lcn + lcn_length <= new_vol_size)
return;
@@ -1513,11 +1513,11 @@ static void relocate_run(ntfs_resize_t *
}
hint = (resize->mref == FILE_MFTMirr) ? 1 : 0;
- if (!(relocate_rl = alloc_cluster(&resize->lcn_bitmap, lcn_length,
+ if (!(relocate_rl = alloc_cluster(&resize->lcn_bitmap, lcn_length,
new_vol_size, hint)))
perr_exit("Cluster allocation failed for %llu:%lld",
resize->mref, lcn_length);
-
+
/* FIXME: check $MFTMirr DATA isn't multi-run (or support it) */
Vprintf("Relocate inode %7llu:0x%x:%08lld:0x%08llx --> 0x%08llx\n",
(unsigned long long)resize->mref,
@@...
[truncated message content] |