X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.h;h=d3200706675073c56f600e1a3234bba58ed58824;hp=93809665c6097c0524eba88ea428018b9984f6a3;hb=662466a25f6c97bba330ad5d9e9ba215ca8874ee;hpb=b4d93e23d5d94ff4de6c5d1f420153661fc6a0b3 diff --git a/yaffs_guts.h b/yaffs_guts.h index 9380966..d320070 100644 --- a/yaffs_guts.h +++ b/yaffs_guts.h @@ -49,7 +49,10 @@ #define YAFFS_TNODES_INTERNAL_BITS (YAFFS_TNODES_LEVEL0_BITS - 1) #define YAFFS_TNODES_INTERNAL_MASK 0x7 #define YAFFS_TNODES_MAX_LEVEL 8 - +#define YAFFS_TNODES_MAX_BITS (YAFFS_TNODES_LEVEL0_BITS + \ + YAFFS_TNODES_INTERNAL_BITS * \ + YAFFS_TNODES_MAX_LEVEL) +#define YAFFS_MAX_CHUNK_ID ((1 << YAFFS_TNODES_MAX_BITS) - 1) /* Constants for YAFFS1 mode */ #define YAFFS_BYTES_PER_SPARE 16 @@ -61,7 +64,7 @@ #define YAFFS_MIN_YAFFS2_CHUNK_SIZE 1024 #define YAFFS_MIN_YAFFS2_SPARE_SIZE 32 -#define YAFFS_MAX_CHUNK_ID 0x000fffff + #define YAFFS_ALLOCATION_NOBJECTS 100 #define YAFFS_ALLOCATION_NTNODES 100 @@ -72,7 +75,9 @@ #define YAFFS_OBJECT_SPACE 0x40000 #define YAFFS_MAX_OBJECT_ID (YAFFS_OBJECT_SPACE - 1) -#define YAFFS_CHECKPOINT_VERSION 5 +/* Binary data version stamps */ +#define YAFFS_SUMMARY_VERSION 1 +#define YAFFS_CHECKPOINT_VERSION 7 #ifdef CONFIG_YAFFS_UNICODE #define YAFFS_MAX_NAME_LENGTH 127 @@ -531,7 +536,7 @@ struct yaffs_param { */ int use_nand_ecc; /* Flag to decide whether or not to use * NAND driver ECC on data (yaffs1) */ - int tags_9bytes; /* Use 9 byte tags */ + int tags_9bytes; /* Use 9 byte tags */ int no_tags_ecc; /* Flag to decide whether or not to do ECC * on packed tags (yaffs2) */ @@ -600,6 +605,11 @@ struct yaffs_param { int always_check_erased; /* Force chunk erased check always on */ int disable_summary; + + int max_objects; /* + * Set to limit the number of objects created. + * 0 = no limit. + */ }; struct yaffs_dev { @@ -949,11 +959,15 @@ u32 yaffs_get_group_base(struct yaffs_dev *dev, struct yaffs_tnode *tn, int yaffs_is_non_empty_dir(struct yaffs_obj *obj); -/*\ +void yaffs_addr_to_chunk(struct yaffs_dev *dev, loff_t addr, + int *chunk_out, u32 *offset_out); +/* * Marshalling functions to get loff_t file sizes into aand out of * object headers. */ void yaffs_oh_size_load(struct yaffs_obj_hdr *oh, loff_t fsize); loff_t yaffs_oh_to_size(struct yaffs_obj_hdr *oh); +loff_t yaffs_max_file_size(struct yaffs_dev *dev); + #endif