[syslinux:master] ntfs: cleanups
syslinux-bot for Paulo Alcantara
pcacjr at gmail.com
Sat Dec 17 21:19:24 PST 2011
Commit-ID: 9fee694db275aea077761918d7892d78b6f4f387
Gitweb: http://www.syslinux.org/commit/9fee694db275aea077761918d7892d78b6f4f387
Author: Paulo Alcantara <pcacjr at gmail.com>
AuthorDate: Thu, 28 Jul 2011 03:49:34 +0000
Committer: Paulo Alcantara <pcacjr at gmail.com>
CommitDate: Sun, 11 Sep 2011 04:09:57 +0000
ntfs: cleanups
Signed-off-by: Paulo Alcantara <pcacjr at gmail.com>
---
core/fs/ntfs/ntfs.c | 10 +++++-----
core/fs/ntfs/ntfs.h | 51 ---------------------------------------------------
2 files changed, 5 insertions(+), 56 deletions(-)
diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index b9eca4c..15552cb 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 3174fe0..6194bd6 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
More information about the Syslinux-commits
mailing list