freebsd-dev/module
Etienne Dechamps 089fa91bc5 Align DISCARD requests on zvols.
Currently, when processing DISCARD requests, zvol_discard() calls
dmu_free_long_range() with the precise offset and size of the request.

Unfortunately, this is not optimal for requests that are not aligned to
the zvol block boundaries. Indeed, in the case of an unaligned range,
dnode_free_range() will zero out the unaligned parts. Not only is this
useless since we are not freeing any space by doing so, it is also slow
because it translates to a read-modify-write operation.

This patch fixes the issue by rounding up the discard start offset to
the next volume block boundary, and rounding down the discard end
offset to the previous volume block boundary.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1010
2012-10-04 16:01:44 -07:00
..
avl Add script for builtin module building. 2012-07-26 13:45:09 -07:00
nvpair Add script for builtin module building. 2012-07-26 13:45:09 -07:00
unicode Add script for builtin module building. 2012-07-26 13:45:09 -07:00
zcommon Illumos #1948: zpool list should show more detailed pool info 2012-09-19 13:39:05 -07:00
zfs Align DISCARD requests on zvols. 2012-10-04 16:01:44 -07:00
zpios Add script for builtin module building. 2012-07-26 13:45:09 -07:00
.gitignore Add .gitignore files to exclude build products 2010-01-08 11:35:17 -08:00
Makefile.in Add script for builtin module building. 2012-07-26 13:45:09 -07:00