Allow block cloning to be interrupted by a signal.

Even though block cloning is much faster than regular copying,
it is not instantaneous - the file might be large and the recordsize
small. It would be nice to be able to interrupt it with a signal
(e.g., SIGINFO on FreeBSD to see the progress).

Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
This commit is contained in:
Pawel Jakub Dawidek 2024-05-18 19:01:07 -07:00
parent efbef9e6cc
commit dca2a6a2b4
1 changed files with 5 additions and 0 deletions

View File

@ -1412,6 +1412,11 @@ zfs_clone_range(znode_t *inzp, uint64_t *inoffp, znode_t *outzp,
outoff += size;
len -= size;
done += size;
if (issig(JUSTLOOKING) && issig(FORREAL)) {
error = SET_ERROR(EINTR);
break;
}
}
vmem_free(bps, sizeof (bps[0]) * maxblocks);