diff options
author | Alasdair Kergon <agk@redhat.com> | 2011-06-28 09:24:13 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2011-06-28 09:24:13 +0000 |
commit | 7b5e4dcf1f7c298e001a183e49cc623f637f35ea (patch) | |
tree | 4c2655de462388e868c60b32fe397a0e35c2bb64 /libdm | |
parent | 101ce82afa30bbd6710ac50718c1bc55c9c01b94 (diff) | |
download | lvm2-7b5e4dcf1f7c298e001a183e49cc623f637f35ea.tar.gz lvm2-7b5e4dcf1f7c298e001a183e49cc623f637f35ea.tar.xz lvm2-7b5e4dcf1f7c298e001a183e49cc623f637f35ea.zip |
more fixes to readahead etc.
Diffstat (limited to 'libdm')
-rw-r--r-- | libdm/libdm-common.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index 75b2f502..fa6746a0 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -864,13 +864,6 @@ static int _stack_node_op(node_op_t type, const char *dev_name, uint32_t major, char *pos; /* - * Clear warn_if_udev_failed if rely_on_udev is set. It doesn't get - * checked in this case - this just removes the flag from log messages. - */ - if (rely_on_udev) - warn_if_udev_failed = 0; - - /* * Note: warn_if_udev_failed must have valid content */ if ((type == NODE_DEL) && _other_node_ops(type)) @@ -911,10 +904,16 @@ static int _stack_node_op(node_op_t type, const char *dev_name, uint32_t major, */ dm_list_iterate_safe(noph, nopht, &_node_ops) { nop = dm_list_item(noph, struct node_op_parms); - if (!strcmp(old_name, nop->dev_name)) + if (!strcmp(old_name, nop->dev_name)) { _log_node_op("Unstacking", nop); _del_node_op(nop); + } } + else if (type == NODE_READ_AHEAD) { + /* udev doesn't process readahead */ + rely_on_udev = 0; + warn_if_udev_failed = 0; + } if (!(nop = dm_malloc(sizeof(*nop) + len))) { log_error("Insufficient memory to stack mknod operation"); @@ -930,9 +929,14 @@ static int _stack_node_op(node_op_t type, const char *dev_name, uint32_t major, nop->mode = mode; nop->read_ahead = read_ahead; nop->read_ahead_flags = read_ahead_flags; - nop->warn_if_udev_failed = warn_if_udev_failed; nop->rely_on_udev = rely_on_udev; + /* + * Clear warn_if_udev_failed if rely_on_udev is set. It doesn't get + * checked in this case - this just removes the flag from log messages. + */ + nop->warn_if_udev_failed = rely_on_udev ? 0 : warn_if_udev_failed; + _store_str(&pos, &nop->dev_name, dev_name); _store_str(&pos, &nop->old_name, old_name); |