/* Binary data version stamps */
#define YAFFS_SUMMARY_VERSION 1
-#define YAFFS_CHECKPOINT_VERSION 7
#ifdef CONFIG_YAFFS_UNICODE
#define YAFFS_MAX_NAME_LENGTH 127
union yaffs_tags_union {
struct yaffs_tags as_tags;
- u8 as_bytes[8];
+ u8 as_bytes[8];
+ u32 as_u32[2];
};
};
+union yaffs_block_info_union {
+ struct yaffs_block_info bi;
+ u32 as_u32[2];
+};
+
/* -------------------------- Object structure -------------------------------*/
/* This is the object structure as stored on NAND */
int count;
};
-/* yaffs_checkpt_obj holds the definition of an object as dumped
- * by checkpointing.
- */
-
-struct yaffs_checkpt_obj {
- int struct_type;
- u32 obj_id;
- u32 parent_id;
- int hdr_chunk;
- u32 variant_type:3; /* enum yaffs_obj_type */
- u8 deleted:1;
- u8 soft_del:1;
- u8 unlinked:1;
- u8 fake:1;
- u8 rename_allowed:1;
- u8 unlink_allowed:1;
- u8 serial;
- int n_data_chunks;
- loff_t size_or_equiv_obj;
-};
/*--------------------- Temporary buffers ----------------
*
int hide_lost_n_found; /* Set non-zero to hide the lost-n-found dir. */
+ int stored_endian; /* 0=cpu endian, 1=little endian, 2=big endian */
+
/* The remove_obj_fn function must be supplied by OS flavours that
* need it.
* yaffs direct uses it to implement the faster readdir.
*/
u16 chunk_grp_size; /* == 2^^chunk_grp_bits */
+ struct yaffs_tnode *tn_swap_buffer;
+
/* Stuff to support wide tnodes */
u32 tnode_width;
u32 tnode_mask;
int is_mounted;
int read_only;
int is_checkpointed;
+ int swap_endian; /* Stored endian needs endian swap. */
/* Stuff to support block offsetting to support start block zero */
int internal_start_block;
};
+/*
+ * Checkpointing definitions.
+ */
+
+#define YAFFS_CHECKPOINT_VERSION 8
+
+/* yaffs_checkpt_obj holds the definition of an object as dumped
+ * by checkpointing.
+ */
+
+
+/* Checkpint object bits in bitfield: offset, length */
+#define CHECKPOINT_VARIANT_BITS 0, 3
+#define CHECKPOINT_DELETED_BITS 3, 1
+#define CHECKPOINT_SOFT_DEL_BITS 4, 1
+#define CHECKPOINT_UNLINKED_BITS 5, 1
+#define CHECKPOINT_FAKE_BITS 6, 1
+#define CHECKPOINT_RENAME_ALLOWED_BITS 7, 1
+#define CHECKPOINT_UNLINK_ALLOWED_BITS 8, 1
+#define CHECKPOINT_SERIAL_BITS 9, 8
+
+struct yaffs_checkpt_obj {
+ int struct_type;
+ u32 obj_id;
+ u32 parent_id;
+ int hdr_chunk;
+ u32 bit_field;
+ int n_data_chunks;
+ loff_t size_or_equiv_obj;
+};
+
/* The CheckpointDevice structure holds the device information that changes
*at runtime and must be preserved over unmount/mount cycles.
*/
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
+ * Marshalling functions to get loff_t file sizes into and 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);
+void yaffs_oh_size_load(struct yaffs_dev *dev, struct yaffs_obj_hdr *oh,
+ loff_t fsize, int do_endian);
+loff_t yaffs_oh_to_size(struct yaffs_dev *dev, struct yaffs_obj_hdr *oh,
+ int do_endian);
loff_t yaffs_max_file_size(struct yaffs_dev *dev);
/*