summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* UBI: modify ubi_wl_flush function to clear work queue for a lnumJoel Reardon2012-05-217-31/+70
| | | | | | | | | | | | | | | | | | | | | | | | | This patch modifies ubi_wl_flush to force the erasure of particular volume id / logical eraseblock number pairs. Previous functionality is preserved when passing UBI_ALL for both values. The locations where ubi_wl_flush were called are appropriately changed: ubi_leb_erase only flushes for the erased LEB, and ubi_create_volume forces only flushing for its volume id. External code can call this new feature via the new function ubi_flush() added to kapi.c, which simply passes through to ubi_wl_flush(). This was tested by disabling the call to do_work in ubi thread, which results in the work queue remaining unless explicitly called to remove. UBIFS was changed to call ubifs_leb_change 50 times for four different LEBs. Then the new function was called to clear the queue: passing wrong volume ids / lnum, correct ones, and finally UBI_ALL for both to ensure it was finally all cleard. The work queue was dumped each time and the selective removal of the particular LEB numbers was observed. Extra checks were enabled and ubifs's integck was also run. Finally, the drive was repeatedly filled and emptied to ensure that the queue was cleared normally. Artem: amended the patch. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: introduce UBI_ALL constantArtem Bityutskiy2012-05-212-5/+8
| | | | | | | | Joel will use it in his 'ubi_flush()' extention to specify all eraseblocks. Also amend the comment for UBI_UNKNOWN - it is used beyond attaching info structure now. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: add lnum and vol_id to struct ubi_workJoel Reardon2012-05-213-18/+33
| | | | | | | | | | | | | | | | | | | | | This is part of a multipart patch to allow UBI to force the erasure of particular logical eraseblock numbers. In this patch, the volume id and LEB number are added to ubi_work data structure, and both are also passed as a parameter to schedule erase to set it appropriately. Whenever ubi_wl_put_peb is called, the lnum is also passed to be forwarded to schedule erase. Later, a new ubi_sync_lnum will be added to execute immediately all work related to that lnum. This was tested by outputting the vol_id and lnum during the schedule of erasure. The ubi thread was disabled and two ubifs drives on separate partitions repeated changed a small number of LEBs. The ubi module was readded, and all the erased LEBs, corresponding to the volumes, were added to the schedule erase queue. Artem: minor tweaks Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: add volume id struct ubi_ainf_pebJoel Reardon2012-05-212-16/+35
| | | | | | | | | | | | | | | | This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at startup. PEBs now added to the erase queue will know their original LEB number and volume id, if available, and will be -1 otherwise (for instance, if the VID header is unreadable). This was tested by creating an ubi device with 3 volumes and disabiling the ubi_thread's do_work functionality. The different ubi volumes were formatted to ubifs and had files created and erased. The ubi modules was reloaded and the list of LEB's added to the erased list was outputted, confirming the volume ids and LEB numbers were appropriate. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: add in hex the value for UBI_INTERNAL_VOL_START to commentJoel Reardon2012-05-201-2/+2
| | | | | | | | | | | Explicitly provide the first internal volume ID value in the comment for UBI_INTERNAL_VOL_START. This allows developers who, when adding features related to volume ids and observe unexpected very large volume ids, to grep for the observed value in the source code and find out immediately that it is expected behaviour. Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename scan.c to attach.cArtem Bityutskiy2012-05-202-1/+1
| | | | | | | Finally, rename the scan.c file. Now adding fastmap support won't look that hacky anymore. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: remove scan.hArtem Bityutskiy2012-05-202-174/+147
| | | | | | | This file is small and it does not make sense to have it separate from where everything else lives, so merge it with ubi.h. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename UBI_SCAN_UNKNOWN_ECArtem Bityutskiy2012-05-202-12/+15
| | | | | | | | | | Rename the constant to UBI_UNKNOWN, for the same reason that we are going to add nother attaching method and re-use the same data structures, so the "SCAN" in the name becomes incorrect. I've also removed the "_EC" part because Joel is going to use this constant for other fields in the attaching info data structures. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: move and rename attach_by_scanningArtem Bityutskiy2012-05-204-62/+58
| | | | | | | Rename the 'attach_by_scanning()' function to 'ubi_attach()' and move it to scan.c. Richard will plug his fastmap stuff there. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename _init_scan functionsArtem Bityutskiy2012-05-204-9/+9
| | | | | | | | | | We have a couple of initialization funcntionsn left which have "_scan" suffic - rename them: ubi_eba_init_scan() -> ubi_eba_init() ubi_wl_init_scan() -> ubi_wl_init() Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: amend comments after all the renamingsArtem Bityutskiy2012-05-206-81/+73
| | | | | | | | | | This patch amends commentaries in scan.[ch] to match the new logic. Reminder - we did the restructuring to prepare the code for adding the fastmap. This patch also renames a couple of functions - it was too difficult to separate out that change and I decided that it is not too bad to have it in the same patch with commentaries changes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_leb_slabArtem Bityutskiy2012-05-202-16/+16
| | | | | | The old name is not logical anymore - rename it to 'aeb_slab_cache'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_move_to_listArtem Bityutskiy2012-05-202-3/+3
| | | | | | The old name is not logical anymore - rename it to 'ubi_move_aeb_to_list()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_destroy_aiArtem Bityutskiy2012-05-203-6/+6
| | | | | | The old name is not logical anymore - rename it to 'ubi_destroy_ai()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_get_free_pebArtem Bityutskiy2012-05-203-6/+6
| | | | | | The old name is not logical anymore - rename it to 'ubi_early_get_peb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_rm_volumeArtem Bityutskiy2012-05-203-5/+5
| | | | | | The old name is not logical anymore - rename it to 'ubi_remove_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_find_avArtem Bityutskiy2012-05-204-9/+9
| | | | | | The old name is not logical anymore - rename it to 'ubi_find_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_scan_add_usedArtem Bityutskiy2012-05-203-12/+9
| | | | | | The old name is not logical anymore - rename it to 'ubi_add_to_av()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: remove unused functionArtem Bityutskiy2012-05-202-31/+0
| | | | | | The 'ubi_scan_find_aeb()' function is unused and thus can be removed. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: make ubi_scan_erase_peb static and renameArtem Bityutskiy2012-05-202-6/+4
| | | | | | | | The 'ubi_scan_erase_peb()' is used only in scan.c so can be static. Also re-name it to 'early_erase_peb()' because we tend to use "ubi_" prefix only for non-static fuction and also because the new name is better. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename sv to avArtem Bityutskiy2012-05-207-182/+182
| | | | | | | | | After re-naming the 'struct ubi_scan_volume' we should adjust all variables named 'sv' to something else, because 'sv' stands for "scanning volume". Let's rename it to 'av' which stands for "attaching volume" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename si to aiArtem Bityutskiy2012-05-208-260/+260
| | | | | | | | | After re-naming the 'struct ubi_scan_info' we should adjust all variables named 'si' to something else, because 'si' stands for "scanning info". Let's rename it to 'ai' which stands for "attaching info" which is a bit more consistent and has the same length, which makes re-naming easy. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename seb to aebArtem Bityutskiy2012-05-207-196/+196
| | | | | | | | | After re-naming the 'struct ubi_scan_leb' we should adjust all variables named 'seb' to something else, because 'seb' stands for "scanning eraseblock". Let's rename it to 'aeb' which stands for "attaching eraseblock" which is a bit more consistend and has the same length. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: amend comments after renaming in scan.cArtem Bityutskiy2012-05-201-10/+11
| | | | | | | Now some commentaries are out-of-date, after we re-named the data structures - amend them. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename struct ubi_scan_infoArtem Bityutskiy2012-05-207-42/+44
| | | | | | | | | | Rename 'struct ubi_scan_info' to 'struct ubi_attach_info'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename struct ubi_scan_volumeArtem Bityutskiy2012-05-207-34/+34
| | | | | | | | | | | | Rename 'struct ubi_scan_volume' to 'struct ubi_ainf_volume'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename struct ubi_scan_lebArtem Bityutskiy2012-05-208-37/+37
| | | | | | | | | | | | Rename 'struct ubi_scan_leb' to 'struct ubi_ainf_leb'. This is part of the code re-structuring I am trying to do in order to add fastmap in a more logical way. Fastmap can share a lot with scanning, including the attach-time data structures, which all now have "scan" word in the name. Let's get rid of this word and use "ainf" instead which stands for "attach information". It has the same length as "scan" so re-naming is trivial. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: rename few functions for consistencyArtem Bityutskiy2012-05-203-14/+15
| | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: get rid of dbg_errArtem Bityutskiy2012-05-208-54/+52
| | | | | | | | This patch removes the 'dbg_err()' macro and we now use 'ubi_err' instead. The idea of 'dbg_err()' was to compile out some error message to make the binary a bit smaller - but I think it was a bad idea. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: more of clean-up terminology for self-checksArtem Bityutskiy2012-05-204-54/+49
| | | | | | | | | | | We have the "sefl-check" feature in UBI, but for historical reasons many corresponding functions and commentaries in the code use term "paranoid check" instead. Let's clean this up and use "self-check" everywhere. This patch renames functions, amends messages and kills several redundant debugging messages. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: clean-up terminology for self-checks in io.cArtem Bityutskiy2012-05-201-39/+37
| | | | | | | | | | | We have the "sefl-check" feature in UBI, but for historical reasons many corresponding functions and commentaries in the code use term "paranoid check" instead. Let's clean this up and use "self-check" everywhere. This patch renames functions, amends comments and messages. It touches only the io.c file. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: remove Kconfig debugging optionArtem Bityutskiy2012-05-208-120/+0
| | | | | | | | | This patch kills the UBI debugging Kconfig option completely and makes all the debugging stuff to be always compiled-in. It was pain in the neck to maintain this useless option because all users I am aware of have debugging enabled anyway - how else will you diagnose errors otherwise? Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_dbg_dump_mkvol_reqArtem Bityutskiy2012-05-203-5/+5
| | | | | | | | I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_mkvol_req()' to 'ubi_dump_mkvol_req()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_dbg_dump_sebArtem Bityutskiy2012-05-203-7/+7
| | | | | | | | I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_seb()' to 'ubi_dump_seb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_dbg_dump_svArtem Bityutskiy2012-05-204-9/+9
| | | | | | | | I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_sv()' to 'ubi_dump_sv()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_dbg_dump_vtbl_recordArtem Bityutskiy2012-05-204-9/+9
| | | | | | | | I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_vtbl_record()' to 'ubi_dump_vtbl_record()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: rename ubi_dbg_dump_vol_infoArtem Bityutskiy2012-05-204-6/+6
| | | | | | | | I am going to remove the "UBI debugging" compilation option and make the debugging stuff to be always compiled it. This patch is a preparation which renames 'ubi_dbg_dump_vol_info()' to 'ubi_dump_vol_info()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: amend commentaries WRT dtypeArtem Bityutskiy2012-05-203-11/+14
| | | | | | | | | | | Richard removed the "dtype" hint, but few commentaries were left and this patch removes them. I've also added a better description about the "dtype" field in the ubi-user.h for people who may ever wonder what was that dtype thing about. This patch also adds an important note that it is better to use value "3" for the "dtype" field. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: remove data type hint from ubi-user.hRichard Weinberger2012-05-201-21/+2
| | | | | | | | | This finally removes the data type hint from the UBI ABI. >From now on the "dtype" field will be ignored and must not used anymore. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: Kill data type hintRichard Weinberger2012-05-2025-225/+108
| | | | | | | | | | | 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>
* UBI: remove superfluous "!!" operationRichard Weinberger2012-05-201-1/+1
| | | | | | | !!(x < y) and (x < y) are identical expressions. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: always warn if case of I/O errorsArtem Bityutskiy2012-05-201-6/+6
| | | | | | | | Currently UBI silently retries I/O operation in case of errors. This patch makes it emit a warning before retrying. This should allow users notice issues earlier. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: always dump VID and EC headers in case of errorsArtem Bityutskiy2012-05-204-28/+24
| | | | | | | | | | | UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. Always dump the VID and EC headers' contents in case of errors when it is helpful. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBI: always dump flash contents in case of errorsArtem Bityutskiy2012-05-204-47/+40
| | | | | | | | | | | UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. Always dump the flash contents in case of errors, not only when debugging is enabled. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBI: always dump the stack on errorArtem Bityutskiy2012-05-205-23/+20
| | | | | | | | | | | | UBI (and UBIFS) are a bit over-engineered WRT debugging. The idea was to link as few as possible when debugging is disabled, but the downside is that most people produce bug reports which are difficult to understand. This patch weeds out the 'ubi_dbg_dump_stack()' function and turns it into 'dump_stack()' - it is always useful to have stack dump in case of an error. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
* UBIFS: fix memory leak on error pathSidney Amani2012-05-201-1/+1
| | | | | | | | | | | | | UBIFS leaks memory on error path in 'mount_ubifs()'. In case of failure in 'ubifs_fixup_free_space()', it does not call 'ubifs_lpt_free()' whereas LPT data structures can potentially be allocated. The amount of memory leaked can be quite high -- see 'ubifs_lpt_init()'. The bug was introduced when moving the LPT initialisation earlier in the mount process (commit '781c5717a95a74b294beb38b8276943b0f8b5bb4'). Signed-off-by: Sidney Amani <seed95@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBIFS: make ubifs_lpt_init clean-up in case of failureArtem Bityutskiy2012-05-201-2/+6
| | | | | | | | | | Most functions in UBIFS follow the following designn pattern: if the function allocates multiple resources, and failss at some point, it frees what it has allocated and returns an error. So the caller can rely on the fact that the callee has cleaned up everything after own failure. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Acked-by: Sidney Amani <seed95@gmail.com>
* UBIFS: get rid of dbg_errArtem Bityutskiy2012-05-1612-119/+114
| | | | | | | | This patch removes the 'dbg_err()' macro and we now use 'ubifs_err()' instead. The idea of 'dbg_err()' was to compile out some error message to make the binary a bit smaller - but I think it was a bad idea. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBIFS: remove Kconfig debugging optionArtem Bityutskiy2012-05-1615-238/+19
| | | | | | | Have the debugging stuff always compiled-in instead. It simplifies maintanance a lot. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
* UBIFS: remove a couple of unused macrosArtem Bityutskiy2012-05-161-3/+0
| | | | Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
OpenPOWER on IntegriCloud