Lines Matching full:write
16 * write-buffering support. Write buffers help to save space which otherwise
18 * Instead, data first goes to the write-buffer and is flushed when the
22 * UBIFS distinguishes between minimum write size (@c->min_io_size) and maximum
23 * write size (@c->max_write_size). The latter is the maximum amount of bytes
26 * @c->min_io_size <= @c->max_write_size. Write-buffers are of
28 * write-buffer is flushed, only the portion of it (aligned to @c->min_io_size
29 * boundary) which contains data is written, not the whole write-buffer,
33 * hand, we want to write in optimal @c->max_write_size bytes chunks, which
35 * other hand, we do not want to waste space when synchronizing the write
37 * the next write offset to be not aligned to @c->max_write_size bytes. So the
38 * have to make sure that the write-buffer offset (@wbuf->offs) becomes aligned
40 * write-buffer size (@wbuf->size).
42 * Write-buffers are defined by 'struct ubifs_wbuf' objects and protected by
44 * has to lock the write-buffer (e.g. journal space reservation code), many
45 * functions related to write-buffers have "nolock" suffix which means that the
46 * caller has to lock the write-buffer before calling this function.
318 * The flash media obliges us to write only in chunks of %c->min_io_size and
319 * when we have to write less data we add padding node to the write-buffer and
322 * padding node which takes %UBIFS_PAD_NODE_SZ bytes, we write padding bytes
486 * wbuf_timer_callback_nolock - write-buffer timer callback function.
487 * @timer: timer data (write-buffer descriptor)
489 * This function is called when the write-buffer timer expires.
503 * new_wbuf_timer_nolock - start new write-buffer timer.
505 * @wbuf: write-buffer descriptor
529 * cancel_wbuf_timer_nolock - cancel write-buffer timer.
530 * @wbuf: write-buffer descriptor
541 * ubifs_wbuf_sync_nolock - synchronize write-buffer.
542 * @wbuf: write-buffer to synchronize
544 * This function synchronizes write-buffer @buf and returns zero in case of
547 * Note, although write-buffers are of @c->max_write_size, this function does
549 * if the write-buffer is only partially filled with data, only the used part
550 * of the write-buffer (aligned on @c->min_io_size boundary) is synchronized.
560 /* Write-buffer is empty or not seeked */ in ubifs_wbuf_sync_nolock()
578 * Do not write whole write buffer but write only the minimum necessary in ubifs_wbuf_sync_nolock()
593 * But our goal is to optimize writes and make sure we write in in ubifs_wbuf_sync_nolock()
598 * write-buffer flush we are again at the optimal offset (aligned to in ubifs_wbuf_sync_nolock()
619 * ubifs_wbuf_seek_nolock - seek write-buffer.
620 * @wbuf: write-buffer
624 * This function targets the write-buffer to logical eraseblock @lnum:@offs.
625 * The write-buffer has to be empty. Returns zero in case of success and a
656 * ubifs_bg_wbufs_sync - synchronize write-buffers.
659 * This function is called by background thread to synchronize write-buffers.
699 ubifs_err(c, "cannot sync write-buffer, error %d", err); in ubifs_bg_wbufs_sync()
720 * ubifs_wbuf_write_nolock - write data to flash via write-buffer.
721 * @wbuf: write-buffer
722 * @buf: node to write
725 * This function writes data to flash via write-buffer @wbuf. This means that
727 * does not take whole max. write unit (@c->max_write_size). Instead, the node
728 * will sit in RAM until the write-buffer is synchronized (e.g., by timer, or
729 * because more data are appended to the write-buffer).
769 * write-buffer. in ubifs_wbuf_write_nolock()
809 * write-buffer and switch to the next max. write unit. in ubifs_wbuf_write_nolock()
825 * The write-buffer offset is not aligned to in ubifs_wbuf_write_nolock()
827 * @c->max_write_size. Write @wbuf->size bytes to make sure the in ubifs_wbuf_write_nolock()
831 dbg_io("write %d bytes to LEB %d:%d", in ubifs_wbuf_write_nolock()
845 * The remaining data may take more whole max. write units, so write the in ubifs_wbuf_write_nolock()
846 * remains multiple to max. write unit size directly to the flash media. in ubifs_wbuf_write_nolock()
854 dbg_io("write %d bytes to LEB %d:%d", n, wbuf->lnum, in ubifs_wbuf_write_nolock()
895 * max. write unit, so write it to the write-buffer and we are in ubifs_wbuf_write_nolock()
929 ubifs_err(c, "cannot write %d bytes to LEB %d:%d, error %d", in ubifs_wbuf_write_nolock()
938 * ubifs_write_node_hmac - write node to the media.
940 * @buf: the node to write
980 * ubifs_write_node - write node to the media.
982 * @buf: the node to write
1000 * ubifs_read_node_wbuf - read node from the media or write-buffer.
1009 * in @buf. If the node partially or fully sits in the write-buffer, this
1030 /* We may safely unlock the write-buffer and read the data */ in ubifs_read_node_wbuf()
1040 /* Copy the rest from the write-buffer */ in ubifs_read_node_wbuf()
1045 /* Read everything that goes before write-buffer */ in ubifs_read_node_wbuf()
1138 * ubifs_wbuf_init - initialize write-buffer.
1140 * @wbuf: write-buffer to initialize
1142 * This function initializes write-buffer. Returns zero in case of success
1164 * If the LEB starts at the max. write size aligned address, then in ubifs_wbuf_init()
1165 * write-buffer size has to be set to @c->max_write_size. Otherwise, in ubifs_wbuf_init()
1167 * write size boundary. in ubifs_wbuf_init()
1183 * @wbuf: the write-buffer where to add
1186 * This function adds an inode number to the inode array of the write-buffer.
1202 * @wbuf: the write-buffer
1205 * This function returns with %1 if the write-buffer contains some data from the
1224 * ubifs_sync_wbufs_by_inode - synchronize write-buffers for an inode.
1228 * This function synchronizes write-buffers which contain nodes belonging to