Jens Axboe
8fb0f47a9d
iov_iter: add helper to save iov_iter state
...
In an ideal world, when someone is passed an iov_iter and returns X bytes,
then X bytes would have been consumed/advanced from the iov_iter. But we
have use cases that always consume the entire iterator, a few examples
of that are iomap and bdev O_DIRECT. This means we cannot rely on the
state of the iov_iter once we've called ->read_iter() or ->write_iter().
This would be easier if we didn't always have to deal with truncate of
the iov_iter, as rewinding would be trivial without that. We recently
added a commit to track the truncate state, but that grew the iov_iter
by 8 bytes and wasn't the best solution.
Implement a helper to save enough of the iov_iter state to sanely restore
it after we've called the read/write iterator helpers. This currently
only works for IOVEC/BVEC/KVEC as that's all we need, support for other
iterator types are left as an exercise for the reader.
Link: https://lore.kernel.org/linux-fsdevel/CAHk-=wiacKV4Gh-MYjteU0LwNBSGpWrK-Ov25HdqB1ewinrFPg@mail.gmail.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2021-09-14 08:12:18 -06:00
..
2021-07-30 10:58:30 +08:00
2020-11-18 14:15:17 -06:00
2021-07-08 11:48:20 -07:00
2021-09-03 15:33:47 -07:00
2021-07-01 11:06:05 -07:00
2020-12-15 22:46:19 -08:00
2021-09-08 11:50:26 -07:00
2021-08-12 19:17:00 +08:00
2021-07-08 11:48:20 -07:00
2021-01-04 10:38:11 +09:00
2021-07-08 11:48:20 -07:00
2021-04-14 23:04:44 +10:00
2021-07-01 11:06:05 -07:00
2020-12-29 15:36:49 -08:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:05 -07:00
2021-05-02 00:43:35 +09:00
2020-11-18 14:15:17 -06:00
2021-07-08 11:48:20 -07:00
2020-11-18 14:15:17 -06:00
2021-05-26 13:20:50 +02:00
2021-05-06 19:24:12 -07:00
2021-08-13 10:27:50 +02:00
2021-06-10 13:41:26 -04:00
2021-04-01 09:54:37 +01:00
2021-07-08 11:48:22 -07:00
2021-06-23 16:41:41 -06:00
2021-05-05 16:07:40 +02:00
2021-02-05 23:28:29 +01:00
2021-01-21 14:06:00 -07:00
2021-05-06 19:24:12 -07:00
2020-11-02 12:14:19 -08:00
2021-06-05 08:58:12 -07:00
2021-08-19 09:02:55 +09:00
2021-06-22 13:56:43 +02:00
2021-08-13 10:07:44 +02:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:06 -07:00
2021-05-06 19:24:12 -07:00
2021-07-01 11:06:06 -07:00
2021-07-01 11:06:05 -07:00
2021-07-01 11:06:05 -07:00
2021-08-13 14:09:32 -10:00
2021-07-08 11:48:20 -07:00
2020-11-20 14:45:33 +11:00
2021-09-08 11:50:26 -07:00
2021-07-08 11:48:20 -07:00
2021-04-16 16:10:37 -07:00
2020-12-15 22:46:15 -08:00
2020-12-15 22:46:19 -08:00
2020-12-15 22:46:15 -08:00
2021-01-03 20:05:18 -05:00
2021-05-06 19:24:12 -07:00
2021-05-06 19:24:12 -07:00
2020-11-18 14:15:17 -06:00
2020-10-20 14:39:37 -07:00
2021-09-14 08:12:18 -06:00
2021-08-19 09:02:55 +09:00
2021-09-01 15:13:02 -07:00
2021-09-08 12:55:35 -07:00
2021-06-29 10:53:53 -07:00
2021-07-20 13:49:44 -07:00
2021-05-05 11:27:27 -07:00
2021-02-26 09:41:05 -08:00
2021-07-08 11:48:20 -07:00
2021-04-10 11:09:41 +02:00
2021-07-02 12:08:10 -07:00
2021-05-19 15:05:11 +02:00
2021-08-13 18:37:38 +02:00
2021-07-08 11:48:20 -07:00
2021-06-22 16:42:08 +02:00
2021-08-26 22:28:02 +02:00
2021-02-17 17:31:06 -06:00
2021-04-16 16:10:37 -07:00
2021-07-09 10:19:13 -07:00
2021-07-08 11:48:20 -07:00
2021-07-30 09:25:34 +02:00
2021-07-08 11:48:20 -07:00
2021-08-08 13:00:20 +01:00
2021-04-16 16:10:37 -07:00
2021-07-01 11:06:05 -07:00
2021-05-06 19:24:12 -07:00
2021-05-13 03:27:38 +00:00
2021-04-16 16:10:37 -07:00
2020-10-24 20:21:57 +02:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:20 -07:00
2021-09-03 10:08:28 -07:00
2021-07-08 11:48:20 -07:00
2021-08-24 19:52:40 -03:00
2020-11-20 14:45:33 +11:00
2020-11-18 14:15:17 -06:00
2021-06-29 10:53:46 -07:00
2021-05-19 10:51:40 +02:00
2021-07-08 11:48:20 -07:00
2021-07-08 11:48:20 -07:00
2021-07-19 11:39:28 +02:00
2021-08-30 07:50:56 -07:00
2020-11-19 11:56:16 -08:00
2021-06-18 11:43:09 +02:00
2021-08-13 10:27:49 +02:00
2021-07-08 11:48:20 -07:00
2021-08-17 00:45:07 +02:00
2021-05-13 16:14:45 +02:00
2021-01-18 11:03:26 +01:00
2020-12-15 22:46:16 -08:00
2021-07-01 11:06:03 -07:00
2021-07-15 10:13:49 -07:00
2021-09-03 09:58:15 -07:00
2021-09-03 10:08:28 -07:00
2021-07-08 11:48:20 -07:00
2021-06-25 11:31:03 -06:00
2021-08-17 19:05:33 +02:00
2021-09-08 12:55:35 -07:00
2021-03-24 15:16:09 -07:00
2021-09-06 11:04:03 -07:00
2021-09-08 11:50:26 -07:00
2021-08-22 00:21:36 -07:00
2021-07-01 11:06:05 -07:00
2021-02-26 09:41:05 -08:00
2021-09-03 09:58:14 -07:00
2021-03-30 13:42:33 -04:00
2021-07-19 11:39:28 +02:00
2021-02-17 14:08:01 +01:00
2020-11-18 14:15:17 -06:00
2021-08-13 13:19:06 -06:00
2021-02-05 11:03:47 -08:00
2021-09-08 12:55:35 -07:00
2021-03-30 13:42:33 -04:00