Lines Matching defs:read

16  * We are trying to have a paranoid mindset and not to trust to what we read
64 * Suppose we have a 64-byte buffer and we read a VID header at it. We change
92 * ubi_io_read - read data from a physical eraseblock.
94 * @buf: buffer where to store the read data
95 * @pnum: physical eraseblock number to read from
96 * @offset: offset within the physical eraseblock from where to read
97 * @len: how many bytes to read
100 * and stores the read data in the @buf buffer. The following return codes are
103 * o %0 if all the requested data were successfully read;
104 * o %UBI_IO_BITFLIPS if all the requested data were successfully read, but
117 size_t read;
120 dbg_io("read %d bytes from PEB %d:%d", len, pnum, offset);
133 * 1. The buffer contains data from previous operation, e.g., read from
135 * just do not read anything and return - the caller would not
154 err = mtd_read(ubi->mtd, addr, len, &read, buf);
169 ubi_assert(len == read);
174 ubi_warn(ubi, "error %d%s while reading %d bytes from PEB %d:%d, read only %zd bytes, retry",
175 err, errstr, len, pnum, offset, read);
180 ubi_err(ubi, "error %d%s while reading %d bytes from PEB %d:%d, read %zd bytes",
181 err, errstr, len, pnum, offset, read);
185 * The driver should never return -EBADMSG if it failed to read
189 if (read != len && mtd_is_eccerr(err)) {
194 ubi_assert(len == read);
237 ubi_err(ubi, "read-only mode");
316 ubi_err(ubi, "read-only mode");
422 ubi_err(ubi, "read problems on freshly erased PEB %d, must be bad",
534 ubi_err(ubi, "read-only mode");
609 ubi_err(ubi, "read-only mode");
673 * ubi_io_read_ec_hdr - read and check an erase counter header.
675 * @pnum: physical eraseblock to read from
676 * @ec_hdr: a &struct ubi_ec_hdr object where to store the read erase counter
681 * stores it in @ec_hdr. This function also checks CRC checksum of the read
684 * o %0 if the CRC checksum is correct and the header was successfully read;
691 * o %UBI_IO_FF if only 0xFF bytes were read (the PEB is supposedly empty)
700 dbg_io("read EC header from PEB %d", pnum);
709 * We read all the data, but either a correctable bit-flip
712 * harmless, the later may mean that the read data is
725 * The magic field is wrong. Let's check if we have read all
761 ubi_warn(ubi, "bad EC header CRC at PEB %d, calculated %#08x, read %#08x",
765 dbg_bld("bad EC header CRC at PEB %d, calculated %#08x, read %#08x",
774 /* And of course validate what has just been read from the media */
952 * ubi_io_read_vid_hdr - read and check a volume identifier header.
954 * @pnum: physical eraseblock number to read from
959 * @pnum and stores it in @vidb. It also checks CRC checksum of the read
974 dbg_io("read VID header from PEB %d", pnum);
1014 ubi_warn(ubi, "bad CRC at PEB %d, calculated %#08x, read %#08x",
1018 dbg_bld("bad CRC at PEB %d, calculated %#08x, read %#08x",
1173 ubi_err(ubi, "bad CRC, calculated %#08x, read %#08x",
1263 ubi_err(ubi, "bad VID header CRC at PEB %d, calculated %#08x, read %#08x",
1295 size_t read;
1308 err = mtd_read(ubi->mtd, addr, len, &read, buf1);
1328 ubi_msg(ubi, "hex dump of the read buffer from %d to %d",
1358 size_t read;
1372 err = mtd_read(ubi->mtd, addr, len, &read, buf);
1374 ubi_err(ubi, "err %d while reading %d bytes from PEB %d:%d, read %zd bytes",
1375 err, len, pnum, offset, read);