History

block: move rq_list macros to blk-mq.h

Move the request list macros to the header file that defines that struct they operate on.

Keith Busch committed 4 years ago

Commit edce22e1 parent 669a0643 files · +30 −30Browse files

Showing the changes to include/linux/blkdev.h (1 of 3 files). Show all

Unified · Split

include/linux/blkdev.h+0−29
@@ -1339,33 +1339,4 @@ struct io_comp_batch { · 1338 unmodified lines
1339 1339
1340#define DEFINE_IO_COMP_BATCH(name) struct io_comp_batch name = { }1340#define DEFINE_IO_COMP_BATCH(name) struct io_comp_batch name = { }
1341 1341
1342#define rq_list_add(listptr, rq) do { \
1343 (rq)->rq_next = *(listptr); \
1344 *(listptr) = rq; \
1345} while (0)
1346
1347#define rq_list_pop(listptr) \
1348({ \
1349 struct request *__req = NULL; \
1350 if ((listptr) && *(listptr)) { \
1351 __req = *(listptr); \
1352 *(listptr) = __req->rq_next; \
1353 } \
1354 __req; \
1355})
1356
1357#define rq_list_peek(listptr) \
1358({ \
1359 struct request *__req = NULL; \
1360 if ((listptr) && *(listptr)) \
1361 __req = *(listptr); \
1362 __req; \
1363})
1364
1365#define rq_list_for_each(listptr, pos) \
1366 for (pos = rq_list_peek((listptr)); pos; pos = rq_list_next(pos))
1367
1368#define rq_list_next(rq) (rq)->rq_next
1369#define rq_list_empty(list) ((list) == (struct request *) NULL)
1370
1371#endif /* _LINUX_BLKDEV_H */1342#endif /* _LINUX_BLKDEV_H */