OSDN Git Service

nfs: Support BDRV_REQ_ZERO_WRITE for truncate
authorEric Blake <eblake@redhat.com>
Tue, 28 Apr 2020 20:28:59 +0000 (15:28 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 8 May 2020 11:26:35 +0000 (13:26 +0200)
commit8f23aaf5d6a5458e251c5d5d0555d9e515355e35
tree222449c884848e6ede2fb43e7d0343372aa91192
parent8e519795041e3293ab6b4e67f5416fa80dc0efc4
nfs: Support BDRV_REQ_ZERO_WRITE for truncate

Our .bdrv_has_zero_init_truncate returns 1 if we detect that the OS
always 0-fills; we can use that same knowledge to implement
BDRV_REQ_ZERO_WRITE by ignoring it when the OS gives it to us for
free.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200428202905.770727-4-eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/nfs.c