Whamcloud - gitweb
LU-13799 llite: Simplify cda_no_aio_complete use
authorPatrick Farrell <pfarrell@whamcloud.com>
Wed, 19 Jan 2022 15:45:26 +0000 (10:45 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 9 Mar 2022 17:19:11 +0000 (17:19 +0000)
It is better to handle AIO and DIO the same as much as
possible, limiting the difference to setup if possible.

In this spirit, move the check for DIO (is_sync_kiocb()) to
the setup function rather than cleanup and just use
no_aio_complete.

Lustre-change: https://review.whamcloud.com/44154
Lustre-commit: b60bd21ec5d5f34ed79c63158860b6f5e948dba2

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: Iefc0865aee20958960f48539ad73c80c997ff0b4
Reviewed-on: https://review.whamcloud.com/44682
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/cl_io.c

index 0cda1f4..ca3f0c3 100644 (file)
@@ -1219,7 +1219,7 @@ static void cl_aio_end(const struct lu_env *env, struct cl_sync_io *anchor)
                cl_page_put(env, page);
        }
 
-       if (!is_sync_kiocb(aio->cda_iocb) && !aio->cda_no_aio_complete)
+       if (!aio->cda_no_aio_complete)
                aio_complete(aio->cda_iocb, ret ?: aio->cda_bytes, 0);
 
        EXIT;
@@ -1239,7 +1239,10 @@ struct cl_dio_aio *cl_aio_alloc(struct kiocb *iocb, struct cl_object *obj)
                                       NULL : aio, cl_aio_end);
                cl_page_list_init(&aio->cda_pages);
                aio->cda_iocb = iocb;
-               aio->cda_no_aio_complete = 0;
+               if (is_sync_kiocb(iocb))
+                       aio->cda_no_aio_complete = 1;
+               else
+                       aio->cda_no_aio_complete = 0;
                cl_object_get(obj);
                aio->cda_obj = obj;
        }