@cl_dio_aio is allocated by slab, we should use slab
free helper to free its memory.
Fixes: 3db1d ("LU-13134 obdclass: use slab allocation for cl_dio_aio")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: Ic82f4dec5e9bb6de7a531c224fa23248d4f7d63d
Reviewed-on: https://review.whamcloud.com/39103
Reviewed-by: Patrick Farrell <farr0186@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
void cl_sync_io_note(const struct lu_env *env, struct cl_sync_io *anchor,
int ioret);
struct cl_dio_aio *cl_aio_alloc(struct kiocb *iocb);
+void cl_aio_free(struct cl_dio_aio *aio);
static inline void cl_sync_io_init(struct cl_sync_io *anchor, int nr)
{
cl_sync_io_init_notify(anchor, nr, NULL, NULL);
vio->u.write.vui_written += tot_bytes;
result = tot_bytes;
}
- OBD_FREE_PTR(aio);
-
+ cl_aio_free(aio);
} else {
result = -EIOCBQUEUED;
}
}
EXPORT_SYMBOL(cl_aio_alloc);
+void cl_aio_free(struct cl_dio_aio *aio)
+{
+ if (aio)
+ OBD_SLAB_FREE_PTR(aio, cl_dio_aio_kmem);
+}
+EXPORT_SYMBOL(cl_aio_free);
+
/**
* Indicate that transfer of a single page completed.
* If anchor->csi_aio is set, we are responsible for freeing
* memory here rather than when cl_sync_io_wait() completes.
*/
- if (aio)
- OBD_SLAB_FREE_PTR(aio, cl_dio_aio_kmem);
+ cl_aio_free(aio);
}
EXIT;
}