Revert "iov_iter: track truncated size" iov_iter
authorJens Axboe <axboe@kernel.dk>
Fri, 10 Sep 2021 17:19:58 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 10 Sep 2021 19:13:10 +0000 (13:13 -0600)
This reverts commit 2112ff5ce0c1128fe7b4d19cfe7f2b8ce5b595fa.

We no longer need to track the truncation count, the one user that did
need it has been converted to using iov_iter_restore() instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/uio.h

index 6eaedae5ea2fe03a747bcd3d6d162f734d1ac54d..7c8aeacc6fa7d24007982d3b6fe70744a0f3c391 100644 (file)
@@ -53,7 +53,6 @@ struct iov_iter {
                };
                loff_t xarray_start;
        };
-       size_t truncated;
 };
 
 static inline enum iter_type iov_iter_type(const struct iov_iter *i)
@@ -271,10 +270,8 @@ static inline void iov_iter_truncate(struct iov_iter *i, u64 count)
         * conversion in assignement is by definition greater than all
         * values of size_t, including old i->count.
         */
-       if (i->count > count) {
-               i->truncated += i->count - count;
+       if (i->count > count)
                i->count = count;
-       }
 }
 
 /*
@@ -283,7 +280,6 @@ static inline void iov_iter_truncate(struct iov_iter *i, u64 count)
  */
 static inline void iov_iter_reexpand(struct iov_iter *i, size_t count)
 {
-       i->truncated -= count - i->count;
        i->count = count;
 }