|
@@ -529,18 +529,18 @@ retry:
|
|
|
|
|
|
data_size = offset + len;
|
|
|
mutex_lock(&ubi->buf_mutex);
|
|
|
- memset(ubi->peb_buf1 + offset, 0xFF, len);
|
|
|
+ memset(ubi->peb_buf + offset, 0xFF, len);
|
|
|
|
|
|
/* Read everything before the area where the write failure happened */
|
|
|
if (offset > 0) {
|
|
|
- err = ubi_io_read_data(ubi, ubi->peb_buf1, pnum, 0, offset);
|
|
|
+ err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, offset);
|
|
|
if (err && err != UBI_IO_BITFLIPS)
|
|
|
goto out_unlock;
|
|
|
}
|
|
|
|
|
|
- memcpy(ubi->peb_buf1 + offset, buf, len);
|
|
|
+ memcpy(ubi->peb_buf + offset, buf, len);
|
|
|
|
|
|
- err = ubi_io_write_data(ubi, ubi->peb_buf1, new_pnum, 0, data_size);
|
|
|
+ err = ubi_io_write_data(ubi, ubi->peb_buf, new_pnum, 0, data_size);
|
|
|
if (err) {
|
|
|
mutex_unlock(&ubi->buf_mutex);
|
|
|
goto write_error;
|
|
@@ -1053,13 +1053,13 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
|
|
|
|
|
|
/*
|
|
|
* OK, now the LEB is locked and we can safely start moving it. Since
|
|
|
- * this function utilizes the @ubi->peb_buf1 buffer which is shared
|
|
|
+ * this function utilizes the @ubi->peb_buf buffer which is shared
|
|
|
* with some other functions - we lock the buffer by taking the
|
|
|
* @ubi->buf_mutex.
|
|
|
*/
|
|
|
mutex_lock(&ubi->buf_mutex);
|
|
|
dbg_wl("read %d bytes of data", aldata_size);
|
|
|
- err = ubi_io_read_data(ubi, ubi->peb_buf1, from, 0, aldata_size);
|
|
|
+ err = ubi_io_read_data(ubi, ubi->peb_buf, from, 0, aldata_size);
|
|
|
if (err && err != UBI_IO_BITFLIPS) {
|
|
|
ubi_warn("error %d while reading data from PEB %d",
|
|
|
err, from);
|
|
@@ -1079,10 +1079,10 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
|
|
|
*/
|
|
|
if (vid_hdr->vol_type == UBI_VID_DYNAMIC)
|
|
|
aldata_size = data_size =
|
|
|
- ubi_calc_data_len(ubi, ubi->peb_buf1, data_size);
|
|
|
+ ubi_calc_data_len(ubi, ubi->peb_buf, data_size);
|
|
|
|
|
|
cond_resched();
|
|
|
- crc = crc32(UBI_CRC32_INIT, ubi->peb_buf1, data_size);
|
|
|
+ crc = crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size);
|
|
|
cond_resched();
|
|
|
|
|
|
/*
|
|
@@ -1121,7 +1121,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
|
|
|
}
|
|
|
|
|
|
if (data_size > 0) {
|
|
|
- err = ubi_io_write_data(ubi, ubi->peb_buf1, to, 0, aldata_size);
|
|
|
+ err = ubi_io_write_data(ubi, ubi->peb_buf, to, 0, aldata_size);
|
|
|
if (err) {
|
|
|
if (err == -EIO)
|
|
|
err = MOVE_TARGET_WR_ERR;
|
|
@@ -1134,8 +1134,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
|
|
|
* We've written the data and are going to read it back to make
|
|
|
* sure it was written correctly.
|
|
|
*/
|
|
|
- memset(ubi->peb_buf1, 0xFF, aldata_size);
|
|
|
- err = ubi_io_read_data(ubi, ubi->peb_buf1, to, 0, aldata_size);
|
|
|
+ memset(ubi->peb_buf, 0xFF, aldata_size);
|
|
|
+ err = ubi_io_read_data(ubi, ubi->peb_buf, to, 0, aldata_size);
|
|
|
if (err) {
|
|
|
if (err != UBI_IO_BITFLIPS) {
|
|
|
ubi_warn("error %d while reading data back "
|
|
@@ -1149,7 +1149,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
|
|
|
|
|
|
cond_resched();
|
|
|
|
|
|
- if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf1, data_size)) {
|
|
|
+ if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size)) {
|
|
|
ubi_warn("read data back from PEB %d and it is "
|
|
|
"different", to);
|
|
|
err = -EINVAL;
|