Lines Matching defs:chunk

81  * "chunks" should be considered for copy-on-write (a chunk is the unit of
86 * If a chunk has no allocated blocks, it does not need to be copied before
96 * described above, and the "hastrans bitmap" which tells it whether the chunk
97 * has been copied already or not. If the chunk is a candidate but has not
100 * task queue is dispatched for each old chunk read in which writes the old
111 * information to satisfy read requests. If the requested chunk is not a
112 * candidate, it returns a zeroed buffer. If the chunk is a candidate but
165 static int snap_getchunk(struct snapshot_id *sidp, chunknumber_t chunk,
652 * cycles through each chunk in the requested buffer and calls
653 * snap_getchunk() on each chunk to retrieve it from the appropriate
662 chunknumber_t chunk;
710 /* chunk is the chunk containing reqptr */
711 /* len is the length of the request (in the current chunk) in bytes */
712 /* off is the byte offset into the current chunk */
715 chunk = dbtocowchunk(&sidp->sid_cowinfo->cow_map, reqptr);
720 if ((error = snap_getchunk(sidp, chunk, off, len, buf)) != 0) {
728 "calling snap_getchunk, chunk = %llu, "
731 chunk, off, len, bp->b_resid, error);
754 * buffer. chunk is the chunk number of the request, offset is the
755 * offset into that chunk and must be less than the chunk size. len is
757 * chunk boundary. buffer is the address to copy the data to. len
760 * A chunk is located according to the following algorithm:
761 * - If the chunk does not have a translation or is not a candidate
763 * - If the chunk does have a translation, then it is either on
772 snap_getchunk(struct snapshot_id *sidp, chunknumber_t chunk, int offset,
787 * Check if the chunk number is out of range and if so bail out
789 if (chunk >= (cmap->cmap_bmsize * NBBY)) {
794 * If the chunk is not a candidate for translation, then the chunk
799 if (isclr(cmap->cmap_candidate, chunk)) {
805 * if the chunk is a candidate for translation but a
814 if (isclr(cmap->cmap_hastrans, chunk)) {
827 snapbuf->b_lblkno = lbtodb(chunk * cmap->cmap_chunksz + offset);
875 * finally, if the chunk is a candidate for translation and it
876 * has been translated, then we clone the chunk of the buffer
879 * data has already been copied. Once a chunk has been copied
882 cmn = transtbl_get(cmap, chunk);
900 bf_index = chunk / cmap->cmap_chunksperbf;
905 buffer, len, ((chunk % cmap->cmap_chunksperbf) *
1189 transtbl_add(cow_map_t *cmap, chunknumber_t chunk, caddr_t buf)
1201 cmnode->cmn_chunk = chunk;
1216 * The lookup is done by the chunk number, and the node is returned.
1220 transtbl_get(cow_map_t *cmap, chunknumber_t chunk)
1229 if (cmn->cmn_chunk == chunk)
1430 * action is necessary. If the candidate bitmap indicates the chunk was
1433 * action is required. If the chunk is a candidate for copy-on-write,
1434 * and a translation does not already exist, then the chunk is read in
1481 * For each chunk in the range, the following sequence is performed:
1482 * - Is the chunk a candidate for translation?
1517 * If no disk blocks were allocated in this chunk when the
1572 continue; /* go to the next chunk */
1576 * read a full chunk of data from the requested offset rounded
1577 * down to the nearest chunk size.
1599 "old data for snapshot %d, chunk %llu, disk block "
1865 * allocate one bit per chunk for the bitmaps, round up
1889 * fssnap_set_candidate_impl() - mark a chunk as a candidate for copy-on-write
1891 * sets a bit in the candidate bitmap that indicates that a chunk is a
1910 * fssnap_is_candidate_impl() - check whether a chunk is a candidate
1912 * returns 0 if the chunk is not a candidate and 1 if the chunk is a
1915 * bytes since the chunk size may not be known by the file system.