diff mbox series

[5/7] lib: replace aiocb_t with struct aiocb

Message ID 20250206212145.7732-6-sandeen@redhat.com (mailing list archive)
State New
Headers show
Series fstests: enable sparse checking & fix fallout | expand

Commit Message

Eric Sandeen Feb. 6, 2025, 9:20 p.m. UTC
aiocb_t isn't defined anywhere, use struct aiocb instead,
to make sparse happy.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 lib/tlibio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Darrick J. Wong Feb. 6, 2025, 10:46 p.m. UTC | #1
On Thu, Feb 06, 2025 at 03:20:00PM -0600, Eric Sandeen wrote:
> aiocb_t isn't defined anywhere, use struct aiocb instead,
> to make sparse happy.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

libaio<shudder>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/tlibio.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 19192b38..22ff1adc 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -42,6 +42,7 @@
>   *
>   */
>  
> +#include <aio.h>
>  #include <stdio.h>
>  #include <ctype.h>
>  #include <fcntl.h>
> @@ -810,7 +811,7 @@ lio_read_buffer(
>   * (rrl 04/96)
>   ***********************************************************************/
>  int
> -lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method)
> +lio_check_asyncio(char *io_type, int size, const struct aiocb *aiocbp, int method)
>  {
>      int ret;
>      int cnt = 1;
> @@ -895,9 +896,10 @@ lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method)
>   * (rrl 04/96)
>   ***********************************************************************/
>  int
> -lio_wait4asyncio(int method, int fd, aiocb_t *aiocbp)
> +lio_wait4asyncio(int method, int fd, const struct aiocb *aiocbp)
>  {
> -    int cnt;
> +    struct aiocb *const aioary[1];
> +    int cnt, ret;
>  
>      if ( (method & LIO_WAIT_RECALL)
>  	|| ((method & LIO_WAIT_TYPES) == 0) ){
> -- 
> 2.48.0
> 
>
Christoph Hellwig Feb. 7, 2025, 5 a.m. UTC | #2
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
diff mbox series

Patch

diff --git a/lib/tlibio.c b/lib/tlibio.c
index 19192b38..22ff1adc 100644
--- a/lib/tlibio.c
+++ b/lib/tlibio.c
@@ -42,6 +42,7 @@ 
  *
  */
 
+#include <aio.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <fcntl.h>
@@ -810,7 +811,7 @@  lio_read_buffer(
  * (rrl 04/96)
  ***********************************************************************/
 int
-lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method)
+lio_check_asyncio(char *io_type, int size, const struct aiocb *aiocbp, int method)
 {
     int ret;
     int cnt = 1;
@@ -895,9 +896,10 @@  lio_check_asyncio(char *io_type, int size, aiocb_t *aiocbp, int method)
  * (rrl 04/96)
  ***********************************************************************/
 int
-lio_wait4asyncio(int method, int fd, aiocb_t *aiocbp)
+lio_wait4asyncio(int method, int fd, const struct aiocb *aiocbp)
 {
-    int cnt;
+    struct aiocb *const aioary[1];
+    int cnt, ret;
 
     if ( (method & LIO_WAIT_RECALL)
 	|| ((method & LIO_WAIT_TYPES) == 0) ){