* headers and providing complete information about the UBI flash image.
*
* The scanning information is represented by a &struct ubi_scan_info' object.
- * Information about found volumes is represented by &struct ubi_scan_volume
+ * Information about found volumes is represented by &struct ubi_ainf_volume
* objects which are kept in volume RB-tree with root at the @volumes field.
* The RB-tree is indexed by the volume ID.
*
* Scanned logical eraseblocks are represented by &struct ubi_ainf_peb objects.
* These objects are kept in per-volume RB-trees with the root at the
- * corresponding &struct ubi_scan_volume object. To put it differently, we keep
+ * corresponding &struct ubi_ainf_volume object. To put it differently, we keep
* an RB-tree of per-volume objects and each of these objects is the root of
* RB-tree of per-eraseblock objects.
*
* headers of the same volume.
*/
static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr,
- const struct ubi_scan_volume *sv, int pnum)
+ const struct ubi_ainf_volume *sv, int pnum)
{
int vol_type = vid_hdr->vol_type;
int vol_id = be32_to_cpu(vid_hdr->vol_id);
* to the scanning volume object in case of success and a negative error code
* in case of failure.
*/
-static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
+static struct ubi_ainf_volume *add_volume(struct ubi_scan_info *si, int vol_id,
int pnum,
const struct ubi_vid_hdr *vid_hdr)
{
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct rb_node **p = &si->volumes.rb_node, *parent = NULL;
ubi_assert(vol_id == be32_to_cpu(vid_hdr->vol_id));
/* Walk the volume RB-tree to look if this volume is already present */
while (*p) {
parent = *p;
- sv = rb_entry(parent, struct ubi_scan_volume, rb);
+ sv = rb_entry(parent, struct ubi_ainf_volume, rb);
if (vol_id == sv->vol_id)
return sv;
}
/* The volume is absent - add it */
- sv = kmalloc(sizeof(struct ubi_scan_volume), GFP_KERNEL);
+ sv = kmalloc(sizeof(struct ubi_ainf_volume), GFP_KERNEL);
if (!sv)
return ERR_PTR(-ENOMEM);
{
int err, vol_id, lnum;
unsigned long long sqnum;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct ubi_ainf_peb *seb;
struct rb_node **p, *parent = NULL;
* This function returns a pointer to the volume description or %NULL if there
* are no data about this volume in the scanning information.
*/
-struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
+struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
int vol_id)
{
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct rb_node *p = si->volumes.rb_node;
while (p) {
- sv = rb_entry(p, struct ubi_scan_volume, rb);
+ sv = rb_entry(p, struct ubi_ainf_volume, rb);
if (vol_id == sv->vol_id)
return sv;
* This function returns a pointer to the scanning logical eraseblock or %NULL
* if there are no data about it in the scanning volume information.
*/
-struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
+struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_ainf_volume *sv,
int lnum)
{
struct ubi_ainf_peb *seb;
* @si: scanning information
* @sv: the volume scanning information to delete
*/
-void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
+void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_ainf_volume *sv)
{
struct rb_node *rb;
struct ubi_ainf_peb *seb;
{
int err, pnum;
struct rb_node *rb1, *rb2;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct ubi_ainf_peb *seb;
struct ubi_scan_info *si;
* This function destroys the volume RB-tree (@sv->root) and the scanning
* volume information.
*/
-static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
+static void destroy_sv(struct ubi_scan_info *si, struct ubi_ainf_volume *sv)
{
struct ubi_ainf_peb *seb;
struct rb_node *this = sv->root.rb_node;
void ubi_scan_destroy_si(struct ubi_scan_info *si)
{
struct ubi_ainf_peb *seb, *seb_tmp;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct rb_node *rb;
list_for_each_entry_safe(seb, seb_tmp, &si->alien, u.list) {
else if (rb->rb_right)
rb = rb->rb_right;
else {
- sv = rb_entry(rb, struct ubi_scan_volume, rb);
+ sv = rb_entry(rb, struct ubi_ainf_volume, rb);
rb = rb_parent(rb);
if (rb) {
{
int pnum, err, vols_found = 0;
struct rb_node *rb1, *rb2;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct ubi_ainf_peb *seb, *last_seb;
uint8_t *buf;
};
/**
- * struct ubi_scan_volume - scanning information about a volume.
+ * struct ubi_ainf_volume - scanning information about a volume.
* @vol_id: volume ID
* @highest_lnum: highest logical eraseblock number in this volume
* @leb_count: number of logical eraseblocks in this volume
*
* One object of this type is allocated for each volume during scanning.
*/
-struct ubi_scan_volume {
+struct ubi_ainf_volume {
int vol_id;
int highest_lnum;
int leb_count;
* @seb: scanning eraseblock information
* @list: the list to move to
*/
-static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv,
+static inline void ubi_scan_move_to_list(struct ubi_ainf_volume *sv,
struct ubi_ainf_peb *seb,
struct list_head *list)
{
int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
int pnum, int ec, const struct ubi_vid_hdr *vid_hdr,
int bitflips);
-struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
+struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
int vol_id);
-struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
+struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_ainf_volume *sv,
int lnum);
-void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv);
+void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_ainf_volume *sv);
struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi,
struct ubi_scan_info *si);
int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si,
*/
static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
struct ubi_scan_info *si,
- struct ubi_scan_volume *sv)
+ struct ubi_ainf_volume *sv)
{
int err;
struct rb_node *rb;
const struct ubi_vtbl_record *vtbl)
{
int i, reserved_pebs = 0;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct ubi_volume *vol;
for (i = 0; i < ubi->vtbl_slots; i++) {
* to the data read from the volume tabla, and %-EINVAL if not.
*/
static int check_sv(const struct ubi_volume *vol,
- const struct ubi_scan_volume *sv)
+ const struct ubi_ainf_volume *sv)
{
int err;
struct ubi_scan_info *si)
{
int err, i;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
struct ubi_volume *vol;
if (si->vols_found > UBI_INT_VOL_COUNT + ubi->vtbl_slots) {
int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_scan_info *si)
{
int i, err;
- struct ubi_scan_volume *sv;
+ struct ubi_ainf_volume *sv;
empty_vtbl_record.crc = cpu_to_be32(0xf116c36b);