diff options
author | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 16:08:16 +0200 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 16:08:16 +0200 |
commit | 1f4e0ff07980820977f45d6a5dbc81d3bb9ce4d3 (patch) | |
tree | 5b5a159add010d09ea58ca12fd079b16f05333b8 /drivers/md/dm-ioctl.c | |
parent | dm thin: add read only and fail io modes (diff) | |
download | linux-1f4e0ff07980820977f45d6a5dbc81d3bb9ce4d3.tar.xz linux-1f4e0ff07980820977f45d6a5dbc81d3bb9ce4d3.zip |
dm thin: commit before gathering status
Commit outstanding metadata before returning the status for a dm thin
pool so that the numbers reported are as up-to-date as possible.
The commit is not performed if the device is suspended or if
the DM_NOFLUSH_FLAG is supplied by userspace and passed to the target
through a new 'status_flags' parameter in the target's dm_status_fn.
The userspace dmsetup tool will support the --noflush flag with the
'dmsetup status' and 'dmsetup wait' commands from version 1.02.76
onwards.
Tested-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index a1a3e6df17b8..afd95986d099 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1054,6 +1054,7 @@ static void retrieve_status(struct dm_table *table, char *outbuf, *outptr; status_type_t type; size_t remaining, len, used = 0; + unsigned status_flags = 0; outptr = outbuf = get_result_buffer(param, param_size, &len); @@ -1090,7 +1091,9 @@ static void retrieve_status(struct dm_table *table, /* Get the status/table string from the target driver */ if (ti->type->status) { - if (ti->type->status(ti, type, outptr, remaining)) { + if (param->flags & DM_NOFLUSH_FLAG) + status_flags |= DM_STATUS_NOFLUSH_FLAG; + if (ti->type->status(ti, type, status_flags, outptr, remaining)) { param->flags |= DM_BUFFER_FULL_FLAG; break; } |