Skip to content

Commit cb28a93

Browse files
committed
UBI: rename struct ubi_scan_volume
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>
1 parent 227423d commit cb28a93

7 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎drivers/mtd/ubi/debug.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,10 @@ void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx)
171171
}
172172

173173
/**
174-
* ubi_dump_sv - dump a &struct ubi_scan_volume object.
174+
* ubi_dump_sv - dump a &struct ubi_ainf_volume object.
175175
* @sv: the object to dump
176176
*/
177-
void ubi_dump_sv(const struct ubi_scan_volume *sv)
177+
void ubi_dump_sv(const struct ubi_ainf_volume *sv)
178178
{
179179
printk(KERN_DEBUG "Volume scanning information dump:\n");
180180
printk(KERN_DEBUG "\tvol_id %d\n", sv->vol_id);

‎drivers/mtd/ubi/debug.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr);
5959

6060
void ubi_dump_vol_info(const struct ubi_volume *vol);
6161
void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx);
62-
void ubi_dump_sv(const struct ubi_scan_volume *sv);
62+
void ubi_dump_sv(const struct ubi_ainf_volume *sv);
6363
void ubi_dump_seb(const struct ubi_ainf_peb *seb, int type);
6464
void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req);
6565
int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset,

‎drivers/mtd/ubi/eba.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ static void print_rsvd_warning(struct ubi_device *ubi,
12151215
int ubi_eba_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
12161216
{
12171217
int i, j, err, num_volumes;
1218-
struct ubi_scan_volume *sv;
1218+
struct ubi_ainf_volume *sv;
12191219
struct ubi_volume *vol;
12201220
struct ubi_ainf_peb *seb;
12211221
struct rb_node *rb;

‎drivers/mtd/ubi/scan.c‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
* headers and providing complete information about the UBI flash image.
2626
*
2727
* The scanning information is represented by a &struct ubi_scan_info' object.
28-
* Information about found volumes is represented by &struct ubi_scan_volume
28+
* Information about found volumes is represented by &struct ubi_ainf_volume
2929
* objects which are kept in volume RB-tree with root at the @volumes field.
3030
* The RB-tree is indexed by the volume ID.
3131
*
3232
* Scanned logical eraseblocks are represented by &struct ubi_ainf_peb objects.
3333
* These objects are kept in per-volume RB-trees with the root at the
34-
* corresponding &struct ubi_scan_volume object. To put it differently, we keep
34+
* corresponding &struct ubi_ainf_volume object. To put it differently, we keep
3535
* an RB-tree of per-volume objects and each of these objects is the root of
3636
* RB-tree of per-eraseblock objects.
3737
*
@@ -180,7 +180,7 @@ static int add_corrupted(struct ubi_scan_info *si, int pnum, int ec)
180180
* headers of the same volume.
181181
*/
182182
static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr,
183-
const struct ubi_scan_volume *sv, int pnum)
183+
const struct ubi_ainf_volume *sv, int pnum)
184184
{
185185
int vol_type = vid_hdr->vol_type;
186186
int vol_id = be32_to_cpu(vid_hdr->vol_id);
@@ -244,19 +244,19 @@ static int validate_vid_hdr(const struct ubi_vid_hdr *vid_hdr,
244244
* to the scanning volume object in case of success and a negative error code
245245
* in case of failure.
246246
*/
247-
static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
247+
static struct ubi_ainf_volume *add_volume(struct ubi_scan_info *si, int vol_id,
248248
int pnum,
249249
const struct ubi_vid_hdr *vid_hdr)
250250
{
251-
struct ubi_scan_volume *sv;
251+
struct ubi_ainf_volume *sv;
252252
struct rb_node **p = &si->volumes.rb_node, *parent = NULL;
253253

254254
ubi_assert(vol_id == be32_to_cpu(vid_hdr->vol_id));
255255

256256
/* Walk the volume RB-tree to look if this volume is already present */
257257
while (*p) {
258258
parent = *p;
259-
sv = rb_entry(parent, struct ubi_scan_volume, rb);
259+
sv = rb_entry(parent, struct ubi_ainf_volume, rb);
260260

261261
if (vol_id == sv->vol_id)
262262
return sv;
@@ -268,7 +268,7 @@ static struct ubi_scan_volume *add_volume(struct ubi_scan_info *si, int vol_id,
268268
}
269269

270270
/* The volume is absent - add it */
271-
sv = kmalloc(sizeof(struct ubi_scan_volume), GFP_KERNEL);
271+
sv = kmalloc(sizeof(struct ubi_ainf_volume), GFP_KERNEL);
272272
if (!sv)
273273
return ERR_PTR(-ENOMEM);
274274

@@ -446,7 +446,7 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
446446
{
447447
int err, vol_id, lnum;
448448
unsigned long long sqnum;
449-
struct ubi_scan_volume *sv;
449+
struct ubi_ainf_volume *sv;
450450
struct ubi_ainf_peb *seb;
451451
struct rb_node **p, *parent = NULL;
452452

@@ -593,14 +593,14 @@ int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
593593
* This function returns a pointer to the volume description or %NULL if there
594594
* are no data about this volume in the scanning information.
595595
*/
596-
struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
596+
struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
597597
int vol_id)
598598
{
599-
struct ubi_scan_volume *sv;
599+
struct ubi_ainf_volume *sv;
600600
struct rb_node *p = si->volumes.rb_node;
601601

602602
while (p) {
603-
sv = rb_entry(p, struct ubi_scan_volume, rb);
603+
sv = rb_entry(p, struct ubi_ainf_volume, rb);
604604

605605
if (vol_id == sv->vol_id)
606606
return sv;
@@ -622,7 +622,7 @@ struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
622622
* This function returns a pointer to the scanning logical eraseblock or %NULL
623623
* if there are no data about it in the scanning volume information.
624624
*/
625-
struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
625+
struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_ainf_volume *sv,
626626
int lnum)
627627
{
628628
struct ubi_ainf_peb *seb;
@@ -648,7 +648,7 @@ struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
648648
* @si: scanning information
649649
* @sv: the volume scanning information to delete
650650
*/
651-
void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
651+
void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_ainf_volume *sv)
652652
{
653653
struct rb_node *rb;
654654
struct ubi_ainf_peb *seb;
@@ -1147,7 +1147,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
11471147
{
11481148
int err, pnum;
11491149
struct rb_node *rb1, *rb2;
1150-
struct ubi_scan_volume *sv;
1150+
struct ubi_ainf_volume *sv;
11511151
struct ubi_ainf_peb *seb;
11521152
struct ubi_scan_info *si;
11531153

@@ -1244,7 +1244,7 @@ struct ubi_scan_info *ubi_scan(struct ubi_device *ubi)
12441244
* This function destroys the volume RB-tree (@sv->root) and the scanning
12451245
* volume information.
12461246
*/
1247-
static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
1247+
static void destroy_sv(struct ubi_scan_info *si, struct ubi_ainf_volume *sv)
12481248
{
12491249
struct ubi_ainf_peb *seb;
12501250
struct rb_node *this = sv->root.rb_node;
@@ -1277,7 +1277,7 @@ static void destroy_sv(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
12771277
void ubi_scan_destroy_si(struct ubi_scan_info *si)
12781278
{
12791279
struct ubi_ainf_peb *seb, *seb_tmp;
1280-
struct ubi_scan_volume *sv;
1280+
struct ubi_ainf_volume *sv;
12811281
struct rb_node *rb;
12821282

12831283
list_for_each_entry_safe(seb, seb_tmp, &si->alien, u.list) {
@@ -1305,7 +1305,7 @@ void ubi_scan_destroy_si(struct ubi_scan_info *si)
13051305
else if (rb->rb_right)
13061306
rb = rb->rb_right;
13071307
else {
1308-
sv = rb_entry(rb, struct ubi_scan_volume, rb);
1308+
sv = rb_entry(rb, struct ubi_ainf_volume, rb);
13091309

13101310
rb = rb_parent(rb);
13111311
if (rb) {
@@ -1337,7 +1337,7 @@ static int self_check_si(struct ubi_device *ubi, struct ubi_scan_info *si)
13371337
{
13381338
int pnum, err, vols_found = 0;
13391339
struct rb_node *rb1, *rb2;
1340-
struct ubi_scan_volume *sv;
1340+
struct ubi_ainf_volume *sv;
13411341
struct ubi_ainf_peb *seb, *last_seb;
13421342
uint8_t *buf;
13431343

‎drivers/mtd/ubi/scan.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct ubi_ainf_peb {
5353
};
5454

5555
/**
56-
* struct ubi_scan_volume - scanning information about a volume.
56+
* struct ubi_ainf_volume - scanning information about a volume.
5757
* @vol_id: volume ID
5858
* @highest_lnum: highest logical eraseblock number in this volume
5959
* @leb_count: number of logical eraseblocks in this volume
@@ -72,7 +72,7 @@ struct ubi_ainf_peb {
7272
*
7373
* One object of this type is allocated for each volume during scanning.
7474
*/
75-
struct ubi_scan_volume {
75+
struct ubi_ainf_volume {
7676
int vol_id;
7777
int highest_lnum;
7878
int leb_count;
@@ -148,7 +148,7 @@ struct ubi_vid_hdr;
148148
* @seb: scanning eraseblock information
149149
* @list: the list to move to
150150
*/
151-
static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv,
151+
static inline void ubi_scan_move_to_list(struct ubi_ainf_volume *sv,
152152
struct ubi_ainf_peb *seb,
153153
struct list_head *list)
154154
{
@@ -159,11 +159,11 @@ static inline void ubi_scan_move_to_list(struct ubi_scan_volume *sv,
159159
int ubi_scan_add_used(struct ubi_device *ubi, struct ubi_scan_info *si,
160160
int pnum, int ec, const struct ubi_vid_hdr *vid_hdr,
161161
int bitflips);
162-
struct ubi_scan_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
162+
struct ubi_ainf_volume *ubi_scan_find_sv(const struct ubi_scan_info *si,
163163
int vol_id);
164-
struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
164+
struct ubi_ainf_peb *ubi_scan_find_seb(const struct ubi_ainf_volume *sv,
165165
int lnum);
166-
void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv);
166+
void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_ainf_volume *sv);
167167
struct ubi_ainf_peb *ubi_scan_get_free_peb(struct ubi_device *ubi,
168168
struct ubi_scan_info *si);
169169
int ubi_scan_erase_peb(struct ubi_device *ubi, const struct ubi_scan_info *si,

‎drivers/mtd/ubi/vtbl.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static int create_vtbl(struct ubi_device *ubi, struct ubi_scan_info *si,
374374
*/
375375
static struct ubi_vtbl_record *process_lvol(struct ubi_device *ubi,
376376
struct ubi_scan_info *si,
377-
struct ubi_scan_volume *sv)
377+
struct ubi_ainf_volume *sv)
378378
{
379379
int err;
380380
struct rb_node *rb;
@@ -535,7 +535,7 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si,
535535
const struct ubi_vtbl_record *vtbl)
536536
{
537537
int i, reserved_pebs = 0;
538-
struct ubi_scan_volume *sv;
538+
struct ubi_ainf_volume *sv;
539539
struct ubi_volume *vol;
540540

541541
for (i = 0; i < ubi->vtbl_slots; i++) {
@@ -668,7 +668,7 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si,
668668
* to the data read from the volume tabla, and %-EINVAL if not.
669669
*/
670670
static int check_sv(const struct ubi_volume *vol,
671-
const struct ubi_scan_volume *sv)
671+
const struct ubi_ainf_volume *sv)
672672
{
673673
int err;
674674

@@ -715,7 +715,7 @@ static int check_scanning_info(const struct ubi_device *ubi,
715715
struct ubi_scan_info *si)
716716
{
717717
int err, i;
718-
struct ubi_scan_volume *sv;
718+
struct ubi_ainf_volume *sv;
719719
struct ubi_volume *vol;
720720

721721
if (si->vols_found > UBI_INT_VOL_COUNT + ubi->vtbl_slots) {
@@ -779,7 +779,7 @@ static int check_scanning_info(const struct ubi_device *ubi,
779779
int ubi_read_volume_table(struct ubi_device *ubi, struct ubi_scan_info *si)
780780
{
781781
int i, err;
782-
struct ubi_scan_volume *sv;
782+
struct ubi_ainf_volume *sv;
783783

784784
empty_vtbl_record.crc = cpu_to_be32(0xf116c36b);
785785

‎drivers/mtd/ubi/wl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ int ubi_wl_init_scan(struct ubi_device *ubi, struct ubi_scan_info *si)
13841384
{
13851385
int err, i;
13861386
struct rb_node *rb1, *rb2;
1387-
struct ubi_scan_volume *sv;
1387+
struct ubi_ainf_volume *sv;
13881388
struct ubi_ainf_peb *seb, *tmp;
13891389
struct ubi_wl_entry *e;
13901390

0 commit comments

Comments
 (0)