X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=blob.c;h=5ac35895bc57a34a11201afdd9bb99e998ef595f;hp=dbabba224ded1d96e8d8175b42181d3221df6e52;hb=b2e6a24448a9e49e0766ab4f32163580eeff469e;hpb=09b7971c7a862924d4ce669f8a33bda567ba570b diff --git a/blob.c b/blob.c index dbabba22..5ac35895 100644 --- a/blob.c +++ b/blob.c @@ -14,6 +14,29 @@ #include "afs.h" #include "net.h" #include "ipc.h" +#include "portable_io.h" + +/** + * Compare two osl objects pointing to unsigned integers of 32 bit size. + * + * \param obj1 Pointer to the first integer. + * \param obj2 Pointer to the second integer. + * + * \return The values required for an osl compare function. + * + * \sa osl_compare_func, osl_hash_compare(). + */ +static int uint32_compare(const struct osl_object *obj1, const struct osl_object *obj2) +{ + uint32_t d1 = read_u32((const char *)obj1->data); + uint32_t d2 = read_u32((const char *)obj2->data); + + if (d1 < d2) + return 1; + if (d1 > d2) + return -1; + return 0; +} static struct osl_column_description blob_cols[] = { [BLOBCOL_ID] = { @@ -287,7 +310,7 @@ static void com_addblob_callback(struct osl_table *table, __a_unused int fd, struct osl_row *row; struct osl_object obj = {.data = name, .size = name_len}; ret = osl_get_row(table, BLOBCOL_NAME, &obj, &row); - if (ret < 0 && ret != -E_RB_KEY_NOT_FOUND) + if (ret < 0 && ret != -E_OSL_RB_KEY_NOT_FOUND) goto out; if (ret >= 0) { /* we already have a blob with this name */ obj.data = name + name_len;