{
unsigned long *bm;
- OBD_ALLOC(bm, BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) * sizeof(long));
+ OBD_ALLOC_LARGE(bm, BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) *
+ sizeof(long));
if (bm == NULL)
return -ENOMEM;
if (lut->lut_reply_bitmap[chunk] != NULL) {
/* someone else already allocated the bitmap for this chunk */
spin_unlock(&lut->lut_client_bitmap_lock);
- OBD_FREE(bm, BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) *
+ OBD_FREE_LARGE(bm, BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) *
sizeof(long));
return 0;
}
LASSERT(chunk < LUT_REPLY_SLOTS_MAX_CHUNKS);
LASSERT(b < LUT_REPLY_SLOTS_PER_CHUNK);
+ if (lut->lut_reply_bitmap[chunk] == NULL) {
+ CERROR("%s: slot %d not allocated\n",
+ tgt_name(lut), idx);
+ return -ENOENT;
+ }
+
if (test_and_clear_bit(b, lut->lut_reply_bitmap[chunk]) == 0) {
CERROR("%s: slot %d already clear in bitmap\n",
tgt_name(lut), idx);
/* create in-memory reply_data and link it to
* target export's reply list */
- tgt_set_reply_slot(tgt, idx);
+ rc = tgt_set_reply_slot(tgt, idx);
+ if (rc != 0) {
+ mutex_unlock(&ted->ted_lcd_lock);
+ GOTO(out, rc);
+ }
trd->trd_reply = *lrd;
trd->trd_pre_versions[0] = 0;
trd->trd_pre_versions[1] = 0;
struct lu_attr attr;
struct lu_fid fid;
struct dt_object *o;
- int rc = 0;
+ int i, rc = 0;
ENTRY;
if (lut->lut_reply_data != NULL)
lu_object_put(env, &lut->lut_reply_data->do_lu);
lut->lut_reply_data = NULL;
- if (lut->lut_reply_bitmap != NULL)
+ if (lut->lut_reply_bitmap != NULL) {
+ for (i = 0; i < LUT_REPLY_SLOTS_MAX_CHUNKS; i++) {
+ if (lut->lut_reply_bitmap[i] != NULL)
+ OBD_FREE_LARGE(lut->lut_reply_bitmap[i],
+ BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) *
+ sizeof(long));
+ lut->lut_reply_bitmap[i] = NULL;
+ }
OBD_FREE(lut->lut_reply_bitmap,
LUT_REPLY_SLOTS_MAX_CHUNKS * sizeof(unsigned long *));
+ }
lut->lut_reply_bitmap = NULL;
return rc;
}
if (lut->lut_reply_bitmap != NULL) {
for (i = 0; i < LUT_REPLY_SLOTS_MAX_CHUNKS; i++) {
if (lut->lut_reply_bitmap[i] != NULL)
- OBD_FREE(lut->lut_reply_bitmap[i],
+ OBD_FREE_LARGE(lut->lut_reply_bitmap[i],
BITS_TO_LONGS(LUT_REPLY_SLOTS_PER_CHUNK) *
sizeof(long));
lut->lut_reply_bitmap[i] = NULL;