+ STATIC_ASSERT(BATTFS_HEADER_LEN == 13);
+ buf[0] = hdr->inode;
+
+ buf[1] = hdr->seq;
+
+ buf[2] = hdr->fill;
+ buf[3] = hdr->fill >> 8;
+
+ buf[4] = hdr->pgoff;
+ buf[5] = hdr->pgoff >> 8;
+
+ /*
+ * Mark is at least 1 bit longer than page address.
+ * Needed to take care of wraparonds.
+ */
+ buf[6] = hdr->mark;
+ buf[7] = hdr->mark >> 8;
+ buf[8] = hdr->mark >> 16;
+
+ /*
+ * This field must be the before the last one!
+ */
+ buf[9] = hdr->fcs_free;
+ buf[10] = hdr->fcs_free >> 8;
+
+ /*
+ * This field must be the last one!
+ * This is needed because if the page is only partially
+ * written, we can use this to detect it.
+ */
+ buf[11] = hdr->fcs;
+ buf[12] = hdr->fcs >> 8;