Lines Matching refs:hoid
1683 static u64 hoid_get_bitwise_key(const struct ceph_hobject_id *hoid)
1685 return hoid->is_max ? 0x100000000ull : hoid->hash_reverse_bits;
1688 static void hoid_get_effective_key(const struct ceph_hobject_id *hoid,
1691 if (hoid->key_len) {
1692 *pkey = hoid->key;
1693 *pkey_len = hoid->key_len;
1695 *pkey = hoid->oid;
1696 *pkey_len = hoid->oid_len;
1765 * Assumes @hoid is zero-initialized.
1767 static int decode_hoid(void **p, void *end, struct ceph_hobject_id *hoid)
1783 hoid->key = ceph_extract_encoded_string(p, end, &hoid->key_len,
1785 if (IS_ERR(hoid->key)) {
1786 ret = PTR_ERR(hoid->key);
1787 hoid->key = NULL;
1791 hoid->oid = ceph_extract_encoded_string(p, end, &hoid->oid_len,
1793 if (IS_ERR(hoid->oid)) {
1794 ret = PTR_ERR(hoid->oid);
1795 hoid->oid = NULL;
1799 ceph_decode_64_safe(p, end, hoid->snapid, e_inval);
1800 ceph_decode_32_safe(p, end, hoid->hash, e_inval);
1801 ceph_decode_8_safe(p, end, hoid->is_max, e_inval);
1803 hoid->nspace = ceph_extract_encoded_string(p, end, &hoid->nspace_len,
1805 if (IS_ERR(hoid->nspace)) {
1806 ret = PTR_ERR(hoid->nspace);
1807 hoid->nspace = NULL;
1811 ceph_decode_64_safe(p, end, hoid->pool, e_inval);
1813 ceph_hoid_build_hash_cache(hoid);
1820 static int hoid_encoding_size(const struct ceph_hobject_id *hoid)
1823 4 + hoid->key_len + 4 + hoid->oid_len + 4 + hoid->nspace_len;
1826 static void encode_hoid(void **p, void *end, const struct ceph_hobject_id *hoid)
1828 ceph_start_encoding(p, 4, 3, hoid_encoding_size(hoid));
1829 ceph_encode_string(p, end, hoid->key, hoid->key_len);
1830 ceph_encode_string(p, end, hoid->oid, hoid->oid_len);
1831 ceph_encode_64(p, hoid->snapid);
1832 ceph_encode_32(p, hoid->hash);
1833 ceph_encode_8(p, hoid->is_max);
1834 ceph_encode_string(p, end, hoid->nspace, hoid->nspace_len);
1835 ceph_encode_64(p, hoid->pool);
1838 static void free_hoid(struct ceph_hobject_id *hoid)
1840 if (hoid) {
1841 kfree(hoid->key);
1842 kfree(hoid->oid);
1843 kfree(hoid->nspace);
1844 kfree(hoid);
1872 * Within a specific spgid, backoffs are managed by ->begin hoid.
1878 const struct ceph_hobject_id *hoid)
1887 cmp = hoid_compare(hoid, cur->begin);
1891 if (hoid_compare(hoid, cur->end) < 0)
1932 static void hoid_fill_from_target(struct ceph_hobject_id *hoid,
1935 hoid->key = NULL;
1936 hoid->key_len = 0;
1937 hoid->oid = t->target_oid.name;
1938 hoid->oid_len = t->target_oid.name_len;
1939 hoid->snapid = CEPH_NOSNAP;
1940 hoid->hash = t->pgid.seed;
1941 hoid->is_max = false;
1943 hoid->nspace = t->target_oloc.pool_ns->str;
1944 hoid->nspace_len = t->target_oloc.pool_ns->len;
1946 hoid->nspace = NULL;
1947 hoid->nspace_len = 0;
1949 hoid->pool = t->target_oloc.pool;
1950 ceph_hoid_build_hash_cache(hoid);
1958 struct ceph_hobject_id hoid;
1964 hoid_fill_from_target(&hoid, &req->r_t);
1965 backoff = lookup_containing_backoff(&spg->backoffs, &hoid);
4373 struct ceph_hobject_id hoid;
4376 hoid_fill_from_target(&hoid, t);
4377 cmp = hoid_compare(&hoid, begin);
4378 return !cmp || (cmp > 0 && hoid_compare(&hoid, end) < 0);