Lines Matching refs:hoid

1763 static u64 hoid_get_bitwise_key(const struct ceph_hobject_id *hoid)
1765 return hoid->is_max ? 0x100000000ull : hoid->hash_reverse_bits;
1768 static void hoid_get_effective_key(const struct ceph_hobject_id *hoid,
1771 if (hoid->key_len) {
1772 *pkey = hoid->key;
1773 *pkey_len = hoid->key_len;
1775 *pkey = hoid->oid;
1776 *pkey_len = hoid->oid_len;
1845 * Assumes @hoid is zero-initialized.
1847 static int decode_hoid(void **p, void *end, struct ceph_hobject_id *hoid)
1863 hoid->key = ceph_extract_encoded_string(p, end, &hoid->key_len,
1865 if (IS_ERR(hoid->key)) {
1866 ret = PTR_ERR(hoid->key);
1867 hoid->key = NULL;
1871 hoid->oid = ceph_extract_encoded_string(p, end, &hoid->oid_len,
1873 if (IS_ERR(hoid->oid)) {
1874 ret = PTR_ERR(hoid->oid);
1875 hoid->oid = NULL;
1879 ceph_decode_64_safe(p, end, hoid->snapid, e_inval);
1880 ceph_decode_32_safe(p, end, hoid->hash, e_inval);
1881 ceph_decode_8_safe(p, end, hoid->is_max, e_inval);
1883 hoid->nspace = ceph_extract_encoded_string(p, end, &hoid->nspace_len,
1885 if (IS_ERR(hoid->nspace)) {
1886 ret = PTR_ERR(hoid->nspace);
1887 hoid->nspace = NULL;
1891 ceph_decode_64_safe(p, end, hoid->pool, e_inval);
1893 ceph_hoid_build_hash_cache(hoid);
1900 static int hoid_encoding_size(const struct ceph_hobject_id *hoid)
1903 4 + hoid->key_len + 4 + hoid->oid_len + 4 + hoid->nspace_len;
1906 static void encode_hoid(void **p, void *end, const struct ceph_hobject_id *hoid)
1908 ceph_start_encoding(p, 4, 3, hoid_encoding_size(hoid));
1909 ceph_encode_string(p, end, hoid->key, hoid->key_len);
1910 ceph_encode_string(p, end, hoid->oid, hoid->oid_len);
1911 ceph_encode_64(p, hoid->snapid);
1912 ceph_encode_32(p, hoid->hash);
1913 ceph_encode_8(p, hoid->is_max);
1914 ceph_encode_string(p, end, hoid->nspace, hoid->nspace_len);
1915 ceph_encode_64(p, hoid->pool);
1918 static void free_hoid(struct ceph_hobject_id *hoid)
1920 if (hoid) {
1921 kfree(hoid->key);
1922 kfree(hoid->oid);
1923 kfree(hoid->nspace);
1924 kfree(hoid);
1952 * Within a specific spgid, backoffs are managed by ->begin hoid.
1958 const struct ceph_hobject_id *hoid)
1967 cmp = hoid_compare(hoid, cur->begin);
1971 if (hoid_compare(hoid, cur->end) < 0)
2012 static void hoid_fill_from_target(struct ceph_hobject_id *hoid,
2015 hoid->key = NULL;
2016 hoid->key_len = 0;
2017 hoid->oid = t->target_oid.name;
2018 hoid->oid_len = t->target_oid.name_len;
2019 hoid->snapid = CEPH_NOSNAP;
2020 hoid->hash = t->pgid.seed;
2021 hoid->is_max = false;
2023 hoid->nspace = t->target_oloc.pool_ns->str;
2024 hoid->nspace_len = t->target_oloc.pool_ns->len;
2026 hoid->nspace = NULL;
2027 hoid->nspace_len = 0;
2029 hoid->pool = t->target_oloc.pool;
2030 ceph_hoid_build_hash_cache(hoid);
2038 struct ceph_hobject_id hoid;
2044 hoid_fill_from_target(&hoid, &req->r_t);
2045 backoff = lookup_containing_backoff(&spg->backoffs, &hoid);
4463 struct ceph_hobject_id hoid;
4466 hoid_fill_from_target(&hoid, t);
4467 cmp = hoid_compare(&hoid, begin);
4468 return !cmp || (cmp > 0 && hoid_compare(&hoid, end) < 0);