diff options
author | Fam Zheng <famz@redhat.com> | 2018-07-10 14:31:24 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2018-07-10 16:46:22 +0200 |
commit | cd47d792d7a27a57f4b621e2ff1ed8f4e83de1e9 (patch) | |
tree | 14b32cab5683d54a74d576768cc0c1cce8fb90a7 /block/file-posix.c | |
parent | 5416a11eb55d46c376dde97c429b89e9b4e1a94f (diff) |
block: Use common write req handling in truncate
Truncation is the last to convert from open coded req handling to
reusing helpers. This time the permission check in prepare has to adapt
to the new caller: it checks a different permission bit, and doesn't
trigger the before write notifier.
Also, truncation should always trigger a bs->total_sectors update and in
turn call parent resize_cb. Update the condition in finish helper, too.
It's intended to do a duplicated bs->read_only check before calling
bdrv_co_write_req_prepare() so that we can be more informative with the
error message, as bdrv_co_write_req_prepare() doesn't have Error
parameter.
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/file-posix.c')
0 files changed, 0 insertions, 0 deletions