• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/mtd/ubi/

Lines Matching defs:sv

109  * @sv: information about the volume this logical eraseblock belongs to
121 const struct ubi_scan_volume *sv, int pnum)
128 if (sv->leb_count != 0) {
137 if (vol_id != sv->vol_id) {
142 if (sv->vol_type == UBI_STATIC_VOLUME)
152 if (used_ebs != sv->used_ebs) {
157 if (data_pad != sv->data_pad) {
168 ubi_dbg_dump_sv(sv);
189 struct ubi_scan_volume *sv;
197 sv = rb_entry(parent, struct ubi_scan_volume, rb);
199 if (vol_id == sv->vol_id)
200 return sv;
202 if (vol_id > sv->vol_id)
209 sv = kmalloc(sizeof(struct ubi_scan_volume), GFP_KERNEL);
210 if (!sv)
213 sv->highest_lnum = sv->leb_count = 0;
215 sv->vol_id = vol_id;
216 sv->root = RB_ROOT;
217 sv->used_ebs = ubi32_to_cpu(vid_hdr->used_ebs);
218 sv->data_pad = ubi32_to_cpu(vid_hdr->data_pad);
219 sv->compat = vid_hdr->compat;
220 sv->vol_type = vid_hdr->vol_type == UBI_VID_DYNAMIC ? UBI_DYNAMIC_VOLUME
225 rb_link_node(&sv->rb, parent, p);
226 rb_insert_color(&sv->rb, &si->volumes);
229 return sv;
385 struct ubi_scan_volume *sv;
397 sv = add_volume(si, vol_id, pnum, vid_hdr);
398 if (IS_ERR(sv) < 0)
399 return PTR_ERR(sv);
405 p = &sv->root.rb_node;
460 err = validate_vid_hdr(vid_hdr, sv, pnum);
479 if (sv->highest_lnum == lnum)
480 sv->last_data_size =
503 err = validate_vid_hdr(vid_hdr, sv, pnum);
518 if (sv->highest_lnum <= lnum) {
519 sv->highest_lnum = lnum;
520 sv->last_data_size = ubi32_to_cpu(vid_hdr->data_size);
526 sv->leb_count += 1;
528 rb_insert_color(&seb->u.rb, &sv->root);
544 struct ubi_scan_volume *sv;
548 sv = rb_entry(p, struct ubi_scan_volume, rb);
550 if (vol_id == sv->vol_id)
551 return sv;
553 if (vol_id > sv->vol_id)
565 * @sv: a pointer to the volume scanning information
571 struct ubi_scan_leb *ubi_scan_find_seb(const struct ubi_scan_volume *sv,
575 struct rb_node *p = sv->root.rb_node;
595 * @sv: the volume scanning information to delete
597 void ubi_scan_rm_volume(struct ubi_scan_info *si, struct ubi_scan_volume *sv)
602 dbg_bld("remove scanning information about volume %d", sv->vol_id);
604 while ((rb = rb_first(&sv->root))) {
606 rb_erase(&seb->u.rb, &sv->root);
610 rb_erase(&sv->rb, &si->volumes);
611 kfree(sv);
886 struct ubi_scan_volume *sv;
932 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
933 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb)
974 * @sv: scanning volume information
976 * This function destroys the volume RB-tree (@sv->root) and the scanning
979 static void destroy_sv(struct ubi_scan_volume *sv)
982 struct rb_node *this = sv->root.rb_node;
1002 kfree(sv);
1012 struct ubi_scan_volume *sv;
1040 sv = rb_entry(rb, struct ubi_scan_volume, rb);
1044 if (rb->rb_left == &sv->rb)
1050 destroy_sv(sv);
1073 struct ubi_scan_volume *sv;
1080 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
1092 if (sv->vol_id < 0 || sv->highest_lnum < 0 ||
1093 sv->leb_count < 0 || sv->vol_type < 0 || sv->used_ebs < 0 ||
1094 sv->data_pad < 0 || sv->last_data_size < 0) {
1099 if (sv->vol_id >= UBI_MAX_VOLUMES &&
1100 sv->vol_id < UBI_INTERNAL_VOL_START) {
1105 if (sv->vol_id > si->highest_vol_id) {
1107 si->highest_vol_id, sv->vol_id);
1111 if (sv->vol_type != UBI_DYNAMIC_VOLUME &&
1112 sv->vol_type != UBI_STATIC_VOLUME) {
1117 if (sv->data_pad > ubi->leb_size / 2) {
1123 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb) {
1152 if (sv->vol_type == UBI_STATIC_VOLUME) {
1153 if (seb->lnum >= sv->used_ebs) {
1158 if (sv->used_ebs != 0) {
1164 if (seb->lnum > sv->highest_lnum) {
1170 if (sv->leb_count != leb_count) {
1181 if (seb->lnum != sv->highest_lnum) {
1194 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb) {
1196 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb) {
1213 if (sv->vol_type != vol_type) {
1223 if (sv->vol_id != ubi32_to_cpu(vidh->vol_id)) {
1224 ubi_err("bad vol_id %d", sv->vol_id);
1228 if (sv->compat != vidh->compat) {
1238 if (sv->used_ebs != ubi32_to_cpu(vidh->used_ebs)) {
1239 ubi_err("bad used_ebs %d", sv->used_ebs);
1243 if (sv->data_pad != ubi32_to_cpu(vidh->data_pad)) {
1244 ubi_err("bad data_pad %d", sv->data_pad);
1257 if (sv->highest_lnum != ubi32_to_cpu(vidh->lnum)) {
1258 ubi_err("bad highest_lnum %d", sv->highest_lnum);
1262 if (sv->last_data_size != ubi32_to_cpu(vidh->data_size)) {
1263 ubi_err("bad last_data_size %d", sv->last_data_size);
1285 ubi_rb_for_each_entry(rb1, sv, &si->volumes, rb)
1286 ubi_rb_for_each_entry(rb2, seb, &sv->root, u.rb)
1316 ubi_dbg_dump_sv(sv);
1320 ubi_err("bad scanning information about volume %d", sv->vol_id);
1321 ubi_dbg_dump_sv(sv);
1325 ubi_err("bad scanning information about volume %d", sv->vol_id);
1326 ubi_dbg_dump_sv(sv);