0016-Use-ctx-consistently-for-io_context_t-instead-of-ctx.patch 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. From e2175569737a2905d3c7a6e6ff664f0febcf5a28 Mon Sep 17 00:00:00 2001
  2. From: Guillem Jover <guillem@hadrons.org>
  3. Date: Sat, 20 Jul 2019 21:18:14 +0200
  4. Subject: [PATCH libaio 16/28] Use ctx consistently for io_context_t instead of
  5. ctx_id
  6. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  7. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
  8. ---
  9. man/io_cancel.3 | 2 +-
  10. man/io_getevents.3 | 8 ++++----
  11. man/io_queue_run.3 | 2 +-
  12. man/io_queue_wait.3 | 2 +-
  13. man/io_submit.3 | 2 +-
  14. src/compat-0_1.c | 4 ++--
  15. src/libaio.h | 4 ++--
  16. src/vsys_def.h | 2 +-
  17. 8 files changed, 13 insertions(+), 13 deletions(-)
  18. diff --git a/man/io_cancel.3 b/man/io_cancel.3
  19. index 3ca629b..8c6910e 100644
  20. --- a/man/io_cancel.3
  21. +++ b/man/io_cancel.3
  22. @@ -46,7 +46,7 @@ If any of the data structures pointed to are invalid.
  23. If
  24. .I aio_context
  25. specified by
  26. -.I ctx_id
  27. +.I ctx
  28. is invalid.
  29. .TP
  30. .B EAGAIN
  31. diff --git a/man/io_getevents.3 b/man/io_getevents.3
  32. index 6fbcc24..6ff686d 100644
  33. --- a/man/io_getevents.3
  34. +++ b/man/io_getevents.3
  35. @@ -1,7 +1,7 @@
  36. .\"/* io_getevents:
  37. .\" * Attempts to read at least min_nr events and up to nr events from
  38. -.\" * the completion queue for the aio_context specified by ctx_id. May
  39. -.\" * fail with -EINVAL if ctx_id is invalid, if min_nr is out of range,
  40. +.\" * the completion queue for the aio_context specified by ctx. May
  41. +.\" * fail with -EINVAL if ctx is invalid, if min_nr is out of range,
  42. .\" * if nr is out of range, if when is out of range. May fail with
  43. .\" * -EFAULT if any of the memory specified to is invalid. May return
  44. .\" * 0 or < min_nr if no events are available and the timeout specified
  45. @@ -10,7 +10,7 @@
  46. .\" * will be updated if not NULL and the operation blocks. Will fail
  47. .\" * with -ENOSYS if not implemented.
  48. .\" */
  49. -.\"asmlinkage long sys_io_getevents(io_context_t ctx_id,
  50. +.\"asmlinkage long sys_io_getevents(io_context_t ctx,
  51. .\" long min_nr,
  52. .\" long nr,
  53. .\" struct io_event *events,
  54. @@ -117,7 +117,7 @@ behaves the same as
  55. .TP
  56. .B EINVAL
  57. If
  58. -.I ctx_id
  59. +.I ctx
  60. is invalid, if
  61. .I min_nr
  62. is out of range, if
  63. diff --git a/man/io_queue_run.3 b/man/io_queue_run.3
  64. index 93e322b..2bb9701 100644
  65. --- a/man/io_queue_run.3
  66. +++ b/man/io_queue_run.3
  67. @@ -16,7 +16,7 @@ io_queue_run \- Handle completed io requests
  68. .BR io_queue_run ()
  69. attempts to read all the events from
  70. the completion queue for the aio_context specified by
  71. -.IR ctx_id .
  72. +.IR ctx .
  73. .SH "RETURN VALUES"
  74. May return
  75. .B 0
  76. diff --git a/man/io_queue_wait.3 b/man/io_queue_wait.3
  77. index ad5e7f4..1cf4f0b 100644
  78. --- a/man/io_queue_wait.3
  79. +++ b/man/io_queue_wait.3
  80. @@ -15,7 +15,7 @@ io_queue_wait \- Wait for io requests to complete
  81. .BR io_queue_wait ()
  82. attempts to read an event from
  83. the completion queue for the aio_context specified by
  84. -.IR ctx_id .
  85. +.IR ctx .
  86. .SH "RETURN VALUES"
  87. May return
  88. .B 0
  89. diff --git a/man/io_submit.3 b/man/io_submit.3
  90. index c0791ed..c15134f 100644
  91. --- a/man/io_submit.3
  92. +++ b/man/io_submit.3
  93. @@ -1,7 +1,7 @@
  94. .\"/* sys_io_submit:
  95. .\" * Queue the nr iocbs pointed to by iocbpp for processing. Returns
  96. .\" * the number of iocbs queued. May return -EINVAL if the aio_context
  97. -.\" * specified by ctx_id is invalid, if nr is < 0, if the iocb at
  98. +.\" * specified by ctx is invalid, if nr is < 0, if the iocb at
  99. .\" * *iocbpp[0] is not properly initialized, if the operation specified
  100. .\" * is invalid for the file descriptor in the iocb. May fail with
  101. .\" * -EFAULT if any of the data structures point to invalid data. May
  102. diff --git a/src/compat-0_1.c b/src/compat-0_1.c
  103. index 136396f..722e107 100644
  104. --- a/src/compat-0_1.c
  105. +++ b/src/compat-0_1.c
  106. @@ -49,14 +49,14 @@ int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when)
  107. /* ABI change. Provide backwards compatibility for this one. */
  108. SYMVER(compat0_1_io_getevents, io_getevents, 0.1);
  109. -int compat0_1_io_getevents(io_context_t ctx_id, long nr,
  110. +int compat0_1_io_getevents(io_context_t ctx, long nr,
  111. struct io_event *events,
  112. const struct timespec *const_timeout)
  113. {
  114. struct timespec timeout;
  115. if (const_timeout)
  116. timeout = *const_timeout;
  117. - return io_getevents(ctx_id, 1, nr, events,
  118. + return io_getevents(ctx, 1, nr, events,
  119. const_timeout ? &timeout : NULL);
  120. }
  121. diff --git a/src/libaio.h b/src/libaio.h
  122. index 2bc24e0..8b33382 100644
  123. --- a/src/libaio.h
  124. +++ b/src/libaio.h
  125. @@ -162,8 +162,8 @@ extern int io_setup(int maxevents, io_context_t *ctxp);
  126. extern int io_destroy(io_context_t ctx);
  127. extern int io_submit(io_context_t ctx, long nr, struct iocb *ios[]);
  128. extern int io_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt);
  129. -extern int io_getevents(io_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout);
  130. -extern int io_pgetevents(io_context_t ctx_id, long min_nr, long nr,
  131. +extern int io_getevents(io_context_t ctx, long min_nr, long nr, struct io_event *events, struct timespec *timeout);
  132. +extern int io_pgetevents(io_context_t ctx, long min_nr, long nr,
  133. struct io_event *events, struct timespec *timeout,
  134. sigset_t *sigmask);
  135. diff --git a/src/vsys_def.h b/src/vsys_def.h
  136. index 13d032e..dd711dc 100644
  137. --- a/src/vsys_def.h
  138. +++ b/src/vsys_def.h
  139. @@ -20,5 +20,5 @@ extern int vsys_io_destroy(io_context_t ctx);
  140. extern int vsys_io_submit(io_context_t ctx, long nr, struct iocb *iocbs[]);
  141. extern int vsys_io_cancel(io_context_t ctx, struct iocb *iocb);
  142. extern int vsys_io_wait(io_context_t ctx, struct iocb *iocb, const struct timespec *when);
  143. -extern int vsys_io_getevents(io_context_t ctx_id, long nr, struct io_event *events, const struct timespec *timeout);
  144. +extern int vsys_io_getevents(io_context_t ctx, long nr, struct io_event *events, const struct timespec *timeout);
  145. --
  146. 2.26.0.292.g33ef6b2f38