From e97f64cb3380e6287eae05b408a3bb6333cc62eb Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 14 Mar 2026 23:17:53 +0000 Subject: util/nvmutil rw: make off_reset a toggle Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'util/nvmutil') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 6a7d96db..88dfdba2 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -412,7 +412,7 @@ static ssize_t rw_gbe_file_exact(int fd, u8 *mem, size_t nrw, off_t off, int rw_type); static ssize_t rw_file_exact(int fd, u8 *mem, size_t len, off_t off, int rw_type, int loop_eagain, int loop_eintr, - size_t max_retries); + size_t max_retries, int off_reset); static ssize_t prw(int fd, void *mem, size_t nrw, off_t off, int rw_type, int loop_eagain, int loop_eintr, int off_reset); @@ -1457,7 +1457,7 @@ gbe_cat_buf(u8 *b) { if (rw_file_exact(STDOUT_FILENO, b, GBE_PART_SIZE, 0, IO_WRITE, LOOP_EAGAIN, LOOP_EINTR, - MAX_ZERO_RW_RETRY) < 0) + MAX_ZERO_RW_RETRY, OFF_ERR) < 0) err(errno, "stdout: cat"); } @@ -1835,7 +1835,8 @@ rw_gbe_file_exact(int fd, u8 *mem, size_t nrw, goto err_rw_gbe_file_exact; return rw_file_exact(fd, mem, nrw, off, rw_type, - NO_LOOP_EAGAIN, LOOP_EINTR, MAX_ZERO_RW_RETRY); + NO_LOOP_EAGAIN, LOOP_EINTR, MAX_ZERO_RW_RETRY, + OFF_ERR); err_rw_gbe_file_exact: errno = EIO; @@ -1875,7 +1876,8 @@ err_rw_gbe_file_exact: static ssize_t rw_file_exact(int fd, u8 *mem, size_t nrw, off_t off, int rw_type, int loop_eagain, - int loop_eintr, size_t max_retries) + int loop_eintr, size_t max_retries, + int off_reset) { ssize_t rv = 0; ssize_t rc = 0; @@ -1900,7 +1902,7 @@ rw_file_exact(int fd, u8 *mem, size_t nrw, rv = prw(fd, mem_cur, nrw_cur, off_cur, rw_type, loop_eagain, loop_eintr, - OFF_ERR); + off_reset); if (rv < 0) return -1; -- cgit v1.2.1