X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fext4fs.h;h=cb5d9cc0a5c050dcc0fa33b22eb72c4a8555205d;hb=f53c2dc162d0c62debd0ebb88383e3b6fee95c10;hp=24293803966297480b268145840ad2a8f8a34b64;hpb=04735e9c5578dd4f3584be5454b9779e8e5c2af9;p=oweals%2Fu-boot.git diff --git a/include/ext4fs.h b/include/ext4fs.h index 2429380396..cb5d9cc0a5 100644 --- a/include/ext4fs.h +++ b/include/ext4fs.h @@ -28,10 +28,15 @@ #define __EXT4__ #include +struct disk_partition; + +#define EXT4_INDEX_FL 0x00001000 /* Inode uses hash tree index */ #define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ #define EXT4_EXT_MAGIC 0xf30a #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 +#define EXT4_FEATURE_RO_COMPAT_METADATA_CSUM 0x0400 #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 +#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 #define EXT4_INDIRECT_BLOCKS 12 #define EXT4_BG_INODE_UNINIT 0x0001 @@ -85,6 +90,8 @@ struct ext_filesystem { uint32_t inodesz; /* Sectors per Block */ uint32_t sect_perblk; + /* Group Descriptor size */ + uint16_t gdsize; /* Group Descriptor Block Number */ uint32_t gdtable_blkno; /* Total block groups of partition */ @@ -94,7 +101,6 @@ struct ext_filesystem { /* Superblock */ struct ext2_sblock *sb; /* Block group descritpor table */ - struct ext2_block_group *bgd; char *gdtable; /* Block Bitmap Related */ @@ -110,7 +116,13 @@ struct ext_filesystem { /* Journal Related */ /* Block Device Descriptor */ - block_dev_desc_t *dev_desc; + struct blk_desc *dev_desc; +}; + +struct ext_block_cache { + char *buf; + lbaint_t block; + int size; }; extern struct ext2_data *ext4fs_root; @@ -123,23 +135,35 @@ extern int gindex; int ext4fs_init(void); void ext4fs_deinit(void); -int ext4fs_filename_check(char *filename); -int ext4fs_write(const char *fname, unsigned char *buffer, - unsigned long sizebytes); +int ext4fs_filename_unlink(char *filename); +int ext4fs_write(const char *fname, const char *buffer, + unsigned long sizebytes, int type); +int ext4_write_file(const char *filename, void *buf, loff_t offset, loff_t len, + loff_t *actwrite); +int ext4fs_create_link(const char *target, const char *fname); #endif struct ext_filesystem *get_fs(void); -int ext4fs_open(const char *filename); -int ext4fs_read(char *buf, unsigned len); +int ext4fs_open(const char *filename, loff_t *len); +int ext4fs_read(char *buf, loff_t offset, loff_t len, loff_t *actread); int ext4fs_mount(unsigned part_length); void ext4fs_close(void); +void ext4fs_reinit_global(void); int ext4fs_ls(const char *dirname); +int ext4fs_exists(const char *filename); +int ext4fs_size(const char *filename, loff_t *size); void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot); int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf); -void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info); -long int read_allocated_block(struct ext2_inode *inode, int fileblock); -int ext4fs_probe(block_dev_desc_t *fs_dev_desc, - disk_partition_t *fs_partition); -int ext4_read_file(const char *filename, void *buf, int offset, int len); +void ext4fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info); +long int read_allocated_block(struct ext2_inode *inode, int fileblock, + struct ext_block_cache *cache); +int ext4fs_probe(struct blk_desc *fs_dev_desc, + struct disk_partition *fs_partition); +int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len, + loff_t *actread); int ext4_read_superblock(char *buffer); +int ext4fs_uuid(char *uuid_str); +void ext_cache_init(struct ext_block_cache *cache); +void ext_cache_fini(struct ext_block_cache *cache); +int ext_cache_read(struct ext_block_cache *cache, lbaint_t block, int size); #endif