• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6/drivers/mtd/ubi/

Lines Matching defs:sv

104  * @sv: information about the volume this logical eraseblock belongs to
116 const struct ubi_scan_volume *sv, int pnum)
123 if (sv->leb_count != 0) {
132 if (vol_id != sv->vol_id) {
137 if (sv->vol_type == UBI_STATIC_VOLUME)
147 if (used_ebs != sv->used_ebs) {
152 if (data_pad != sv->data_pad) {
163 ubi_dbg_dump_sv(sv);
184 struct ubi_scan_volume *sv;
192 sv = rb_entry(parent, struct ubi_scan_volume, rb);
194 if (vol_id == sv->vol_id)
195 return sv;
197 if (vol_id > sv->vol_id)
204 sv = kmalloc(sizeof(struct ubi_scan_volume), GFP_KERNEL);
205 if (!sv)
208 sv->highest_lnum = sv->leb_count = 0;
209 sv->vol_id = vol_id;
210 sv->root = RB_ROOT;
211 sv->used_ebs = be32_to_cpu(vid_hdr->used_ebs);
212 sv->data_pad = be32_to_cpu(vid_hdr->data_pad);
213 sv->compat = vid_hdr->compat;
214 sv->vol_type = vid_hdr->vol_type == UBI_VID_DYNAMIC ? UBI_DYNAMIC_VOLUME
219 rb_link_node(&sv->rb, parent, p);
220 rb_insert_color(&sv->rb, &si->volumes);
223 return sv;
384 struct ubi_scan_volume *sv;
395 sv = add_volume(si, vol_id, pnum, vid_hdr);
396 if (IS_ERR(sv))
397 return PTR_ERR(sv);
406 p = &sv->root.rb_node;
462 err = validate_vid_hdr(vid_hdr, sv, pnum);
480 if (sv->highest_lnum == lnum)
481 sv->last_data_size =
502 err = validate_vid_hdr(vid_hdr, sv, pnum);
516 if (sv->highest_lnum <= lnum) {
517 sv->highest_lnum = lnum;
518 sv->last_data_size = be32_to_cpu(vid_hdr->data_size);
521 sv->leb_count += 1;
523 rb_insert_color(&seb->u.rb, &sv->root);
539 struct ubi_scan_volume *sv;
543 sv = rb_entry(p, struct ubi_scan_volume, rb);
545 if (vol_id == sv->vol_id)
546 return sv;
548 if (vol_id > sv->vol_id)
559 * @sv: a pointer to the volume scanning information
565 struct ubi_scan_leb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
569 struct rb_node *p = sv->root.rb_node;
589 * @sv: the volume scanning information to delete
591 void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
596 dbg_bld("remove scanning information about volume %d", sv->vol_id);
598 while ((rb = rb_first(&sv->root))) {
600 rb_erase(&seb->u.rb, &sv->root);
604 rb_erase(&sv->rb, &si->volumes);
605 kfree(sv);
978 struct ubi_scan_volume *sv;
1024 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
1025 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb)
1063 * @sv: scanning volume information
1065 * This function destroys the volume RB-tree (@sv->root) and the scanning
1068 static void destroy_sv(struct ubi_scan_volume *sv)
1071 struct rb_node *this = sv->root.rb_node;
1091 kfree(sv);
1101 struct ubi_scan_volume *sv;
1129 sv = rb_entry(rb, struct ubi_scan_volume, rb);
1133 if (rb->rb_left == &sv->rb)
1139 destroy_sv(sv);
1160 struct ubi_scan_volume *sv;
1167 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
1179 if (sv->vol_id < 0 || sv->highest_lnum < 0 ||
1180 sv->leb_count < 0 || sv->vol_type < 0 || sv->used_ebs < 0 ||
1181 sv->data_pad < 0 || sv->last_data_size < 0) {
1186 if (sv->vol_id >= UBI_MAX_VOLUMES &&
1187 sv->vol_id < UBI_INTERNAL_VOL_START) {
1192 if (sv->vol_id > si->highest_vol_id) {
1194 si->highest_vol_id, sv->vol_id);
1198 if (sv->vol_type != UBI_DYNAMIC_VOLUME &&
1199 sv->vol_type != UBI_STATIC_VOLUME) {
1204 if (sv->data_pad > ubi->leb_size / 2) {
1210 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb) {
1239 if (sv->vol_type == UBI_STATIC_VOLUME) {
1240 if (seb->lnum >= sv->used_ebs) {
1245 if (sv->used_ebs != 0) {
1251 if (seb->lnum > sv->highest_lnum) {
1257 if (sv->leb_count != leb_count) {
1268 if (seb->lnum != sv->highest_lnum) {
1281 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
1283 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb) {
1300 if (sv->vol_type != vol_type) {
1310 if (sv->vol_id != be32_to_cpu(vidh->vol_id)) {
1311 ubi_err("bad vol_id %d", sv->vol_id);
1315 if (sv->compat != vidh->compat) {
1325 if (sv->used_ebs != be32_to_cpu(vidh->used_ebs)) {
1326 ubi_err("bad used_ebs %d", sv->used_ebs);
1330 if (sv->data_pad != be32_to_cpu(vidh->data_pad)) {
1331 ubi_err("bad data_pad %d", sv->data_pad);
1339 if (sv->highest_lnum != be32_to_cpu(vidh->lnum)) {
1340 ubi_err("bad highest_lnum %d", sv->highest_lnum);
1344 if (sv->last_data_size != be32_to_cpu(vidh->data_size)) {
1345 ubi_err("bad last_data_size %d", sv->last_data_size);
1367 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb)
1368 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb)
1398 ubi_dbg_dump_sv(sv);
1402 ubi_err("bad scanning information about volume %d", sv->vol_id);
1403 ubi_dbg_dump_sv(sv);
1407 ubi_err("bad scanning information about volume %d", sv->vol_id);
1408 ubi_dbg_dump_sv(sv);