diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-16 03:25:56 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-07-24 06:32:56 -0400 |
commit | 85c6e6e28259e9b58b8984db536c45bc3161f40c (patch) | |
tree | f389adfe74753f318290b45b7ce190421d18c48e /drivers/mtd/ubi/scan.c | |
parent | bb84c1a199558962edf4b4aeb4480fb09aa09b91 (diff) |
UBI: amend commentaries
Hch asked not to use "unit" for sub-systems, let it be so.
Also some other commentaries modifications.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/scan.c')
-rw-r--r-- | drivers/mtd/ubi/scan.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 96d410e106ab..892c2ba49777 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
@@ -19,9 +19,9 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * UBI scanning unit. | 22 | * UBI scanning sub-system. |
23 | * | 23 | * |
24 | * This unit is responsible for scanning the flash media, checking UBI | 24 | * This sub-system is responsible for scanning the flash media, checking UBI |
25 | * headers and providing complete information about the UBI flash image. | 25 | * headers and providing complete information about the UBI flash image. |
26 | * | 26 | * |
27 | * The scanning information is represented by a &struct ubi_scan_info' object. | 27 | * The scanning information is represented by a &struct ubi_scan_info' object. |
@@ -103,7 +103,7 @@ static int add_to_list(struct ubi_scan_info *si, int pnum, int ec, | |||
103 | * non-zero if an inconsistency was found and zero if not. | 103 | * non-zero if an inconsistency was found and zero if not. |
104 | * | 104 | * |
105 | * Note, UBI does sanity check of everything it reads from the flash media. | 105 | * Note, UBI does sanity check of everything it reads from the flash media. |
106 | * Most of the checks are done in the I/O unit. Here we check that the | 106 | * Most of the checks are done in the I/O sub-system. Here we check that the |
107 | * information in the VID header is consistent to the information in other VID | 107 | * information in the VID header is consistent to the information in other VID |
108 | * headers of the same volume. | 108 | * headers of the same volume. |
109 | */ | 109 | */ |
@@ -256,8 +256,8 @@ static int compare_lebs(struct ubi_device *ubi, const struct ubi_scan_leb *seb, | |||
256 | * that versions that are close to %0xFFFFFFFF are less then | 256 | * that versions that are close to %0xFFFFFFFF are less then |
257 | * versions that are close to %0. | 257 | * versions that are close to %0. |
258 | * | 258 | * |
259 | * The UBI WL unit guarantees that the number of pending tasks | 259 | * The UBI WL sub-system guarantees that the number of pending |
260 | * is not greater then %0x7FFFFFFF. So, if the difference | 260 | * tasks is not greater then %0x7FFFFFFF. So, if the difference |
261 | * between any two versions is greater or equivalent to | 261 | * between any two versions is greater or equivalent to |
262 | * %0x7FFFFFFF, there was an overflow and the logical | 262 | * %0x7FFFFFFF, there was an overflow and the logical |
263 | * eraseblock with lower version is actually newer then the one | 263 | * eraseblock with lower version is actually newer then the one |
@@ -645,9 +645,9 @@ void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv) | |||
645 | * | 645 | * |
646 | * This function erases physical eraseblock 'pnum', and writes the erase | 646 | * This function erases physical eraseblock 'pnum', and writes the erase |
647 | * counter header to it. This function should only be used on UBI device | 647 | * counter header to it. This function should only be used on UBI device |
648 | * initialization stages, when the EBA unit had not been yet initialized. This | 648 | * initialization stages, when the EBA sub-system had not been yet initialized. |
649 | * function returns zero in case of success and a negative error code in case | 649 | * This function returns zero in case of success and a negative error code in |
650 | * of failure. | 650 | * case of failure. |
651 | */ | 651 | */ |
652 | int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si, | 652 | int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si, |
653 | int pnum, int ec) | 653 | int pnum, int ec) |
@@ -687,9 +687,10 @@ out_free: | |||
687 | * @si: scanning information | 687 | * @si: scanning information |
688 | * | 688 | * |
689 | * This function returns a free physical eraseblock. It is supposed to be | 689 | * This function returns a free physical eraseblock. It is supposed to be |
690 | * called on the UBI initialization stages when the wear-leveling unit is not | 690 | * called on the UBI initialization stages when the wear-leveling sub-system is |
691 | * initialized yet. This function picks a physical eraseblocks from one of the | 691 | * not initialized yet. This function picks a physical eraseblocks from one of |
692 | * lists, writes the EC header if it is needed, and removes it from the list. | 692 | * the lists, writes the EC header if it is needed, and removes it from the |
693 | * list. | ||
693 | * | 694 | * |
694 | * This function returns scanning physical eraseblock information in case of | 695 | * This function returns scanning physical eraseblock information in case of |
695 | * success and an error code in case of failure. | 696 | * success and an error code in case of failure. |
@@ -764,8 +765,9 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, int pnum | |||
764 | return err; | 765 | return err; |
765 | else if (err) { | 766 | else if (err) { |
766 | /* | 767 | /* |
767 | * FIXME: this is actually duty of the I/O unit to initialize | 768 | * FIXME: this is actually duty of the I/O sub-system to |
768 | * this, but MTD does not provide enough information. | 769 | * initialize this, but MTD does not provide enough |
770 | * information. | ||
769 | */ | 771 | */ |
770 | si->bad_peb_count += 1; | 772 | si->bad_peb_count += 1; |
771 | return 0; | 773 | return 0; |