From: Etienne Dechamps Date: Thu, 4 Oct 2012 08:38:55 +0000 (+0200) Subject: Align DISCARD requests on zvols. X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=089fa91bc51dc10da5a75a6d9fff77f186fccb23;hp=089fa91bc51dc10da5a75a6d9fff77f186fccb23;p=zfs.git 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 Closes #1010 ---