static bool ntfs_match_longname(const char *str, unsigned long mft_no,
struct fs_info *fs)
{
- uint8_t data[1 << BLOCK_SHIFT(fs)];
+ uint8_t data[BLOCK_SIZE(fs)];
int64_t offset;
MFT_RECORD *mrec;
block_t block = 0;
offset = mft_record_lookup(mft_no, fs, &block, &data);
if (offset < 0) {
- printf("No MFT record found!\n");
+ printf("No MFT record found.\n");
goto out;
}
attr = attr_lookup(NTFS_AT_FILENAME, mrec);
if (!attr) {
- printf("No attribute found!\n");
+ printf("No attribute found.\n");
goto out;
}
struct mapping_chunk *chunk,
uint32_t *offset)
{
- memset(chunk, 0, sizeof(*chunk));
+ memset(chunk, 0, sizeof *chunk);
*offset = 0U;
return (uint8_t *)attr + attr->data.non_resident.mapping_pairs_offset;
attr = attr_lookup(NTFS_AT_FILENAME, mrec);
if (!attr) {
- dprintf("No attribute found!\n");
+ dprintf("No attribute found.\n");
return DT_UNKNOWN;
}
static int index_inode_setup(struct fs_info *fs, unsigned long mft_no,
struct inode *inode)
{
- uint8_t data[1 << BLOCK_SHIFT(fs)];
+ uint8_t data[BLOCK_SIZE(fs)];
int64_t offset;
MFT_RECORD *mrec;
block_t block = 0;
offset = mft_record_lookup(mft_no, fs, &block, &data);
if (offset < 0) {
- dprintf("No MFT record found!\n");
+ printf("No MFT record found.\n");
goto out;
}
dprintf("Got a directory.\n");
attr = attr_lookup(NTFS_AT_INDEX_ROOT, mrec);
if (!attr) {
- dprintf("No attribute found!\n");
+ dprintf("No attribute found.\n");
goto out;
}
dprintf("Got a file.\n");
attr = attr_lookup(NTFS_AT_DATA, mrec);
if (!attr) {
- dprintf("No attribute found!\n");
+ dprintf("No attribute found.\n");
goto out;
}
static struct inode *index_lookup(const char *dname, struct inode *dir)
{
struct fs_info *fs = dir->fs;
- const uint64_t blk_size = UINT64_C(1) << BLOCK_SHIFT(fs);
+ const uint64_t blk_size = BLOCK_SIZE(fs);
uint8_t data[blk_size];
int64_t offset;
MFT_RECORD *mrec;
dprintf("index_lookup() - mft record number: %d\n", NTFS_PVT(dir)->mft_no);
offset = mft_record_lookup(NTFS_PVT(dir)->mft_no, fs, &block, &data);
if (offset < 0) {
- dprintf("No MFT record found!\n");
+ printf("No MFT record found.\n");
goto out;
}
attr = attr_lookup(NTFS_AT_INDEX_ROOT, mrec);
if (!attr) {
- dprintf("No attribute found!\n");
+ dprintf("No attribute found.\n");
goto out;
}
/* check for the presence of a child node */
if (!(ie->flags & INDEX_ENTRY_NODE)) {
- dprintf("No child node, aborting...\n");
+ printf("No child node, aborting...\n");
goto out;
}
attr = attr_lookup(NTFS_AT_INDEX_ALLOCATION, mrec);
if (!attr) {
- printf("No attribute found!\n");
+ printf("No attribute found.\n");
goto out;
}
uint32_t ret;
int64_t offset;
struct fs_info *fs = file->fs;
- uint8_t data[1 << BLOCK_SHIFT(fs)];
+ uint8_t data[BLOCK_SIZE(fs)];
struct inode *inode = file->inode;
block_t block = 0;
MFT_RECORD *mrec;
dprintf("mft_no: %d\n", NTFS_PVT(inode)->mft_no);
offset = mft_record_lookup(NTFS_PVT(inode)->mft_no, fs, &block, &data);
if (offset < 0) {
- printf("No MFT record found!\n");
+ printf("No MFT record found.\n");
goto out;
}
attr = attr_lookup(NTFS_AT_DATA, mrec);
if (!attr) {
- printf("No attribute found!\n");
+ printf("No attribute found.\n");
goto out;
}
{
int64_t offset;
struct fs_info *fs = file->fs;
- uint8_t data[1 << BLOCK_SHIFT(fs)];
+ uint8_t data[BLOCK_SIZE(fs)];
MFT_RECORD *mrec;
struct inode *inode = file->inode;
block_t block = 0;
offset = mft_record_lookup(NTFS_PVT(inode)->mft_no, fs, &block, &data);
if (offset < 0) {
- printf("No MFT record found!\n");
+ printf("No MFT record found.\n");
goto out;
}
attr = attr_lookup(NTFS_AT_FILENAME, mrec);
if (!attr) {
- printf("No attribute found!\n");
+ printf("No attribute found.\n");
goto out;
}
SECTOR_SIZE(fs) = 1 << SECTOR_SHIFT(fs);
BLOCK_SIZE(fs) = 1 << BLOCK_SHIFT(fs);
- sbi = malloc(sizeof(*sbi));
+ sbi = malloc(sizeof *sbi);
if (!sbi)
malloc_error("ntfs_sb_info structure");