Lines Matching full:write
105 MtdWriteContext *write = mtd_write_partition(part);
106 if (write == NULL) {
110 if (mtd_write_data(write, data, size) != size) {
111 LOGE("Can't write %s\n(%s)\n", MISC_NAME, strerror(errno));
112 mtd_write_close(write);
115 if (mtd_write_close(write)) {
166 MtdWriteContext *write = mtd_write_partition(part);
167 if (write == NULL) {
172 /* Write an invalid (zero) header first, to disable any previous
180 if (mtd_write_data(write, (char*) &header, header_size) != header_size) {
181 LOGE("Can't write header to %s\n(%s)\n", CACHE_NAME, strerror(errno));
182 mtd_write_close(write);
186 /* Write each section individually block-aligned, so we can write
195 // Write 1 byte into the following block, then fill to the end
198 // recovery. We write the log as late as possible in order to
200 mtd_erase_blocks(write, 0);
201 if (mtd_write_data(write, (char*) &header, 1) != 1) {
202 LOGE("Can't write log block to %s\n(%s)\n",
204 mtd_write_close(write);
209 off_t image_start_pos = mtd_erase_blocks(write, 0);
212 mtd_write_data(write, update, update_length) != update_length) {
213 LOGE("Can't write update to %s\n(%s)\n", CACHE_NAME, strerror(errno));
214 mtd_write_close(write);
217 off_t busy_start_pos = mtd_erase_blocks(write, 0);
218 header.image_offset = mtd_find_write_start(write, image_start_pos);
229 mtd_write_data(write, busy_bitmap, bitmap_length) != bitmap_length) {
230 LOGE("Can't write bitmap to %s\n(%s)\n", CACHE_NAME, strerror(errno));
231 mtd_write_close(write);
235 off_t fail_start_pos = mtd_erase_blocks(write, 0);
237 header.busy_bitmap_offset = mtd_find_write_start(write, busy_start_pos);
241 mtd_write_data(write, fail_bitmap, bitmap_length) != bitmap_length) {
242 LOGE("Can't write bitmap to %s\n(%s)\n", CACHE_NAME, strerror(errno));
243 mtd_write_close(write);
247 mtd_erase_blocks(write, 0);
249 header.fail_bitmap_offset = mtd_find_write_start(write, fail_start_pos);
251 /* Write the header last, after all the blocks it refers to, so that
255 if (mtd_write_close(write)) {
260 write = mtd_write_partition(part);
261 if (write == NULL) {
266 if (mtd_write_data(write, (char*) &header, header_size) != header_size) {
268 mtd_write_close(write);
277 mtd_write_close(write);
280 mtd_erase_blocks(write, 0);
295 if (mtd_write_data(write, log, erase_size) != erase_size) {
298 mtd_write_close(write);
304 if (mtd_erase_blocks(write, 0) != image_start_pos) {
306 mtd_write_close(write);
311 if (mtd_write_close(write)) {