diff options
author | Alasdair G Kergon <agk@redhat.com> | 2006-01-06 00:20:07 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 08:34:01 -0800 |
commit | 6da487dcc0c6f4c827779687a20016efeffc4d60 (patch) | |
tree | 824d14e18cbb81bf45c6d17104993acfa47c9c36 /drivers | |
parent | aa8d7c2fbe619d8c0837296d2eaf4c14cebac198 (diff) | |
download | kernel_samsung_aries-6da487dcc0c6f4c827779687a20016efeffc4d60.zip kernel_samsung_aries-6da487dcc0c6f4c827779687a20016efeffc4d60.tar.gz kernel_samsung_aries-6da487dcc0c6f4c827779687a20016efeffc4d60.tar.bz2 |
[PATCH] device-mapper ioctl: add skip lock_fs flag
Add ioctl DM_SKIP_LOCKFS_FLAG for userspace to request that lock_fs is
bypassed when suspending a device.
There's no change to the behaviour of existing code that doesn't know about
the new flag.
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-ioctl.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index dbc07af..561bda5 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -693,14 +693,18 @@ static int dev_rename(struct dm_ioctl *param, size_t param_size) static int do_suspend(struct dm_ioctl *param) { int r = 0; + int do_lockfs = 1; struct mapped_device *md; md = find_device(param); if (!md) return -ENXIO; + if (param->flags & DM_SKIP_LOCKFS_FLAG) + do_lockfs = 0; + if (!dm_suspended(md)) - r = dm_suspend(md, 1); + r = dm_suspend(md, do_lockfs); if (!r) r = __dev_status(md, param); @@ -712,6 +716,7 @@ static int do_suspend(struct dm_ioctl *param) static int do_resume(struct dm_ioctl *param) { int r = 0; + int do_lockfs = 1; struct hash_cell *hc; struct mapped_device *md; struct dm_table *new_map; @@ -737,8 +742,10 @@ static int do_resume(struct dm_ioctl *param) /* Do we need to load a new map ? */ if (new_map) { /* Suspend if it isn't already suspended */ + if (param->flags & DM_SKIP_LOCKFS_FLAG) + do_lockfs = 0; if (!dm_suspended(md)) - dm_suspend(md, 1); + dm_suspend(md, do_lockfs); r = dm_swap_table(md, new_map); if (r) { |