aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-08 08:29:37 -0500
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-03-09 02:39:31 -0500
commit0ca39d74de8b269fb61eac11b75bd6c3fc887c28 (patch)
tree928061677e97c85acc8b4d058b20ecb604b376e3 /drivers
parent43b043e78b876ce27034f167897b57fd2556ad29 (diff)
UBI: rename peb_buf1 to peb_buf
Now we have only one buffer so let's rename it to just 'peb_buf1'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/ubi/build.c8
-rw-r--r--drivers/mtd/ubi/eba.c24
-rw-r--r--drivers/mtd/ubi/io.c14
-rw-r--r--drivers/mtd/ubi/scan.c8
-rw-r--r--drivers/mtd/ubi/ubi.h6
5 files changed, 30 insertions, 30 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 6e0806bff9f7..0fde9fc7d2e5 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -945,8 +945,8 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
945 goto out_free; 945 goto out_free;
946 946
947 err = -ENOMEM; 947 err = -ENOMEM;
948 ubi->peb_buf1 = vmalloc(ubi->peb_size); 948 ubi->peb_buf = vmalloc(ubi->peb_size);
949 if (!ubi->peb_buf1) 949 if (!ubi->peb_buf)
950 goto out_free; 950 goto out_free;
951 951
952 err = ubi_debugging_init_dev(ubi); 952 err = ubi_debugging_init_dev(ubi);
@@ -1025,7 +1025,7 @@ out_detach:
1025out_debugging: 1025out_debugging:
1026 ubi_debugging_exit_dev(ubi); 1026 ubi_debugging_exit_dev(ubi);
1027out_free: 1027out_free:
1028 vfree(ubi->peb_buf1); 1028 vfree(ubi->peb_buf);
1029 if (ref) 1029 if (ref)
1030 put_device(&ubi->dev); 1030 put_device(&ubi->dev);
1031 else 1031 else
@@ -1096,7 +1096,7 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
1096 vfree(ubi->vtbl); 1096 vfree(ubi->vtbl);
1097 put_mtd_device(ubi->mtd); 1097 put_mtd_device(ubi->mtd);
1098 ubi_debugging_exit_dev(ubi); 1098 ubi_debugging_exit_dev(ubi);
1099 vfree(ubi->peb_buf1); 1099 vfree(ubi->peb_buf);
1100 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num); 1100 ubi_msg("mtd%d is detached from ubi%d", ubi->mtd->index, ubi->ubi_num);
1101 put_device(&ubi->dev); 1101 put_device(&ubi->dev);
1102 return 0; 1102 return 0;
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index f548af3c98bb..63edee02b57b 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -529,18 +529,18 @@ retry:
529 529
530 data_size = offset + len; 530 data_size = offset + len;
531 mutex_lock(&ubi->buf_mutex); 531 mutex_lock(&ubi->buf_mutex);
532 memset(ubi->peb_buf1 + offset, 0xFF, len); 532 memset(ubi->peb_buf + offset, 0xFF, len);
533 533
534 /* Read everything before the area where the write failure happened */ 534 /* Read everything before the area where the write failure happened */
535 if (offset > 0) { 535 if (offset > 0) {
536 err = ubi_io_read_data(ubi, ubi->peb_buf1, pnum, 0, offset); 536 err = ubi_io_read_data(ubi, ubi->peb_buf, pnum, 0, offset);
537 if (err && err != UBI_IO_BITFLIPS) 537 if (err && err != UBI_IO_BITFLIPS)
538 goto out_unlock; 538 goto out_unlock;
539 } 539 }
540 540
541 memcpy(ubi->peb_buf1 + offset, buf, len); 541 memcpy(ubi->peb_buf + offset, buf, len);
542 542
543 err = ubi_io_write_data(ubi, ubi->peb_buf1, new_pnum, 0, data_size); 543 err = ubi_io_write_data(ubi, ubi->peb_buf, new_pnum, 0, data_size);
544 if (err) { 544 if (err) {
545 mutex_unlock(&ubi->buf_mutex); 545 mutex_unlock(&ubi->buf_mutex);
546 goto write_error; 546 goto write_error;
@@ -1053,13 +1053,13 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1053 1053
1054 /* 1054 /*
1055 * OK, now the LEB is locked and we can safely start moving it. Since 1055 * OK, now the LEB is locked and we can safely start moving it. Since
1056 * this function utilizes the @ubi->peb_buf1 buffer which is shared 1056 * this function utilizes the @ubi->peb_buf buffer which is shared
1057 * with some other functions - we lock the buffer by taking the 1057 * with some other functions - we lock the buffer by taking the
1058 * @ubi->buf_mutex. 1058 * @ubi->buf_mutex.
1059 */ 1059 */
1060 mutex_lock(&ubi->buf_mutex); 1060 mutex_lock(&ubi->buf_mutex);
1061 dbg_wl("read %d bytes of data", aldata_size); 1061 dbg_wl("read %d bytes of data", aldata_size);
1062 err = ubi_io_read_data(ubi, ubi->peb_buf1, from, 0, aldata_size); 1062 err = ubi_io_read_data(ubi, ubi->peb_buf, from, 0, aldata_size);
1063 if (err && err != UBI_IO_BITFLIPS) { 1063 if (err && err != UBI_IO_BITFLIPS) {
1064 ubi_warn("error %d while reading data from PEB %d", 1064 ubi_warn("error %d while reading data from PEB %d",
1065 err, from); 1065 err, from);
@@ -1079,10 +1079,10 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1079 */ 1079 */
1080 if (vid_hdr->vol_type == UBI_VID_DYNAMIC) 1080 if (vid_hdr->vol_type == UBI_VID_DYNAMIC)
1081 aldata_size = data_size = 1081 aldata_size = data_size =
1082 ubi_calc_data_len(ubi, ubi->peb_buf1, data_size); 1082 ubi_calc_data_len(ubi, ubi->peb_buf, data_size);
1083 1083
1084 cond_resched(); 1084 cond_resched();
1085 crc = crc32(UBI_CRC32_INIT, ubi->peb_buf1, data_size); 1085 crc = crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size);
1086 cond_resched(); 1086 cond_resched();
1087 1087
1088 /* 1088 /*
@@ -1121,7 +1121,7 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1121 } 1121 }
1122 1122
1123 if (data_size > 0) { 1123 if (data_size > 0) {
1124 err = ubi_io_write_data(ubi, ubi->peb_buf1, to, 0, aldata_size); 1124 err = ubi_io_write_data(ubi, ubi->peb_buf, to, 0, aldata_size);
1125 if (err) { 1125 if (err) {
1126 if (err == -EIO) 1126 if (err == -EIO)
1127 err = MOVE_TARGET_WR_ERR; 1127 err = MOVE_TARGET_WR_ERR;
@@ -1134,8 +1134,8 @@ int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
1134 * We've written the data and are going to read it back to make 1134 * We've written the data and are going to read it back to make
1135 * sure it was written correctly. 1135 * sure it was written correctly.
1136 */ 1136 */
1137 memset(ubi->peb_buf1, 0xFF, aldata_size); 1137 memset(ubi->peb_buf, 0xFF, aldata_size);
1138 err = ubi_io_read_data(ubi, ubi->peb_buf1, to, 0, aldata_size); 1138 err = ubi_io_read_data(ubi, ubi->peb_buf, to, 0, aldata_size);
1139 if (err) { 1139 if (err) {
1140 if (err != UBI_IO_BITFLIPS) { 1140 if (err != UBI_IO_BITFLIPS) {
1141 ubi_warn("error %d while reading data back " 1141 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,
1149 1149
1150 cond_resched(); 1150 cond_resched();
1151 1151
1152 if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf1, data_size)) { 1152 if (crc != crc32(UBI_CRC32_INIT, ubi->peb_buf, data_size)) {
1153 ubi_warn("read data back from PEB %d and it is " 1153 ubi_warn("read data back from PEB %d and it is "
1154 "different", to); 1154 "different", to);
1155 err = -EINVAL; 1155 err = -EINVAL;
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 5cde4e5ca3e5..43f1a0011a55 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -431,11 +431,11 @@ static int torture_peb(struct ubi_device *ubi, int pnum)
431 goto out; 431 goto out;
432 432
433 /* Make sure the PEB contains only 0xFF bytes */ 433 /* Make sure the PEB contains only 0xFF bytes */
434 err = ubi_io_read(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); 434 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
435 if (err) 435 if (err)
436 goto out; 436 goto out;
437 437
438 err = ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->peb_size); 438 err = ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->peb_size);
439 if (err == 0) { 439 if (err == 0) {
440 ubi_err("erased PEB %d, but a non-0xFF byte found", 440 ubi_err("erased PEB %d, but a non-0xFF byte found",
441 pnum); 441 pnum);
@@ -444,17 +444,17 @@ static int torture_peb(struct ubi_device *ubi, int pnum)
444 } 444 }
445 445
446 /* Write a pattern and check it */ 446 /* Write a pattern and check it */
447 memset(ubi->peb_buf1, patterns[i], ubi->peb_size); 447 memset(ubi->peb_buf, patterns[i], ubi->peb_size);
448 err = ubi_io_write(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); 448 err = ubi_io_write(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
449 if (err) 449 if (err)
450 goto out; 450 goto out;
451 451
452 memset(ubi->peb_buf1, ~patterns[i], ubi->peb_size); 452 memset(ubi->peb_buf, ~patterns[i], ubi->peb_size);
453 err = ubi_io_read(ubi, ubi->peb_buf1, pnum, 0, ubi->peb_size); 453 err = ubi_io_read(ubi, ubi->peb_buf, pnum, 0, ubi->peb_size);
454 if (err) 454 if (err)
455 goto out; 455 goto out;
456 456
457 err = ubi_check_pattern(ubi->peb_buf1, patterns[i], 457 err = ubi_check_pattern(ubi->peb_buf, patterns[i],
458 ubi->peb_size); 458 ubi->peb_size);
459 if (err == 0) { 459 if (err == 0) {
460 ubi_err("pattern %x checking failed for PEB %d", 460 ubi_err("pattern %x checking failed for PEB %d",
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c
index b99318ed51e6..12c43b44f815 100644
--- a/drivers/mtd/ubi/scan.c
+++ b/drivers/mtd/ubi/scan.c
@@ -789,9 +789,9 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
789 int err; 789 int err;
790 790
791 mutex_lock(&ubi->buf_mutex); 791 mutex_lock(&ubi->buf_mutex);
792 memset(ubi->peb_buf1, 0x00, ubi->leb_size); 792 memset(ubi->peb_buf, 0x00, ubi->leb_size);
793 793
794 err = ubi_io_read(ubi, ubi->peb_buf1, pnum, ubi->leb_start, 794 err = ubi_io_read(ubi, ubi->peb_buf, pnum, ubi->leb_start,
795 ubi->leb_size); 795 ubi->leb_size);
796 if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err)) { 796 if (err == UBI_IO_BITFLIPS || mtd_is_eccerr(err)) {
797 /* 797 /*
@@ -808,7 +808,7 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
808 if (err) 808 if (err)
809 goto out_unlock; 809 goto out_unlock;
810 810
811 if (ubi_check_pattern(ubi->peb_buf1, 0xFF, ubi->leb_size)) 811 if (ubi_check_pattern(ubi->peb_buf, 0xFF, ubi->leb_size))
812 goto out_unlock; 812 goto out_unlock;
813 813
814 ubi_err("PEB %d contains corrupted VID header, and the data does not " 814 ubi_err("PEB %d contains corrupted VID header, and the data does not "
@@ -818,7 +818,7 @@ static int check_corruption(struct ubi_device *ubi, struct ubi_vid_hdr *vid_hdr,
818 dbg_msg("hexdump of PEB %d offset %d, length %d", 818 dbg_msg("hexdump of PEB %d offset %d, length %d",
819 pnum, ubi->leb_start, ubi->leb_size); 819 pnum, ubi->leb_start, ubi->leb_size);
820 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 820 ubi_dbg_print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
821 ubi->peb_buf1, ubi->leb_size, 1); 821 ubi->peb_buf, ubi->leb_size, 1);
822 err = 1; 822 err = 1;
823 823
824out_unlock: 824out_unlock:
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index cb93ad97468b..bd6120c62c55 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -387,8 +387,8 @@ struct ubi_wl_entry;
387 * time (MTD write buffer size) 387 * time (MTD write buffer size)
388 * @mtd: MTD device descriptor 388 * @mtd: MTD device descriptor
389 * 389 *
390 * @peb_buf1: a buffer of PEB size used for different purposes 390 * @peb_buf: a buffer of PEB size used for different purposes
391 * @buf_mutex: protects @peb_buf1 391 * @buf_mutex: protects @peb_buf
392 * @ckvol_mutex: serializes static volume checking when opening 392 * @ckvol_mutex: serializes static volume checking when opening
393 * 393 *
394 * @dbg: debugging information for this UBI device 394 * @dbg: debugging information for this UBI device
@@ -470,7 +470,7 @@ struct ubi_device {
470 int max_write_size; 470 int max_write_size;
471 struct mtd_info *mtd; 471 struct mtd_info *mtd;
472 472
473 void *peb_buf1; 473 void *peb_buf;
474 struct mutex buf_mutex; 474 struct mutex buf_mutex;
475 struct mutex ckvol_mutex; 475 struct mutex ckvol_mutex;
476 476