Lines Matching defs:cpos
63 u32 cpos, u32 old_cluster,
878 u64 cpos, unsigned int len,
891 le32_to_cpu(rec->r_clusters) <= cpos)
893 else if (le64_to_cpu(rec->r_cpos) > cpos)
896 /* ok, cpos fail in this rec. Just return. */
904 ret_rec->r_cpos = cpu_to_le64(cpos);
907 le64_to_cpu(rec->r_cpos) < cpos + len)
909 cpu_to_le32(le64_to_cpu(rec->r_cpos) - cpos);
965 u32 cpos;
983 * We are the last extent rec, so any high cpos should
1005 cpos = le32_to_cpu(eb->h_list.l_recs[index].e_cpos);
1006 ret = ocfs2_find_path(ci, left_path, cpos);
1019 ret = ocfs2_find_cpos_for_right_leaf(sb, left_path, &cpos);
1025 ret = ocfs2_find_path(ci, right_path, cpos);
1052 * Given a cpos and len, try to find the refcount record which contains cpos.
1053 * 1. If cpos can be found in one refcount record, return the record.
1054 * 2. If cpos can't be found, return a fake record which start from cpos
1055 * and end at a small value between cpos+len and start of the next record.
1060 u64 cpos, unsigned int len,
1076 ocfs2_find_refcount_rec_in_rl(ci, ref_root_bh, cpos, len,
1084 low_cpos = cpos & OCFS2_32BIT_POS_MASK;
1134 ocfs2_find_refcount_rec_in_rl(ci, ref_leaf_bh, cpos, len,
1405 * The refcount cpos are ordered by their 64bit cpos,
1409 * Note: The refcount block is already sorted by their low 32 bit cpos,
1453 u32 cpos = 0;
1467 * If we know all the high 32 bit cpos is the same, no need to sort.
1470 * 1. sort the entries by their low 32 bit cpos first so that we can
1471 * find the split cpos easily.
1474 * 4. sort the entries by their 64 bit cpos.
1481 ret = ocfs2_find_refcount_split_pos(rl, &cpos, &split_index);
1487 new_rb->rf_cpos = cpu_to_le32(cpos);
1510 *split_cpos = cpos;
1599 /* Insert the new leaf block with the specific offset cpos. */
1753 u64 cpos = le64_to_cpu(rec->r_cpos);
1764 cpos, len, NULL, &index,
1880 u64 cpos = le64_to_cpu(orig_rec->r_cpos);
1890 * We have to re-get it since now cpos may be moved to
1894 cpos, len, &tmp_rec, &index,
1983 u64 cpos, u32 len, int merge,
1994 (unsigned long long)cpos, len);
1998 cpos, len, &rec, &index,
2017 if (rec.r_refcount && le64_to_cpu(rec.r_cpos) == cpos &&
2020 (unsigned long long)cpos, set_len,
2044 set_len = min((u64)(cpos + len),
2045 le64_to_cpu(rec.r_cpos) + set_len) - cpos;
2046 rec.r_cpos = cpu_to_le64(cpos);
2063 cpos += set_len;
2157 u64 cpos, u32 len,
2162 cpos, len, 1,
2170 int index, u64 cpos, unsigned int len,
2179 BUG_ON(cpos < le64_to_cpu(rec->r_cpos));
2180 BUG_ON(cpos + len >
2185 (unsigned long long)cpos, len);
2187 if (cpos == le64_to_cpu(rec->r_cpos) &&
2193 split.r_cpos = cpu_to_le64(cpos);
2225 u64 cpos, u32 len,
2238 (unsigned long long)cpos, len, delete);
2242 cpos, len, &rec, &index,
2254 r_len = min((u64)(cpos + len), le64_to_cpu(rec.r_cpos) +
2255 le32_to_cpu(rec.r_clusters)) - cpos;
2259 cpos, r_len,
2268 ocfs2_clusters_to_blocks(sb, cpos),
2276 cpos += r_len;
2289 handle_t *handle, u32 cpos, u32 len,
2321 cpos, len, meta_ac, dealloc, delete);
2330 * Mark the already-existing extent at cpos as refcounted for len clusters.
2340 handle_t *handle, u32 cpos,
2348 cpos, len, phys);
2356 ret = ocfs2_change_extent_flag(handle, et, cpos,
2379 u64 cpos = start_cpos;
2387 cpos, clusters, &rec,
2417 recs_add, (unsigned long long)cpos, clusters,
2422 len = min((u64)cpos + clusters, le64_to_cpu(rec.r_cpos) +
2423 le32_to_cpu(rec.r_clusters)) - cpos;
2446 if (cpos == start_cpos &&
2447 cpos != le64_to_cpu(rec.r_cpos))
2451 if (cpos + clusters < le64_to_cpu(rec.r_cpos) +
2460 cpos += len;
2585 * Given an extent that starts at 'start' and an I/O that starts at 'cpos',
2586 * find an offset (start + (n * contig_clusters)) that is closest to cpos
2593 unsigned int cpos)
2595 BUG_ON(start > cpos);
2597 return start + ((cpos - start) & ocfs2_cow_contig_mask(sb));
2621 * cpos is vitual start cluster position we want to do CoW in a
2625 * Normal we will start CoW from the beginning of extent record cotaining cpos.
2631 u32 cpos,
2646 BUG_ON(cpos + write_len > max_cpos);
2649 ret = ocfs2_find_leaf(INODE_CACHE(inode), el, cpos, &eb_bh);
2678 le16_to_cpu(rec->e_leaf_clusters) <= cpos)
2715 want_clusters = (cpos + write_len) -
2730 else if (*cow_len || (*cow_start == cpos)) {
2746 (cpos + write_len)) {
2753 } else if ((rec_end - cpos) <= contig_clusters) {
2756 * this extent will cover cpos.
2760 } else if ((rec_end - cpos) <= want_clusters) {
2763 * extent, we know that the write goes from cpos
2767 * Failing that (ie, cpos is within
2772 *cow_start, cpos);
2784 *cow_start, cpos);
2786 want_clusters = (cpos + write_len) - *cow_start;
2796 if ((*cow_start + *cow_len) >= (cpos + write_len))
2907 u32 cpos, u32 old_cluster,
2919 trace_ocfs2_duplicate_clusters_by_page(cpos, old_cluster,
2922 offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits;
3002 u32 cpos, u32 old_cluster,
3015 trace_ocfs2_duplicate_clusters_by_page(cpos, old_cluster,
3057 u32 cpos, u32 p_cluster, u32 len,
3070 cpos, len, p_cluster, ext_flags);
3073 replace_rec.e_cpos = cpu_to_le32(cpos);
3087 ret = ocfs2_find_path(et->et_ci, path, cpos);
3095 index = ocfs2_search_extent_list(el, cpos);
3098 "Inode %llu has an extent at cpos %u which can no longer be found\n",
3099 (unsigned long long)ino, cpos);
3115 u32 cpos, u32 old,
3124 cpos, old, new, len, ext_flags);
3129 cpos, old, new, len);
3137 cpos, new, len, ext_flags,
3147 u32 cpos, u32 num_clusters)
3157 offset = ((loff_t)cpos) << OCFS2_SB(sb)->s_clustersize_bits;
3206 u32 cpos, u32 p_cluster,
3218 trace_ocfs2_make_clusters_writable(cpos, p_cluster,
3270 cpos, p_cluster,
3291 cpos, p_cluster, new_bit,
3310 cpos += set_len;
3332 ret = ocfs2_cow_sync_writeback(sb, context->inode, cpos,
3405 * Starting at cpos, try to CoW write_len clusters. Don't CoW
3411 u32 cpos, u32 write_len, u32 max_cpos)
3424 cpos, write_len, max_cpos,
3432 cpos, write_len, max_cpos,
3481 * CoW any and all clusters between cpos and cpos+write_len.
3483 * clusters between cpos and cpos+write_len are safe to modify.
3487 u32 cpos, u32 write_len, u32 max_cpos)
3494 ret = ocfs2_get_clusters(inode, cpos, &p_cluster,
3505 ret = ocfs2_refcount_cow_hunk(inode, di_bh, cpos,
3514 cpos += num_clusters;
3545 u32 cpos = 0, clusters = le32_to_cpu(xv->xr_clusters);
3550 while (cpos < clusters) {
3551 ret = ocfs2_xattr_get_clusters(inode, cpos, &p_cluster,
3559 cpos += num_clusters;
3626 u32 cpos, u32 write_len,
3637 cpos, write_len, UINT_MAX,
3687 u32 cpos, u32 p_cluster, u32 num_clusters,
3731 cpos, num_clusters, p_cluster,
3805 u32 cpos, num_clusters, clusters, p_cluster;
3836 cpos = 0;
3837 while (cpos < clusters) {
3838 ret = ocfs2_get_clusters(inode, cpos, &p_cluster,
3847 ref_root_bh, cpos,
3857 cpos += num_clusters;
3900 u32 cpos, u32 p_cluster, u32 num_clusters,
3927 ret = ocfs2_insert_extent(handle, et, cpos,
4007 u32 p_cluster, num_clusters, clusters, cpos;
4017 cpos = 0;
4018 while (cpos < clusters) {
4019 ret = ocfs2_get_clusters(s_inode, cpos, &p_cluster,
4028 cpos, p_cluster,
4038 cpos += num_clusters;