The proposed changes are based on https://reviews.freebsd.org/D19599.
Because of ext2fs code base compatibility with ufs, it was not difficult to just move the changes from ufs side.
The same optimization for extents could be added later.
Differential D23605
Add a EXT2FS-specific implementation for lseek(SEEK_DATA). fsu on Feb 10 2020, 5:18 PM. Authored by Tags None Referenced Files
Subscribers
Details The proposed changes are based on https://reviews.freebsd.org/D19599. The same optimization for extents could be added later. The changes were tested using test programs mentioned in the https://reviews.freebsd.org/D19599: Also, the additional verification code was used: struct ucred *cred) { error_ref = vn_bmap_seekhole(vp, cmd, &off_ref, cred); error = ext2_bmap_seekdata(vp, &off); VOP_UNLOCK(vp); } else error = EBADF; if (error != error_ref) { printf("==== TEST ERROR er_ref=%d, er=%d\n", error_ref, error); *offp = off_ref; return (error_ref); } if (error) return (error); if (off_ref != off) { printf("==== TEST ERROR off_ref=%ld, off=%ld\n", off_ref, off); *offp = off_ref; return (error_ref); } *offp = off; return (0);
Diff Detail
Event TimelineComment Actions Good, indeed r252956, which was the predecesor of this, was built on an UFS patch. |