uint16_t usa_count;
uint16_t *blk;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
if (nrec->magic != NTFS_MAGIC_FILE && nrec->magic != NTFS_MAGIC_INDX)
return;
uint64_t loffset;
uint64_t k;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
if (count > len)
goto out;
int err;
struct ntfs_mft_record *mrec;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
buf = (uint8_t *)malloc(mft_record_size);
if (!buf)
err = ntfs_read(fs, buf, mft_record_size, mft_record_size, &right_blk,
&offset, &next_offset, &lcn);
if (err) {
- printf("Error on reading from cache.\n");
+ printf("Error while reading from cache.\n");
break;
}
int err;
struct ntfs_mft_record *mrec;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
buf = (uint8_t *)malloc(mft_record_size);
if (!buf)
err = ntfs_read(fs, buf, mft_record_size, mft_record_size, &right_blk,
&offset, &next_offset, &lcn);
if (err) {
- printf("Error on reading from cache.\n");
+ printf("Error while reading from cache.\n");
break;
}
uint8_t entry_fn_len;
unsigned i;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
entry_fn = ie->key.file_name.file_name;
entry_fn_len = ie->key.file_name.file_name_len;
(void)attr_len;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
chunk->flags &= ~MAP_MASK;
struct ntfs_mft_record *retval;
uint64_t start_blk = 0;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
if (attr->non_resident)
goto handle_non_resident_attr;
err = ntfs_read(fs, buf, blk_size, blk_size, &blk,
&blk_offset, NULL, (uint64_t *)&lcn);
if (err) {
- printf("Error on reading from cache.\n");
+ printf("Error while reading from cache.\n");
goto out;
}
for (; (uint8_t *)attr_entry < (uint8_t *)&buf[0] + len;
attr_entry = (struct ntfs_attr_list_entry *)
((uint8_t *)attr_entry + attr_entry->length)) {
- printf("<$ATTRIBUTE_LIST> Attribute type: 0x%x\n",
- attr_entry->type);
+ dprintf("<$ATTRIBUTE_LIST> Attribute type: 0x%x\n",
+ attr_entry->type);
if (attr_entry->type == type)
goto found; /* We got the attribute! :-) */
}
struct ntfs_attr_record *attr;
struct ntfs_attr_record *attr_list_attr;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
if (!_mrec || type == NTFS_AT_END)
goto out;
struct ntfs_mft_record *mrec, *lmrec;
struct ntfs_attr_record *attr;
enum dirent_type d_type;
- uint32_t len;
- struct ntfs_idx_root *ir;
uint8_t *attr_len;
struct mapping_chunk chunk;
int err;
uint8_t *stream;
uint32_t offset;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
mrec = NTFS_SB(fs)->mft_record_lookup(fs, mft_no, &start_blk);
if (!mrec) {
goto out;
}
- /* note: struct ntfs_idx_root is always resident */
- ir = (struct ntfs_idx_root *)((uint8_t *)attr +
- attr->data.resident.value_offset);
- len = attr->data.resident.value_len;
- if ((uint8_t *)ir + len > (uint8_t *)mrec +
- NTFS_SB(fs)->mft_record_size) {
- printf("Corrupt index.\n");
- goto out;
- }
-
/* check if we have a previous allocated state structure */
if (readdir_state) {
free(readdir_state);
uint64_t blk_offset;
struct ntfs_attr_record *attr;
struct ntfs_idx_root *ir;
- uint32_t len;
struct ntfs_idx_entry *ie;
const uint64_t blk_size = UINT64_C(1) << BLOCK_SHIFT(fs);
uint8_t buf[blk_size];
int64_t last_lcn;
struct inode *inode;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
mrec = NTFS_SB(fs)->mft_record_lookup(fs, NTFS_PVT(dir)->mft_no, NULL);
if (!mrec) {
ir = (struct ntfs_idx_root *)((uint8_t *)attr +
attr->data.resident.value_offset);
- len = attr->data.resident.value_len;
- if ((uint8_t *)ir + len > (uint8_t *)mrec + NTFS_SB(fs)->mft_record_size)
- goto index_err;
-
ie = (struct ntfs_idx_entry *)((uint8_t *)&ir->index +
ir->index.entries_offset);
for (;; ie = (struct ntfs_idx_entry *)((uint8_t *)ie + ie->len)) {
err = ntfs_read(fs, &buf, blk_size, blk_size, &blk,
&blk_offset, NULL, (uint64_t *)&lcn);
if (err) {
- printf("Error on reading from cache.\n");
+ printf("Error while reading from cache.\n");
goto not_found;
}
dprintf("Index not found\n");
out:
- dprintf("%s not found!\n", dname);
-
free(mrec);
return NULL;
goto out;
}
- dprintf("%s found!\n", dname);
-
free(mrec);
return inode;
const uint32_t sec_size = SECTOR_SIZE(fs);
const uint32_t sec_shift = SECTOR_SHIFT(fs);
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
if (!NTFS_PVT(inode)->non_resident) {
pstart = (sbi->mft_blk + NTFS_PVT(inode)->here) << BLOCK_SHIFT(fs) >>
struct ntfs_attr_record *attr;
char *p;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
non_resident = NTFS_PVT(inode)->non_resident;
int64_t lcn;
char filename[NTFS_MAX_FILE_NAME_LEN + 1];
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
mrec = NTFS_SB(fs)->mft_record_lookup(fs, NTFS_PVT(inode)->mft_no, NULL);
if (!mrec) {
ir = (struct ntfs_idx_root *)((uint8_t *)attr +
attr->data.resident.value_offset);
- len = attr->data.resident.value_len;
- if ((uint8_t *)ir + len > (uint8_t *)mrec + NTFS_SB(fs)->mft_record_size)
- goto index_err;
if (!file->offset && readdir_state->in_idx_root) {
file->offset = (uint32_t)((uint8_t *)&ir->index +
while (count--) {
err = parse_data_run(stream, &offset, attr_len, &chunk);
if (err) {
- printf("Error on parsing data runs.\n");
+ printf("Error while parsing data runs.\n");
goto out;
}
err = ntfs_read(fs, &buf, blk_size, blk_size, &blk, &blk_offset, NULL,
(uint64_t *)&lcn);
if (err) {
- printf("Error on reading from cache.\n");
+ printf("Error while reading from cache.\n");
goto not_found;
}
struct inode *inode;
int err;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
/* Fetch the $Volume MFT record */
start_blk = 0;
struct disk *disk = fs->fs_dev->disk;
uint8_t mft_record_shift;
- dprintf("in %s\n", __func__);
+ dprintf("in %s()\n", __func__);
read_count = disk->rdwr_sectors(disk, &ntfs, 0, 1, 0);
if (!read_count)
sbi->clusters = 0xFFFFFFFFFFF4ULL;
/*
- * Assume NTFS version 3.0 to begin with. If we find that the
+ * Assume NTFS version 3.0 to begin with. If we find that the
* volume is a different version later on, we will adjust at
* that time.
*/