X-Git-Url: https://code.grnet.gr/git/archipelago/blobdiff_plain/abaea13488bf437254a91e57debd5829307e0c81..37758262535f1b2704668689192ba665637c25aa:/xseg/peers/user/sosd.c diff --git a/xseg/peers/user/sosd.c b/xseg/peers/user/sosd.c index 657de1a..293f211 100644 --- a/xseg/peers/user/sosd.c +++ b/xseg/peers/user/sosd.c @@ -88,8 +88,8 @@ static int wait_signal(struct store *store) static struct io *alloc_io(struct store *store) { - xqindex idx = xq_pop_head(&store->free_ops); - if (idx == None) + xqindex idx = xq_pop_head(&store->free_ops, 1); + if (idx == Noneidx) return NULL; return store->ios + idx; } @@ -98,7 +98,7 @@ static inline void free_io(struct store *store, struct io *io) { xqindex idx = io - store->ios; io->req = NULL; - xq_append_head(&store->free_ops, idx); + xq_append_head(&store->free_ops, idx, 1); /* not the right place. sosd_loop couldn't sleep because of that * needed for flush support. maybe this should go to complete function * @@ -109,13 +109,13 @@ static inline void free_io(struct store *store, struct io *io) static void resubmit_io(struct store *store, struct io *io) { xqindex idx = io - store->ios; - xq_append_tail(&store->resubmit_ops, idx); + xq_append_tail(&store->resubmit_ops, idx, 1); } static struct io* get_resubmitted_io(struct store *store) { - xqindex idx = xq_pop_head(&store->resubmit_ops); - if (idx == None) + xqindex idx = xq_pop_head(&store->resubmit_ops, 1); + if (idx == Noneidx) return NULL; return store->ios + idx; }