X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_guts.h;h=b3bc574a51b29fe2b99159898e9ea27157a765bd;hp=93809665c6097c0524eba88ea428018b9984f6a3;hb=2369fadda0bee21c2ddb7a7596be7a5df578757e;hpb=b4d93e23d5d94ff4de6c5d1f420153661fc6a0b3 diff --git a/yaffs_guts.h b/yaffs_guts.h index 9380966..b3bc574 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 @@ -600,6 +603,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 +957,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