aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/eba.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2012-05-14 11:55:51 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-20 13:25:59 -0400
commitb36a261e8c0ab323d04db9cdd1f6bb4c273c4b32 (patch)
tree00c90c5fa556f335338f4f61c808d4dfe502bb74 /drivers/mtd/ubi/eba.c
parent0964f6a27b3574d9210c59ec883cbb3fff78a78d (diff)
UBI: Kill data type hint
We do not need this feature and to our shame it even was not working and there was a bug found very recently. -- Artem Bityutskiy Without the data type hint UBI2 (fastmap) will be easier to implement. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/eba.c')
-rw-r--r--drivers/mtd/ubi/eba.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index 2455d620d96b..bd5fdbf7cb41 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -507,7 +507,7 @@ static int recover_peb(struct ubi_device *ubi, int pnum, int vol_id, int lnum,
507 return -ENOMEM; 507 return -ENOMEM;
508 508
509retry: 509retry:
510 new_pnum = ubi_wl_get_peb(ubi, UBI_UNKNOWN); 510 new_pnum = ubi_wl_get_peb(ubi);
511 if (new_pnum < 0) { 511 if (new_pnum < 0) {
512 ubi_free_vid_hdr(ubi, vid_hdr); 512 ubi_free_vid_hdr(ubi, vid_hdr);
513 return new_pnum; 513 return new_pnum;
@@ -585,7 +585,6 @@ write_error:
585 * @buf: the data to write 585 * @buf: the data to write
586 * @offset: offset within the logical eraseblock where to write 586 * @offset: offset within the logical eraseblock where to write
587 * @len: how many bytes to write 587 * @len: how many bytes to write
588 * @dtype: data type
589 * 588 *
590 * This function writes data to logical eraseblock @lnum of a dynamic volume 589 * This function writes data to logical eraseblock @lnum of a dynamic volume
591 * @vol. Returns zero in case of success and a negative error code in case 590 * @vol. Returns zero in case of success and a negative error code in case
@@ -593,7 +592,7 @@ write_error:
593 * written to the flash media, but may be some garbage. 592 * written to the flash media, but may be some garbage.
594 */ 593 */
595int ubi_eba_write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum, 594int ubi_eba_write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
596 const void *buf, int offset, int len, int dtype) 595 const void *buf, int offset, int len)
597{ 596{
598 int err, pnum, tries = 0, vol_id = vol->vol_id; 597 int err, pnum, tries = 0, vol_id = vol->vol_id;
599 struct ubi_vid_hdr *vid_hdr; 598 struct ubi_vid_hdr *vid_hdr;
@@ -641,7 +640,7 @@ int ubi_eba_write_leb(struct ubi_device *ubi, struct ubi_volume *vol, int lnum,
641 vid_hdr->data_pad = cpu_to_be32(vol->data_pad); 640 vid_hdr->data_pad = cpu_to_be32(vol->data_pad);
642 641
643retry: 642retry:
644 pnum = ubi_wl_get_peb(ubi, dtype); 643 pnum = ubi_wl_get_peb(ubi);
645 if (pnum < 0) { 644 if (pnum < 0) {
646 ubi_free_vid_hdr(ubi, vid_hdr); 645 ubi_free_vid_hdr(ubi, vid_hdr);
647 leb_write_unlock(ubi, vol_id, lnum); 646 leb_write_unlock(ubi, vol_id, lnum);
@@ -707,7 +706,6 @@ write_error:
707 * @lnum: logical eraseblock number 706 * @lnum: logical eraseblock number
708 * @buf: data to write 707 * @buf: data to write
709 * @len: how many bytes to write 708 * @len: how many bytes to write
710 * @dtype: data type
711 * @used_ebs: how many logical eraseblocks will this volume contain 709 * @used_ebs: how many logical eraseblocks will this volume contain
712 * 710 *
713 * This function writes data to logical eraseblock @lnum of static volume 711 * This function writes data to logical eraseblock @lnum of static volume
@@ -724,8 +722,7 @@ write_error:
724 * code in case of failure. 722 * code in case of failure.
725 */ 723 */
726int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol, 724int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol,
727 int lnum, const void *buf, int len, int dtype, 725 int lnum, const void *buf, int len, int used_ebs)
728 int used_ebs)
729{ 726{
730 int err, pnum, tries = 0, data_size = len, vol_id = vol->vol_id; 727 int err, pnum, tries = 0, data_size = len, vol_id = vol->vol_id;
731 struct ubi_vid_hdr *vid_hdr; 728 struct ubi_vid_hdr *vid_hdr;
@@ -763,7 +760,7 @@ int ubi_eba_write_leb_st(struct ubi_device *ubi, struct ubi_volume *vol,
763 vid_hdr->data_crc = cpu_to_be32(crc); 760 vid_hdr->data_crc = cpu_to_be32(crc);
764 761
765retry: 762retry:
766 pnum = ubi_wl_get_peb(ubi, dtype); 763 pnum = ubi_wl_get_peb(ubi);
767 if (pnum < 0) { 764 if (pnum < 0) {
768 ubi_free_vid_hdr(ubi, vid_hdr); 765 ubi_free_vid_hdr(ubi, vid_hdr);
769 leb_write_unlock(ubi, vol_id, lnum); 766 leb_write_unlock(ubi, vol_id, lnum);
@@ -827,7 +824,6 @@ write_error:
827 * @lnum: logical eraseblock number 824 * @lnum: logical eraseblock number
828 * @buf: data to write 825 * @buf: data to write
829 * @len: how many bytes to write 826 * @len: how many bytes to write
830 * @dtype: data type
831 * 827 *
832 * This function changes the contents of a logical eraseblock atomically. @buf 828 * This function changes the contents of a logical eraseblock atomically. @buf
833 * has to contain new logical eraseblock data, and @len - the length of the 829 * has to contain new logical eraseblock data, and @len - the length of the
@@ -839,7 +835,7 @@ write_error:
839 * LEB change may be done at a time. This is ensured by @ubi->alc_mutex. 835 * LEB change may be done at a time. This is ensured by @ubi->alc_mutex.
840 */ 836 */
841int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol, 837int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
842 int lnum, const void *buf, int len, int dtype) 838 int lnum, const void *buf, int len)
843{ 839{
844 int err, pnum, tries = 0, vol_id = vol->vol_id; 840 int err, pnum, tries = 0, vol_id = vol->vol_id;
845 struct ubi_vid_hdr *vid_hdr; 841 struct ubi_vid_hdr *vid_hdr;
@@ -856,7 +852,7 @@ int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
856 err = ubi_eba_unmap_leb(ubi, vol, lnum); 852 err = ubi_eba_unmap_leb(ubi, vol, lnum);
857 if (err) 853 if (err)
858 return err; 854 return err;
859 return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0, dtype); 855 return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0);
860 } 856 }
861 857
862 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS); 858 vid_hdr = ubi_zalloc_vid_hdr(ubi, GFP_NOFS);
@@ -881,7 +877,7 @@ int ubi_eba_atomic_leb_change(struct ubi_device *ubi, struct ubi_volume *vol,
881 vid_hdr->data_crc = cpu_to_be32(crc); 877 vid_hdr->data_crc = cpu_to_be32(crc);
882 878
883retry: 879retry:
884 pnum = ubi_wl_get_peb(ubi, dtype); 880 pnum = ubi_wl_get_peb(ubi);
885 if (pnum < 0) { 881 if (pnum < 0) {
886 err = pnum; 882 err = pnum;
887 goto out_leb_unlock; 883 goto out_leb_unlock;