• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/mtd/ubi/

Lines Matching refs:vol

75  * @vol: volume description object
78 void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
81 vi->vol_id = vol->vol_id;
83 vi->size = vol->reserved_pebs;
84 vi->used_bytes = vol->used_bytes;
85 vi->vol_type = vol->vol_type;
86 vi->corrupted = vol->corrupted;
87 vi->upd_marker = vol->upd_marker;
88 vi->alignment = vol->alignment;
89 vi->usable_leb_size = vol->usable_leb_size;
90 vi->name_len = vol->name_len;
91 vi->name = vol->name;
92 vi->cdev = vol->cdev.dev;
103 ubi_do_get_volume_info(desc->vol->ubi, desc->vol, vi);
130 struct ubi_volume *vol;
164 vol = ubi->volumes[vol_id];
165 if (!vol)
171 if (vol->exclusive)
173 vol->readers += 1;
177 if (vol->exclusive || vol->writers > 0)
179 vol->writers += 1;
183 if (vol->exclusive || vol->writers || vol->readers)
185 vol->exclusive = 1;
188 get_device(&vol->dev);
189 vol->ref_count += 1;
192 desc->vol = vol;
196 if (!vol->checked) {
207 vol->corrupted = 1;
209 vol->checked = 1;
262 struct ubi_volume *vol = ubi->volumes[i];
264 if (vol && len == vol->name_len && !strcmp(name, vol->name)) {
328 struct ubi_volume *vol = desc->vol;
329 struct ubi_device *ubi = vol->ubi;
332 ubi->ubi_num, vol->vol_id, desc->mode);
337 vol->readers -= 1;
340 vol->writers -= 1;
343 vol->exclusive = 0;
345 vol->ref_count -= 1;
349 put_device(&vol->dev);
385 struct ubi_volume *vol = desc->vol;
386 struct ubi_device *ubi = vol->ubi;
387 int err, vol_id = vol->vol_id;
392 lnum >= vol->used_ebs || offset < 0 || len < 0 ||
393 offset + len > vol->usable_leb_size)
396 if (vol->vol_type == UBI_STATIC_VOLUME) {
397 if (vol->used_ebs == 0)
400 if (lnum == vol->used_ebs - 1 &&
401 offset + len > vol->last_eb_bytes)
405 if (vol->upd_marker)
410 err = ubi_eba_read_leb(ubi, vol, lnum, buf, offset, len, check);
411 if (err && err == -EBADMSG && vol->vol_type == UBI_STATIC_VOLUME) {
413 vol->corrupted = 1;
450 struct ubi_volume *vol = desc->vol;
451 struct ubi_device *ubi = vol->ubi;
452 int vol_id = vol->vol_id;
459 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
462 if (lnum < 0 || lnum >= vol->reserved_pebs || offset < 0 || len < 0 ||
463 offset + len > vol->usable_leb_size ||
471 if (vol->upd_marker)
477 return ubi_eba_write_leb(ubi, vol, lnum, buf, offset, len, dtype);
500 struct ubi_volume *vol = desc->vol;
501 struct ubi_device *ubi = vol->ubi;
502 int vol_id = vol->vol_id;
509 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
512 if (lnum < 0 || lnum >= vol->reserved_pebs || len < 0 ||
513 len > vol->usable_leb_size || len & (ubi->min_io_size - 1))
520 if (vol->upd_marker)
526 return ubi_eba_atomic_leb_change(ubi, vol, lnum, buf, len, dtype);
544 struct ubi_volume *vol = desc->vol;
545 struct ubi_device *ubi = vol->ubi;
548 dbg_gen("erase LEB %d:%d", vol->vol_id, lnum);
550 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
553 if (lnum < 0 || lnum >= vol->reserved_pebs)
556 if (vol->upd_marker)
559 err = ubi_eba_unmap_leb(ubi, vol, lnum);
605 struct ubi_volume *vol = desc->vol;
606 struct ubi_device *ubi = vol->ubi;
608 dbg_gen("unmap LEB %d:%d", vol->vol_id, lnum);
610 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
613 if (lnum < 0 || lnum >= vol->reserved_pebs)
616 if (vol->upd_marker)
619 return ubi_eba_unmap_leb(ubi, vol, lnum);
642 struct ubi_volume *vol = desc->vol;
643 struct ubi_device *ubi = vol->ubi;
645 dbg_gen("unmap LEB %d:%d", vol->vol_id, lnum);
647 if (desc->mode == UBI_READONLY || vol->vol_type == UBI_STATIC_VOLUME)
650 if (lnum < 0 || lnum >= vol->reserved_pebs)
657 if (vol->upd_marker)
660 if (vol->eba_tbl[lnum] >= 0)
663 return ubi_eba_write_leb(ubi, vol, lnum, NULL, 0, 0, dtype);
685 struct ubi_volume *vol = desc->vol;
687 dbg_gen("test LEB %d:%d", vol->vol_id, lnum);
689 if (lnum < 0 || lnum >= vol->reserved_pebs)
692 if (vol->upd_marker)
695 return vol->eba_tbl[lnum] >= 0;