Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue 115: accont for CAS in item_size_ok

  • Loading branch information...
commit 911c9d0a6c9a7268358cf4bcff94c33ad012cee7 1 parent 2c56090
@trondn authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 items.c
View
9 items.c
@@ -242,8 +242,13 @@ bool item_size_ok(const size_t nkey, const int flags, const int nbytes) {
char prefix[40];
uint8_t nsuffix;
- return slabs_clsid(item_make_header(nkey + 1, flags, nbytes,
- prefix, &nsuffix)) != 0;
+ size_t ntotal = item_make_header(nkey + 1, flags, nbytes,
+ prefix, &nsuffix);
+ if (settings.use_cas) {
+ ntotal += sizeof(uint64_t);
+ }
+
+ return slabs_clsid(ntotal) != 0;
}
static void item_link_q(item *it) { /* item is the new head */
Please sign in to comment.
Something went wrong with that request. Please try again.