Page MenuHomeFreeBSD

D28880.diff
No OneTemporary

D28880.diff

diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -239,6 +239,7 @@
off_t arg[2];
ssize_t clen, len, off, boff, voff;
int i, err;
+ struct spacectl_range range;
br = be->be_req;
if (br->br_iovcnt <= 1)
@@ -336,8 +337,20 @@
err = errno;
else
br->br_resid = 0;
- } else
- err = EOPNOTSUPP;
+ } else {
+ range.r_offset = br->br_offset;
+ range.r_len = br->br_resid;
+
+ while (range.r_len > 0) {
+ if (fspacectl(bc->bc_fd, SPACECTL_DEALLOC,
+ &range, 0, &range) != 0) {
+ err = errno;
+ break;
+ }
+ }
+ if (err == 0)
+ br->br_resid = 0;
+ }
break;
default:
err = EINVAL;
@@ -566,8 +579,11 @@
candelete = arg.value.i;
if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0)
geom = 1;
- } else
+ } else {
psectsz = sbuf.st_blksize;
+ /* Avoid fallback implementation */
+ candelete = fpathconf(fd, _PC_DEALLOC_PRESENT) == 1;
+ }
#ifndef WITHOUT_CAPSICUM
if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1)

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 9, 3:37 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14549313
Default Alt Text
D28880.diff (1 KB)

Event Timeline