Skip to content

Commit

Permalink
CP-18025: Use BSD compliant list.h
Browse files Browse the repository at this point in the history
Signed-off-by: Chandrika Srinivasan <[email protected]>
Reviewed-by: Robert Breker <[email protected]>
  • Loading branch information
chandrikas committed Aug 2, 2016
1 parent 580c8c6 commit 4f9ce79
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 124 deletions.
2 changes: 1 addition & 1 deletion drivers/block-lcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static void
__lcache_write_cb(td_vbd_request_t *vreq, int error,
void *token, int final)
{
td_lcache_req_t *req = containerof(vreq, td_lcache_req_t, vreq);
td_lcache_req_t *req = container_of(vreq, td_lcache_req_t, vreq);
td_lcache_t *cache = token;

if (error == -ENOSPC)
Expand Down
8 changes: 4 additions & 4 deletions drivers/block-llcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ __llpcache_write_cb(td_vbd_request_t *vreq, int error,
td_llpcache_req_t *req;
int mask;

lvr = containerof(vreq, struct llpcache_vreq, vreq);
req = containerof(lvr, td_llpcache_req_t, lvr[lvr->target]);
lvr = container_of(vreq, struct llpcache_vreq, vreq);
req = container_of(lvr, td_llpcache_req_t, lvr[lvr->target]);

mask = 1U << lvr->target;
BUG_ON(!(req->pending & mask))

if (lvr->target == LOCAL && error == -ENOSPC) {
td_image_t *shared =
containerof(req->treq.image->next.next,
container_of(req->treq.image->next.next,
td_image_t, next);
ll_log_switch(DISK_TYPE_LLPCACHE, error,
s->local, shared);
Expand Down Expand Up @@ -286,7 +286,7 @@ llpcache_forward_write(td_llpcache_t *s, td_request_t treq)
const td_vbd_request_t *vreq = treq.vreq;
struct llpcache_vreq *lvr;

lvr = containerof(vreq, struct llpcache_vreq, vreq);
lvr = container_of(vreq, struct llpcache_vreq, vreq);

switch (lvr->target) {
case SHARED:
Expand Down
2 changes: 1 addition & 1 deletion drivers/tapdisk-blktap.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ static void
__tapdisk_blktap_request_cb(td_vbd_request_t *vreq, int error,
void *token, int final)
{
td_blktap_req_t *req = containerof(vreq, td_blktap_req_t, vreq);
td_blktap_req_t *req = container_of(vreq, td_blktap_req_t, vreq);
td_blktap_t *tap = token;

tapdisk_blktap_complete_request(tap, req, error, final);
Expand Down
2 changes: 1 addition & 1 deletion drivers/tapdisk-nbdserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ __tapdisk_nbdserver_request_cb(td_vbd_request_t *vreq, int error,
{
td_nbdserver_client_t *client = token;
td_nbdserver_t *server = client->server;
td_nbdserver_req_t *req = containerof(vreq, td_nbdserver_req_t, vreq);
td_nbdserver_req_t *req = container_of(vreq, td_nbdserver_req_t, vreq);
unsigned long long interval;
struct timeval now;
struct nbd_reply reply;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tapdisk-stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ static void
__tapdisk_stream_request_cb(td_vbd_request_t *vreq, int error,
void *token, int final)
{
td_stream_req_t *req = containerof(vreq, td_stream_req_t, vreq);
td_stream_req_t *req = container_of(vreq, td_stream_req_t, vreq);
td_stream_t *s = token;

tapdisk_stream_complete_request(s, req, error, final);
Expand Down
2 changes: 1 addition & 1 deletion drivers/td-ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

#define ERROR(_f, _a...) tlog_syslog(TLOG_WARN, "td-ctx: " _f, ##_a)

LIST_HEAD(_td_xenio_ctxs);
struct list_head _td_xenio_ctxs = LIST_HEAD_INIT(_td_xenio_ctxs);

/**
* TODO releases a pool?
Expand Down
2 changes: 1 addition & 1 deletion drivers/td-req.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ __tapdisk_xenblkif_request_cb(struct td_vbd_request * const vreq,
ASSERT(vreq);
ASSERT(blkif);

tapreq = containerof(vreq, struct td_xenblkif_req, vreq);
tapreq = container_of(vreq, struct td_xenblkif_req, vreq);

if (error) {
if (likely(!blkif->dead)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/td-req.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,6 @@ tapdisk_xenblkif_complete_request(struct td_xenblkif * const blkif,
struct td_xenblkif_req* tapreq, int err, const int final);

#define msg_to_tapreq(_req) \
containerof(_req, struct td_xenblkif_req, msg)
container_of(_req, struct td_xenblkif_req, msg)

#endif /* __TD_REQ_H__ */
Loading

0 comments on commit 4f9ce79

Please sign in to comment.