Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152998633
D36194.id109307.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
D36194.id109307.diff
View Options
Index: sys/kern/vfs_vnops.c
===================================================================
--- sys/kern/vfs_vnops.c
+++ sys/kern/vfs_vnops.c
@@ -3268,9 +3268,9 @@
outvp->v_mount->mnt_stat.f_iosize);
if (blksize < 4096)
blksize = 4096;
- else if (blksize > 1024 * 1024)
- blksize = 1024 * 1024;
- dat = malloc(blksize, M_TEMP, M_WAITOK);
+ else if (blksize > maxphys)
+ blksize = maxphys;
+ dat = malloc(maxphys, M_TEMP, M_WAITOK);
/*
* If VOP_IOCTL(FIOSEEKHOLE) works for invp, use it and FIOSEEKDATA
@@ -3377,14 +3377,21 @@
error = 0;
}
- xfer = blksize;
- if (cantseek) {
+ /*
+ * We only need to copy in chunks of size _PC_MIN_HOLE_SIZE if
+ * FIOSEEKDATA or FIOSEEKHOLE return an error and we are going
+ * to fall back on the "all bytes 0" method.
+ */
+ if (__predict_false(cantseek)) {
+ xfer = blksize;
/*
* Set first xfer to end at a block boundary, so that
* holes are more likely detected in the loop below via
* the for all bytes 0 method.
*/
xfer -= (*inoffp % blksize);
+ } else {
+ xfer = blksize = maxphys;
}
/* Loop copying the data block. */
while (copylen > 0 && error == 0 && !eof && interrupted == 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 1:32 PM (16 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31773415
Default Alt Text
D36194.id109307.diff (1 KB)
Attached To
Mode
D36194: copy_file_range: If _PC_MIN_HOLE_SIZE is small, use mnt_stat.f_iosize
Attached
Detach File
Event Timeline
Log In to Comment