Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102142130
D28880.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D28880.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D28880: bhyve: Use fspacectl(2) for BOP_DELETE on regular file images
Attached
Detach File
Event Timeline
Log In to Comment