Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137948799
D28880.id86011.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1009 B
Referenced Files
None
Subscribers
None
D28880.id86011.diff
View Options
Index: usr.sbin/bhyve/block_if.c
===================================================================
--- usr.sbin/bhyve/block_if.c
+++ usr.sbin/bhyve/block_if.c
@@ -234,6 +234,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)
@@ -331,8 +332,15 @@
err = errno;
else
br->br_resid = 0;
- } else
- err = EOPNOTSUPP;
+ } else {
+ range.r_offset = br->br_offset;
+ range.r_len = br->br_resid;
+
+ if (fspacectl(bc->bc_fd, SPACECTL_DEALLOC, &range, 0))
+ err = errno;
+ else
+ br->br_resid = 0;
+ }
break;
default:
err = EINVAL;
@@ -538,8 +546,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_FDEALLOC_PRESENT) == 1;
+ }
#ifndef WITHOUT_CAPSICUM
if (caph_ioctls_limit(fd, cmds, nitems(cmds)) == -1)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 28, 2:22 PM (10 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26266171
Default Alt Text
D28880.id86011.diff (1009 B)
Attached To
Mode
D28880: bhyve: Use fspacectl(2) for BOP_DELETE on regular file images
Attached
Detach File
Event Timeline
Log In to Comment