From: Damien Le Moal <damien.lemoal@xxxxxxx> The res and res2 fields of struct io_event are signed 64 bits values (__s64 type). Allow the ki_complete method of struct kiocb to set 64 bits values in these fields by changin its interface from the long type to long long. Signed-off-by: Damien Le Moal <damien.lemoal@xxxxxxx> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> --- drivers/block/loop.c | 3 ++- drivers/nvme/target/io-cmd-file.c | 3 ++- drivers/target/target_core_file.c | 3 ++- fs/aio.c | 2 +- fs/io_uring.c | 5 +++-- include/linux/fs.h | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a943207705dd..2a1e0f248436 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -513,7 +513,8 @@ static void lo_rw_aio_do_completion(struct loop_cmd *cmd) blk_mq_complete_request(rq); } -static void lo_rw_aio_complete(struct kiocb *iocb, long ret, long ret2) +static void lo_rw_aio_complete(struct kiocb *iocb, + long long ret, long long ret2) { struct loop_cmd *cmd = container_of(iocb, struct loop_cmd, iocb); diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c index 0abbefd9925e..302bfdff55e5 100644 --- a/drivers/nvme/target/io-cmd-file.c +++ b/drivers/nvme/target/io-cmd-file.c @@ -123,7 +123,8 @@ static ssize_t nvmet_file_submit_bvec(struct nvmet_req *req, loff_t pos, return call_iter(iocb, &iter); } -static void nvmet_file_io_done(struct kiocb *iocb, long ret, long ret2) +static void nvmet_file_io_done(struct kiocb *iocb, + long long ret, long long ret2) { struct nvmet_req *req = container_of(iocb, struct nvmet_req, f.iocb); u16 status = NVME_SC_SUCCESS; diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 7143d03f0e02..87eac2313758 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -243,7 +243,8 @@ struct target_core_file_cmd { struct kiocb iocb; }; -static void cmd_rw_aio_complete(struct kiocb *iocb, long ret, long ret2) +static void cmd_rw_aio_complete(struct kiocb *iocb, + long long ret, long long ret2) { struct target_core_file_cmd *cmd; diff --git a/fs/aio.c b/fs/aio.c index 91e7cc4a9f17..38bce07f9733 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1418,7 +1418,7 @@ static void aio_remove_iocb(struct aio_kiocb *iocb) spin_unlock_irqrestore(&ctx->ctx_lock, flags); } -static void aio_complete_rw(struct kiocb *kiocb, long res, long res2) +static void aio_complete_rw(struct kiocb *kiocb, long long res, long long res2) { struct aio_kiocb *iocb = container_of(kiocb, struct aio_kiocb, rw); diff --git a/fs/io_uring.c b/fs/io_uring.c index ce63e1389568..a2e861b13b1e 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2261,14 +2261,15 @@ static void __io_complete_rw(struct io_kiocb *req, long res, long res2, io_complete_rw_common(&req->rw.kiocb, res, cs); } -static void io_complete_rw(struct kiocb *kiocb, long res, long res2) +static void io_complete_rw(struct kiocb *kiocb, long long res, long long res2) { struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); __io_complete_rw(req, res, res2, NULL); } -static void io_complete_rw_iopoll(struct kiocb *kiocb, long res, long res2) +static void io_complete_rw_iopoll(struct kiocb *kiocb, long long res, + long long res2) { struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); diff --git a/include/linux/fs.h b/include/linux/fs.h index da90323b9f92..aa8e82496179 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -328,7 +328,7 @@ struct kiocb { randomized_struct_fields_start loff_t ki_pos; - void (*ki_complete)(struct kiocb *iocb, long ret, long ret2); + void (*ki_complete)(struct kiocb *iocb, long long ret, long long ret2); void *private; int ki_flags; u16 ki_hint; -- 2.26.2