Whamcloud - gitweb
LU-13805 clio: Add write to sdio 91/49991/30
authorPatrick Farrell <pfarrell@whamcloud.com>
Tue, 14 Feb 2023 18:33:35 +0000 (13:33 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 24 Aug 2023 04:31:18 +0000 (04:31 +0000)
Unaligned DIO will need to know if an sdio is a write or
a read, so we add this info to the sub-dio.

Test-parameters: trivial
Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I8ee042ca5a0461db672ba98b7fa6c64b01a8bba2
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49991
Reviewed-by: Zhenyu Xu <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/cl_object.h
lustre/llite/rw26.c
lustre/obdclass/cl_io.c

index bdad8d8..da23150 100644 (file)
@@ -2513,7 +2513,8 @@ int cl_sync_io_wait_recycle(const struct lu_env *env, struct cl_sync_io *anchor,
                            long timeout, int ioret);
 struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj,
                                    bool is_aio);
-struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool sync);
+struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool write,
+                                   bool sync);
 void cl_dio_aio_free(const struct lu_env *env, struct cl_dio_aio *aio);
 void cl_sub_dio_free(struct cl_sub_dio *sdio);
 static inline void cl_sync_io_init(struct cl_sync_io *anchor, int nr)
@@ -2572,7 +2573,8 @@ struct cl_sub_dio {
        ssize_t                 csd_bytes;
        struct cl_dio_aio       *csd_ll_aio;
        struct ll_dio_pages     csd_dio_pages;
-       unsigned                csd_creator_free:1;
+       unsigned                csd_creator_free:1,
+                               csd_write:1;
 };
 #if defined(HAVE_DIRECTIO_ITER) || defined(HAVE_IOV_ITER_RW) || \
        defined(HAVE_DIRECTIO_2ARGS)
index f5f85ad..aad6b20 100644 (file)
@@ -545,7 +545,7 @@ ll_direct_IO_impl(struct kiocb *iocb, struct iov_iter *iter, int rw)
                 * otherwise it is freed on the final call to cl_sync_io_note
                 * (either in this function or from a ptlrpcd daemon)
                 */
-               sdio = cl_sub_dio_alloc(ll_dio_aio, sync_submit);
+               sdio = cl_sub_dio_alloc(ll_dio_aio, rw == WRITE, sync_submit);
                if (!sdio)
                        GOTO(out, result = -ENOMEM);
 
index e288e42..d4d85fa 100644 (file)
@@ -1241,7 +1241,8 @@ struct cl_dio_aio *cl_dio_aio_alloc(struct kiocb *iocb, struct cl_object *obj,
 }
 EXPORT_SYMBOL(cl_dio_aio_alloc);
 
-struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool sync)
+struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool write,
+                                   bool sync)
 {
        struct cl_sub_dio *sdio;
 
@@ -1258,6 +1259,7 @@ struct cl_sub_dio *cl_sub_dio_alloc(struct cl_dio_aio *ll_aio, bool sync)
                sdio->csd_ll_aio = ll_aio;
                atomic_add(1,  &ll_aio->cda_sync.csi_sync_nr);
                sdio->csd_creator_free = sync;
+               sdio->csd_write = write;
        }
        return sdio;
 }