• 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:to

15  * along with this program; if not, write to the Free Software
24 * This unit is responsible for I/O to/from logical eraseblock.
38 * time a logical eraseblock is mapped to a physical eraseblock and it is
41 * 64 bits is enough to never overflow.
55 * @mutex: read/write mutex to implement read/write access serialization to
59 * object is inserted to the lock tree (@ubi->ltree).
76 * This function returns next sequence number to use, which is just the current
112 * This function returns a pointer to the corresponding &struct ltree_entry
114 * @ubi->ltree_lock has to be locked.
145 * ltree_add_entry - add new entry to the lock tree.
150 * This function adds new entry for logical eraseblock (@vol_id, @lnum) to the
152 * Returns pointer to the lock tree entry or %-ENOMEM if memory allocation
181 * No lock entry, add the newly allocated one to the
351 * @buf: buffer to store the read data
352 * @offset: offset from where to read
353 * @len: how many bytes to read
382 * it is an error to read unmapped logical eraseblocks.
471 * @pnum: the physical eraseblock to recover
479 * from the potentially bad physical eraseblock to a good physical eraseblock.
480 * This function also writes the data which was not written due to the failure.
504 ubi_msg("recover PEB %d, move data to PEB %d", pnum, new_pnum);
559 * Bad luck? This physical eraseblock is bad too? Crud. Let's try to
562 ubi_warn("failed to write to PEB %d", new_pnum);
573 * ubi_eba_write_leb - write data to dynamic volume.
577 * @buf: the data to write
578 * @offset: offset within the logical eraseblock where to write
579 * @len: how many bytes to write
582 * This function writes data to logical eraseblock @lnum of a dynamic volume
585 * written to the flash media, but may be some garbage.
608 ubi_warn("failed to write data to PEB %d", pnum);
619 * The logical eraseblock is not mapped. We have to get a free physical
648 ubi_warn("failed to write VID header to LEB %d:%d, PEB %d",
655 ubi_warn("failed to write %d bytes at offset %d of LEB %d:%d, "
675 * Fortunately, this is the first write operation to this physical
693 * ubi_eba_write_leb_st - write data to static volume.
697 * @buf: data to write
698 * @len: how many bytes to write
702 * This function writes data to logical eraseblock @lnum of static volume
706 * When writing to the last logical eraseblock, the @len argument doesn't have
707 * to be aligned to the minimal I/O unit size. Instead, it has to be equivalent
708 * to the real data size, although the @buf buffer has to contain the
709 * alignment. In all other cases, @len has to be aligned.
711 * It is prohibited to write more then once to logical eraseblocks of static
768 ubi_warn("failed to write VID header to LEB %d:%d, PEB %d",
775 ubi_warn("failed to write %d bytes of data to PEB %d",
791 * something nasty and unexpected happened. Switch to read-only
818 * @buf: data to write
819 * @len: how many bytes to write
823 * has to contain new logical eraseblock data, and @len - the length of the
824 * data, which has to be aligned. This function guarantees that in case of an
869 dbg_eba("change LEB %d:%d, PEB %d, write VID hdr to PEB %d",
874 ubi_warn("failed to write VID header to LEB %d:%d, PEB %d",
881 ubi_warn("failed to write %d bytes of data to PEB %d",
902 * something nasty and unexpected happened. Switch to read-only
926 * @obj: the lock-tree entry to construct
942 * @from: physical eraseblock number from where to copy
943 * @to: physical eraseblock number where to copy
946 * This function copies logical eraseblock from physical eraseblock @from to
947 * physical eraseblock @to. The @vid_hdr buffer may be changed by this
952 int ubi_eba_copy_leb(struct ubi_device *ubi, int from, int to,
963 dbg_eba("copy LEB %d:%d, PEB %d to PEB %d", vol_id, lnum, from, to);
977 * We do not want anybody to write to this logical eraseblock while we
993 * We may race with volume deletion/re-size, so we have to hold
1006 dbg_eba("LEB %d:%d is no longer mapped to PEB %d, mapped to "
1024 * Now we have got to calculate how much data we have to to copy. In
1027 * have to read the contents, cut 0xFF bytes from the end and copy only
1028 * the first part. We must do this to avoid writing 0xFF bytes as it
1030 * to include those 0xFFs to CRC because later the they may be filled
1042 * It may turn out to me that the whole @from physical eraseblock
1043 * contains only 0xFF bytes. Then we have to only write the VID header
1054 err = ubi_io_write_vid_hdr(ubi, to, vid_hdr);
1061 err = ubi_io_read_vid_hdr(ubi, to, vid_hdr, 1);
1064 ubi_warn("cannot read VID header back from PEB %d", to);
1069 err = ubi_io_write_data(ubi, buf, to, 0, aldata_size);
1074 * We've written the data and are going to read it back to make
1085 err = ubi_io_read_data(ubi, buf1, to, 0, aldata_size);
1089 to);
1097 to);
1103 vol->eba_tbl[lnum] = to;