#define _FSW_CORE_H_
#include "fsw_base.h"
-
+#ifdef __MAKEWITH_GNUEFI
+#include "fsw_efi_base.h"
+#endif
/** Maximum size for a path, specifically symlink target paths. */
-#ifndef VBOX
+#ifndef HOST_EFI_EDK2
#define FSW_PATH_MAX (4096)
#else
/* Too big allocations are handled with alloca() */
#define FSW_FSTYPE_TABLE_NAME(t) FSW_CONCAT3(fsw_,t,_table)
/** Indicates that the block cache entry is empty. */
-#define FSW_INVALID_BNO (~0UL)
+#define FSW_INVALID_BNO 0xFFFFFFFFFFFFFFFF
//
struct fsw_blockcache {
fsw_u32 refcount; //!< Reference count
fsw_u32 cache_level; //!< Level of importance of this block
- fsw_u32 phys_bno; //!< Physical block number
+ fsw_u64 phys_bno; //!< Physical block number
void *data; //!< Block data buffer
};
struct DNODESTRUCTNAME *parent; //!< Parent directory dnode
struct fsw_string name; //!< Name of this item in the parent directory
- fsw_u32 dnode_id; //!< Unique id number (usually the inode number)
+ fsw_u64 tree_id; //!< Unique id number (usually the btrfs subvolume)
+ fsw_u64 dnode_id; //!< Unique id number (usually the inode number)
int type; //!< Type of the dnode - file, dir, symlink, special
fsw_u64 size; //!< Data size in bytes
struct fsw_extent {
fsw_u32 type; //!< Type of extent specification
- fsw_u32 log_start; //!< Starting logical block number
+ fsw_u64 log_start; //!< Starting logical block number
fsw_u32 log_count; //!< Logical block count
- fsw_u32 phys_start; //!< Starting physical block number (for FSW_EXTENT_TYPE_PHYSBLOCK only)
+ fsw_u64 phys_start; //!< Starting physical block number (for FSW_EXTENT_TYPE_PHYSBLOCK only)
void *buffer; //!< Allocated buffer pointer (for FSW_EXTENT_TYPE_BUFFER only)
};
void (*change_blocksize)(struct fsw_volume *vol,
fsw_u32 old_phys_blocksize, fsw_u32 old_log_blocksize,
fsw_u32 new_phys_blocksize, fsw_u32 new_log_blocksize);
- fsw_status_t (*read_block)(struct fsw_volume *vol, fsw_u32 phys_bno, void *buffer);
+ fsw_status_t (*read_block)(struct fsw_volume *vol, fsw_u64 phys_bno, void *buffer);
};
/**
fsw_status_t fsw_volume_stat(struct fsw_volume *vol, struct fsw_volume_stat *sb);
void fsw_set_blocksize(struct VOLSTRUCTNAME *vol, fsw_u32 phys_blocksize, fsw_u32 log_blocksize);
-fsw_status_t fsw_block_get(struct VOLSTRUCTNAME *vol, fsw_u32 phys_bno, fsw_u32 cache_level, void **buffer_out);
-void fsw_block_release(struct VOLSTRUCTNAME *vol, fsw_u32 phys_bno, void *buffer);
+fsw_status_t fsw_block_get(struct VOLSTRUCTNAME *vol, fsw_u64 phys_bno, fsw_u32 cache_level, void **buffer_out);
+void fsw_block_release(struct VOLSTRUCTNAME *vol, fsw_u64 phys_bno, void *buffer);
/*@}*/
*/
/*@{*/
-fsw_status_t fsw_dnode_create_root(struct VOLSTRUCTNAME *vol, fsw_u32 dnode_id, struct DNODESTRUCTNAME **dno_out);
-fsw_status_t fsw_dnode_create(struct DNODESTRUCTNAME *parent_dno, fsw_u32 dnode_id, int type,
+fsw_status_t fsw_dnode_create_root(struct VOLSTRUCTNAME *vol, fsw_u64 dnode_id, struct DNODESTRUCTNAME **dno_out);
+fsw_status_t fsw_dnode_create(struct DNODESTRUCTNAME *parent_dno, fsw_u64 dnode_id, int type,
+ struct fsw_string *name, struct DNODESTRUCTNAME **dno_out);
+fsw_status_t fsw_dnode_create_root_with_tree(struct VOLSTRUCTNAME *vol, fsw_u64 tree_id, fsw_u64 dnode_id, struct DNODESTRUCTNAME **dno_out);
+fsw_status_t fsw_dnode_create_with_tree(struct DNODESTRUCTNAME *parent_dno, fsw_u64 tree_id, fsw_u64 dnode_id, int type,
struct fsw_string *name, struct DNODESTRUCTNAME **dno_out);
void fsw_dnode_retain(struct fsw_dnode *dno);
void fsw_dnode_release(struct fsw_dnode *dno);