diff options
author | Paulo Alcantara <pcacjr@gmail.com> | 2011-07-07 22:17:10 +0000 |
---|---|---|
committer | Paulo Alcantara <pcacjr@gmail.com> | 2011-09-07 07:19:06 +0000 |
commit | 01bae76879d1720f136aa88e0b8984e15a3323bf (patch) | |
tree | 103ff370db2b821d0bdb903a95e48c94d28e77fc | |
parent | 045bc5cd1118fee51b19d89dc316038c8a93e5bf (diff) | |
download | syslinux-01bae76879d1720f136aa88e0b8984e15a3323bf.tar.gz syslinux-01bae76879d1720f136aa88e0b8984e15a3323bf.tar.xz syslinux-01bae76879d1720f136aa88e0b8984e15a3323bf.zip |
ntfs: implement new_ntfs_inode()
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
-rw-r--r-- | core/fs/ntfs/ntfs.c | 11 | ||||
-rw-r--r-- | core/fs/ntfs/ntfs.h | 32 |
2 files changed, 43 insertions, 0 deletions
diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c index 24c9859e..de73f38d 100644 --- a/core/fs/ntfs/ntfs.c +++ b/core/fs/ntfs/ntfs.c @@ -44,6 +44,17 @@ static inline int ntfs_check_sb_fields(const struct ntfs_bpb *sb) !memcmp(sb->oem_name, "MSWIN4.1", 8)); } +static inline struct inode *new_ntfs_inode(struct fs_info *fs) +{ + struct inode *inode; + + inode = alloc_inode(fs, 0, sizeof(struct ntfs_inode)); + if (!inode) + malloc_error("inode structure"); + + return inode; +} + /* Initialize the filesystem metadata and return block size in bits */ static int ntfs_fs_init(struct fs_info *fs) { diff --git a/core/fs/ntfs/ntfs.h b/core/fs/ntfs/ntfs.h index b5919a3e..7e392c04 100644 --- a/core/fs/ntfs/ntfs.h +++ b/core/fs/ntfs/ntfs.h @@ -61,4 +61,36 @@ struct ntfs_sb_info { } __attribute__((packed)); +/* The NTFS in-memory inode structure */ +struct ntfs_inode { + int64_t initialized_size; + int64_t allocated_size; + 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; + union { + struct { /* It is a directory, $MFT, or an index inode */ + uint32_t block_size; + uint32_t vcn_size; + uint32_t collation_rule; + 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 */ + sector_t offset; /* Current sector offset */ + sector_t here; /* Sector corresponding to offset */ +}; + #endif /* _NTFS_H_ */ |