Lines Matching full:node

48  * UBIFS stores nodes at 64 bit-aligned addresses. If the node length is not
49 * aligned, UBIFS starts the next node from the aligned address, and the padded
51 * bytes in those small gaps. Common headers of nodes store real node lengths,
55 * uses padding nodes or padding bytes, if the padding node does not fit.
211 * ubifs_check_node - check node.
213 * @buf: node to check
219 * This function checks node magic number and CRC checksum. This function also
220 * validates node length to prevent UBIFS from becoming crazy when an attacker
222 * node length in the common header could cause UBIFS to read memory outside of
260 ubifs_err(c, "bad node type %d", type); in ubifs_check_node()
293 ubifs_err(c, "bad node length %d", node_len); in ubifs_check_node()
296 ubifs_err(c, "bad node at LEB %d:%d", lnum, offs); in ubifs_check_node()
310 * when we have to write less data we add padding node to the write-buffer and
313 * padding node which takes %UBIFS_PAD_NODE_SZ bytes, we write padding bytes
341 /* Too little space, padding node won't fit */ in ubifs_pad()
370 * ubifs_prepare_node - prepare node to be written to flash.
372 * @node: the node to pad
373 * @len: node length
376 * This function prepares node at @node to be written to the media - it
377 * calculates node CRC, fills the common header, and adds proper padding up to
380 void ubifs_prepare_node(struct ubifs_info *c, void *node, int len, int pad) in ubifs_prepare_node() argument
383 struct ubifs_ch *ch = node; in ubifs_prepare_node()
393 crc = crc32(UBIFS_CRC32_INIT, node + 8, len - 8); in ubifs_prepare_node()
399 ubifs_pad(c, node + len, pad); in ubifs_prepare_node()
404 * ubifs_prep_grp_node - prepare node of a group to be written to flash.
406 * @node: the node to pad
407 * @len: node length
408 * @last: indicates the last node of the group
410 * This function prepares node at @node to be written to the media - it
411 * calculates node CRC and fills the common header.
413 void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last) in ubifs_prep_grp_node() argument
416 struct ubifs_ch *ch = node; in ubifs_prep_grp_node()
429 crc = crc32(UBIFS_CRC32_INIT, node + 8, len - 8); in ubifs_prep_grp_node()
668 * @buf: node to write
669 * @len: node length
672 * the last piece of the node won't reach the flash media immediately if it
673 * does not take whole max. write unit (@c->max_write_size). Instead, the node
678 * case of failure. If the node cannot be written because there is no more
714 * The node is not very large and fits entirely within in ubifs_wbuf_write_nolock()
751 * The node is large enough and does not fit entirely within in ubifs_wbuf_write_nolock()
791 * We align node length to 8-byte boundary because we anyway flash wbuf in ubifs_wbuf_write_nolock()
851 * ubifs_write_node - write node to the media.
853 * @buf: the node to write
854 * @len: node length
858 * This function automatically fills node magic number, assigns sequence
859 * number, and calculates node CRC checksum. The length of the @buf buffer has
861 * appends padding node and padding bytes if needed. Returns zero in case of
890 * ubifs_read_node_wbuf - read node from the media or write-buffer.
893 * @type: node type
894 * @len: node length
898 * This function reads a node of known type and length, checks it and stores
899 * in @buf. If the node partially or fully sits in the write-buffer, this
942 ubifs_err(c, "bad node type (%d but expected %d)", in ubifs_read_node_wbuf()
949 ubifs_err(c, "expected node type %d", type); in ubifs_read_node_wbuf()
955 ubifs_err(c, "bad node length %d, expected %d", rlen, len); in ubifs_read_node_wbuf()
962 ubifs_err(c, "bad node at LEB %d:%d", lnum, offs); in ubifs_read_node_wbuf()
969 * ubifs_read_node - read node.
972 * @type: node type
973 * @len: node length (not aligned)
977 * This function reads a node of known type and and length, checks it and
998 ubifs_errc(c, "bad node type (%d but expected %d)", in ubifs_read_node()
1005 ubifs_errc(c, "expected node type %d", type); in ubifs_read_node()
1011 ubifs_errc(c, "bad node length %d, expected %d", l, len); in ubifs_read_node()
1018 ubifs_errc(c, "bad node at LEB %d:%d, LEB mapping status %d", lnum, in ubifs_read_node()
1140 * a _copy_ of corresponding on-flash node which sits in ubifs_sync_wbufs_by_inode()