aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@gmail.com>2011-07-28 03:49:34 +0000
committerPaulo Alcantara <pcacjr@gmail.com>2011-09-11 04:09:57 +0000
commit9fee694db275aea077761918d7892d78b6f4f387 (patch)
tree93fff878cd48a3a7df4c416d4cd13b230ef4011f /core
parentf1ce35d08a51708f1ad4d6b833df32199f366f94 (diff)
downloadsyslinux-9fee694db275aea077761918d7892d78b6f4f387.tar.gz
syslinux-9fee694db275aea077761918d7892d78b6f4f387.tar.xz
syslinux-9fee694db275aea077761918d7892d78b6f4f387.zip
ntfs: cleanups
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/fs/ntfs/ntfs.c10
-rw-r--r--core/fs/ntfs/ntfs.h51
2 files changed, 5 insertions, 56 deletions
diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index b9eca4c0..15552cb0 100644
--- a/core/fs/ntfs/ntfs.c
+++ b/core/fs/ntfs/ntfs.c
@@ -589,7 +589,7 @@ static struct inode *index_lookup(const char *dname, struct inode *dir)
continue;
if (chunk.flags & MAP_ALLOCATED) {
- printf("%d cluster(s) starting at 0x%X\n", chunk.len, chunk.lcn);
+ dprintf("%d cluster(s) starting at 0x%X\n", chunk.len, chunk.lcn);
memcpy(&chunks[i++], &chunk, sizeof chunk);
}
@@ -654,12 +654,12 @@ not_found:
dprintf("Index not found\n");
out:
- printf("%s not found!\n", dname);
+ dprintf("%s not found!\n", dname);
return NULL;
found:
- dprintf("--------------- Found index -------------------\n");
+ dprintf("Index found\n");
inode = new_ntfs_inode(fs);
err = index_inode_setup(fs, ie->data.dir.indexed_file, inode);
if (err) {
@@ -667,7 +667,7 @@ found:
goto out;
}
- printf("%s found!\n", dname);
+ dprintf("%s found!\n", dname);
return inode;
@@ -834,7 +834,7 @@ static int ntfs_readdir(struct file *file, struct dirent *dirent)
}
dirent->d_ino = NTFS_PVT(inode)->mft_no;
- dirent->d_off = file->offset;
+ dirent->d_off = file->offset++;
dirent->d_reclen = offsetof(struct dirent, d_name) + len + 1;
dirent->d_type = get_inode_mode(mrec);
memcpy(dirent->d_name, filename, len + 1);
diff --git a/core/fs/ntfs/ntfs.h b/core/fs/ntfs/ntfs.h
index 3174fe06..6194bd6e 100644
--- a/core/fs/ntfs/ntfs.h
+++ b/core/fs/ntfs/ntfs.h
@@ -67,10 +67,6 @@ struct ntfs_inode {
unsigned long mft_no; /* Number of the mft record / inode */
uint16_t seq_no; /* Sequence number of the mft record */
uint32_t type; /* Attribute type of this inode */
- uint16_t *name;
- uint32_t name_len;
- uint32_t attr_list_size;
- uint8_t *attr_list;
uint8_t non_resident;
union { /* Non-resident $DATA attribute */
struct { /* Used only if non_resident flags isn't set */
@@ -89,12 +85,6 @@ struct ntfs_inode {
uint8_t block_size_shift; /* log2 of the above */
uint8_t vcn_size_shift; /* log2 of the above */
} index;
- struct { /* It is a compressed/sparse file/attribute inode */
- int64_t size;
- uint32_t block_size;
- uint8_t block_size_bits;
- uint8_t block_clusters;
- } compressed;
} itype;
uint32_t start_cluster; /* Starting cluster address */
sector_t start; /* Starting sector */
@@ -222,12 +212,6 @@ typedef enum {
FILE_reserved16 = 16,
} NTFS_SYSTEM_FILES;
-/* MFT record flags */
-enum {
- MFT_RECORD_IN_USE = 0x0001,
- MFT_RECORD_IS_DIRECTORY = 0x0002,
-} __attribute__((__packed__));
-
typedef struct {
uint32_t magic;
uint16_t usa_ofs;
@@ -399,41 +383,6 @@ typedef struct {
uint16_t file_name[0]; /* File name in Unicode */
} __attribute__((__packed__)) FILE_NAME_ATTR;
-/* GUID structure */
-typedef struct {
- uint32_t data0;
- uint16_t data1;
- uint16_t data2;
- uint8_t data3[8];
-} __attribute__((__packed__)) GUID;
-
-typedef struct {
- uint64_t mft_ref;
- union {
- struct {
- GUID birth_vol_id;
- GUID birth_obj_id;
- GUID domain_id;
- } __attribute__((__packed__)) origin;
- uint8_t extended_info[48];
- } __attribute__((__packed__)) opt;
-} __attribute__((__packed__)) OBJ_ID_INDEX_DATA;
-
-/* Attribute: Object ID (NTFS 3.0+) (0x40)
- * Note: always resident
- */
-typedef struct {
- GUID object_id;
- union {
- struct {
- GUID birth_vol_id;
- GUID birth_obj_id;
- GUID domain_id;
- } __attribute__((__packed__)) origin;
- uint8_t extended_info[48];
- } __attribute__((__packed__)) opt;
-} __attribute__((__packed__)) OBJECT_ID_ATTR;
-
/* Attribute: Volume Name (0x60)
* Note: always resident
* Note: Present only in FILE_volume