mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
fiemap copy: avoid a performance hit due to very small buffer
* src/copy.c (extent_copy): Don't let what should have been a temporary reduction of buf_size (to handle a short ext_len) become permanent and thus impact the performance of all further iterations.
This commit is contained in:
1 parent
cfbeeafd4a
commit
3953f7523e
1 file changed
+2
-3
+2
-3
@@ -270,9 +270,8 @@ extent_copy (int src_fd, int dest_fd, char *buf, size_t buf_size,
|
||||
{
|
||||
/* Don't read from a following hole if EXT_LEN
|
||||
is smaller than the buffer size. */
|
||||
buf_size = MIN (ext_len, buf_size);
|
||||
|
||||
ssize_t n_read = read (src_fd, buf, buf_size);
|
||||
size_t b_size = MIN (ext_len, buf_size);
|
||||
ssize_t n_read = read (src_fd, buf, b_size);
|
||||
if (n_read < 0)
|
||||
{
|
||||
#ifdef EINTR
|
||||
|
||||
Reference in new issue
Block a user