public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: prajnoha@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ... Date: Thu, 22 Oct 2009 13:00:00 -0000 [thread overview] Message-ID: <20091022130009.5546.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: prajnoha@sourceware.org 2009-10-22 13:00:08 Modified files: . : WHATS_NEW lib/activate : dev_manager.c libdm : .exported_symbols libdevmapper.h libdm-deptree.c Log message: Use udev flags support in LVM and provide dm_tree_add_new_dev_with_udev_flags wrapper for dm_tree_add_new_dev. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1298&r2=1.1299 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.159&r2=1.160 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.43&r2=1.44 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.98&r2=1.99 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60 --- LVM2/WHATS_NEW 2009/10/22 11:25:46 1.1298 +++ LVM2/WHATS_NEW 2009/10/22 13:00:07 1.1299 @@ -1,5 +1,6 @@ Version 2.02.54 - ===================================== + Use udev flags support in LVM. Delay announcing mirror monitoring to syslog until initialisation succeeded. Handle metadata with unknown segment types more gracefully. Set default owner and group to null. --- LVM2/lib/activate/dev_manager.c 2009/10/01 00:35:29 1.159 +++ LVM2/lib/activate/dev_manager.c 2009/10/22 13:00:07 1.160 @@ -1003,6 +1003,7 @@ uint32_t max_stripe_size = UINT32_C(0); uint32_t read_ahead = lv->read_ahead; uint32_t read_ahead_flags = UINT32_C(0); + uint16_t udev_flags = 0; if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer))) return_0; @@ -1022,18 +1023,26 @@ lvlayer->lv = lv; + if (layer || !lv_is_visible(lv)) + udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG | + DM_UDEV_DISABLE_DISK_RULES_FLAG; + + if (lv_is_cow(lv)) + udev_flags |= DM_UDEV_LOW_PRIORITY_FLAG; + /* * Add LV to dtree. * If we're working with precommitted metadata, clear any * existing inactive table left behind. * Major/minor settings only apply to the visible layer. */ - if (!(dnode = dm_tree_add_new_dev(dtree, name, dlid, + if (!(dnode = dm_tree_add_new_dev_with_udev_flags(dtree, name, dlid, layer ? UINT32_C(0) : (uint32_t) lv->major, layer ? UINT32_C(0) : (uint32_t) lv->minor, _read_only_lv(lv), (lv->vg->status & PRECOMMITTED) ? 1 : 0, - lvlayer))) + lvlayer, + udev_flags))) return_0; /* Store existing name so we can do rename later */ --- LVM2/libdm/.exported_symbols 2009/08/06 17:08:01 1.43 +++ LVM2/libdm/.exported_symbols 2009/10/22 13:00:07 1.44 @@ -50,6 +50,7 @@ dm_tree_free dm_tree_add_dev dm_tree_add_new_dev +dm_tree_add_new_dev_with_udev_flags dm_tree_node_get_name dm_tree_node_get_uuid dm_tree_node_get_info --- LVM2/libdm/libdevmapper.h 2009/10/22 12:55:47 1.98 +++ LVM2/libdm/libdevmapper.h 2009/10/22 13:00:07 1.99 @@ -277,6 +277,15 @@ int read_only, int clear_inactive, void *context); +struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *tree, + const char *name, + const char *uuid, + uint32_t major, + uint32_t minor, + int read_only, + int clear_inactive, + void *context, + uint16_t udev_flags); /* * Search for a node in the tree. --- LVM2/libdm/libdm-deptree.c 2009/10/22 12:55:48 1.59 +++ LVM2/libdm/libdm-deptree.c 2009/10/22 13:00:07 1.60 @@ -130,6 +130,8 @@ int activation_priority; /* 0 gets activated first */ + uint16_t udev_flags; /* Udev control flags */ + void *context; /* External supplied context */ struct load_properties props; /* For creation/table (re)load */ @@ -301,7 +303,8 @@ const char *name, const char *uuid, struct dm_info *info, - void *context) + void *context, + uint16_t udev_flags) { struct dm_tree_node *node; uint64_t dev; @@ -317,6 +320,7 @@ node->uuid = uuid; node->info = *info; node->context = context; + node->udev_flags = udev_flags; node->activation_priority = 0; dm_list_init(&node->uses); @@ -466,8 +470,8 @@ if (!_deps(&dmt, dtree->mem, major, minor, &name, &uuid, &info, &deps)) return_NULL; - if (!(node = _create_dm_tree_node(dtree, name, uuid, - &info, NULL))) + if (!(node = _create_dm_tree_node(dtree, name, uuid, &info, + NULL, 0))) goto_out; new = 1; } @@ -585,8 +589,8 @@ info.inactive_table = 0; info.read_only = 0; - if (!(dnode = _create_dm_tree_node(dtree, name2, uuid2, - &info, context))) + if (!(dnode = _create_dm_tree_node(dtree, name2, uuid2, &info, + context, 0))) return_NULL; /* Attach to root node until a table is supplied */ @@ -613,10 +617,31 @@ return_NULL; dnode->context = context; + dnode->udev_flags = 0; return dnode; } +struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *dtree, + const char *name, + const char *uuid, + uint32_t major, + uint32_t minor, + int read_only, + int clear_inactive, + void *context, + uint16_t udev_flags) +{ + struct dm_tree_node *node; + + if ((node = dm_tree_add_new_dev(dtree, name, uuid, major, minor, read_only, + clear_inactive, context))) + node->udev_flags = udev_flags; + + return node; +} + + void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode, uint32_t read_ahead, uint32_t read_ahead_flags) @@ -821,7 +846,8 @@ return r; } -static int _deactivate_node(const char *name, uint32_t major, uint32_t minor, uint32_t *cookie) +static int _deactivate_node(const char *name, uint32_t major, uint32_t minor, + uint32_t *cookie, uint16_t udev_flags) { struct dm_task *dmt; int r = 0; @@ -841,7 +867,7 @@ if (!dm_task_no_open_count(dmt)) log_error("Failed to disable open_count"); - if (!dm_task_set_cookie(dmt, cookie, 0)) + if (!dm_task_set_cookie(dmt, cookie, udev_flags)) goto out; r = dm_task_run(dmt); @@ -858,7 +884,7 @@ } static int _rename_node(const char *old_name, const char *new_name, uint32_t major, - uint32_t minor, uint32_t *cookie) + uint32_t minor, uint32_t *cookie, uint16_t udev_flags) { struct dm_task *dmt; int r = 0; @@ -881,7 +907,7 @@ if (!dm_task_no_open_count(dmt)) log_error("Failed to disable open_count"); - if (!dm_task_set_cookie(dmt, cookie, 0)) + if (!dm_task_set_cookie(dmt, cookie, udev_flags)) goto out; r = dm_task_run(dmt); @@ -895,7 +921,8 @@ /* FIXME Merge with _suspend_node? */ static int _resume_node(const char *name, uint32_t major, uint32_t minor, uint32_t read_ahead, uint32_t read_ahead_flags, - struct dm_info *newinfo, uint32_t *cookie) + struct dm_info *newinfo, uint32_t *cookie, + uint16_t udev_flags) { struct dm_task *dmt; int r = 0; @@ -924,7 +951,7 @@ if (!dm_task_set_read_ahead(dmt, read_ahead, read_ahead_flags)) log_error("Failed to set read ahead"); - if (!dm_task_set_cookie(dmt, cookie, 0)) + if (!dm_task_set_cookie(dmt, cookie, udev_flags)) goto out; if ((r = dm_task_run(dmt))) @@ -1011,7 +1038,8 @@ !info.exists || info.open_count) continue; - if (!_deactivate_node(name, info.major, info.minor, &dnode->dtree->cookie)) { + if (!_deactivate_node(name, info.major, info.minor, + &dnode->dtree->cookie, dnode->udev_flags)) { log_error("Unable to deactivate %s (%" PRIu32 ":%" PRIu32 ")", name, info.major, info.minor); @@ -1156,7 +1184,8 @@ /* Rename? */ if (child->props.new_name) { if (!_rename_node(name, child->props.new_name, child->info.major, - child->info.minor, &child->dtree->cookie)) { + child->info.minor, &child->dtree->cookie, + child->udev_flags)) { log_error("Failed to rename %s (%" PRIu32 ":%" PRIu32 ") to %s", name, child->info.major, child->info.minor, child->props.new_name); @@ -1171,7 +1200,7 @@ if (!_resume_node(child->name, child->info.major, child->info.minor, child->props.read_ahead, child->props.read_ahead_flags, - &newinfo, &child->dtree->cookie)) { + &newinfo, &child->dtree->cookie, child->udev_flags)) { log_error("Unable to resume %s (%" PRIu32 ":%" PRIu32 ")", child->name, child->info.major, child->info.minor); @@ -1622,7 +1651,7 @@ if (!_resume_node(child->name, child->info.major, child->info.minor, child->props.read_ahead, child->props.read_ahead_flags, - &newinfo, &child->dtree->cookie)) { + &newinfo, &child->dtree->cookie, child->udev_flags)) { log_error("Unable to resume %s (%" PRIu32 ":%" PRIu32 ")", child->name, child->info.major, child->info.minor);
next reply other threads:[~2009-10-22 13:00 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-10-22 13:00 prajnoha [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-03-05 15:05 zkabelac 2012-01-20 22:02 snitzer 2011-10-14 13:23 zkabelac 2011-10-06 14:45 jbrassow 2011-08-18 19:38 jbrassow 2010-10-13 21:26 snitzer 2010-04-23 14:16 prajnoha 2010-02-17 22:59 snitzer 2010-01-15 16:35 snitzer 2009-10-26 10:02 agk 2008-07-15 0:25 agk 2008-04-10 17:09 wysochanski 2008-01-30 13:19 agk 2007-05-15 14:42 mbroz 2006-11-30 23:11 agk 2006-10-18 18:01 agk 2006-04-28 17:01 agk 2005-11-09 13:05 agk 2005-10-27 19:58 agk 2005-08-10 17:19 agk 2005-06-14 17:54 agk 2005-05-03 17:28 agk 2005-01-19 17:19 agk 2004-09-15 15:02 agk
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20091022130009.5546.qmail@sourceware.org \ --to=prajnoha@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).