diff options
author | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:16 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-07-27 10:08:16 -0400 |
commit | 1f4e0ff07980820977f45d6a5dbc81d3bb9ce4d3 (patch) | |
tree | 5b5a159add010d09ea58ca12fd079b16f05333b8 /drivers/md/dm-snap.c | |
parent | e49e582965b3694f07a106adc83ddb44aa4f0890 (diff) |
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-snap.c')
-rw-r--r-- | drivers/md/dm-snap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 6c0f3e33923a..a143921feaf6 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -1849,7 +1849,7 @@ static void snapshot_merge_resume(struct dm_target *ti) | |||
1849 | } | 1849 | } |
1850 | 1850 | ||
1851 | static int snapshot_status(struct dm_target *ti, status_type_t type, | 1851 | static int snapshot_status(struct dm_target *ti, status_type_t type, |
1852 | char *result, unsigned int maxlen) | 1852 | unsigned status_flags, char *result, unsigned maxlen) |
1853 | { | 1853 | { |
1854 | unsigned sz = 0; | 1854 | unsigned sz = 0; |
1855 | struct dm_snapshot *snap = ti->private; | 1855 | struct dm_snapshot *snap = ti->private; |
@@ -2151,8 +2151,8 @@ static void origin_resume(struct dm_target *ti) | |||
2151 | ti->max_io_len = get_origin_minimum_chunksize(dev->bdev); | 2151 | ti->max_io_len = get_origin_minimum_chunksize(dev->bdev); |
2152 | } | 2152 | } |
2153 | 2153 | ||
2154 | static int origin_status(struct dm_target *ti, status_type_t type, char *result, | 2154 | static int origin_status(struct dm_target *ti, status_type_t type, |
2155 | unsigned int maxlen) | 2155 | unsigned status_flags, char *result, unsigned maxlen) |
2156 | { | 2156 | { |
2157 | struct dm_dev *dev = ti->private; | 2157 | struct dm_dev *dev = ti->private; |
2158 | 2158 | ||