mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: "Kay Sievers" <kay.sievers@vrfy.org>
Cc: "Greg KH" <greg@kroah.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@osdl.org>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>
Subject: Re: [Patch -mm 2/5] driver core: Introduce device_move(): move a device to a new parent.
Date: Wed, 15 Nov 2006 10:24:09 +0100	[thread overview]
Message-ID: <20061115102409.6e6e5dc0@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <3ae72650611150044y8e0b57k681c478dca5c6cbf@mail.gmail.com>

On Wed, 15 Nov 2006 09:44:33 +0100,
"Kay Sievers" <kay.sievers@vrfy.org> wrote:

> Udev and HAL, both will need an event for the moving, with the old
> DEVPATH value in the environment. We want something like a "rename" or
> "move" event. Without that, weird things will happen in userspace,
> because the devpath is used as the key to the device during the whole
> device lifetime. The only weird exception today is the netif rename
> case, which is already handled by special code in udev.

Something like below (completely untested as my test box is currently
inaccessible)? Wouldn't we need something similar for kobject_rename()
as well?

---
 include/linux/kobject.h |    1 +
 lib/kobject.c           |    1 +
 2 files changed, 2 insertions(+)

--- linux-2.6-CH.orig/include/linux/kobject.h
+++ linux-2.6-CH/include/linux/kobject.h
@@ -47,6 +47,7 @@ enum kobject_action {
 	KOBJ_UMOUNT	= (__force kobject_action_t) 0x05,	/* umount event for block devices (broken) */
 	KOBJ_OFFLINE	= (__force kobject_action_t) 0x06,	/* device offline */
 	KOBJ_ONLINE	= (__force kobject_action_t) 0x07,	/* device online */
+	KOBJ_MOVE	= (__force kobject_action_t) 0x08,	/* device move */
 };
 
 struct kobject {
--- linux-2.6-CH.orig/lib/kobject.c
+++ linux-2.6-CH/lib/kobject.c
@@ -379,6 +379,7 @@ int kobject_move(struct kobject *kobj, s
 	old_parent = kobj->parent;
 	kobj->parent = new_parent;
 	kobject_put(old_parent);
+	kobject_uevent(kobj, KOBJ_MOVE);
 out:
 	kobject_put(kobj);
 	return error;

  reply	other threads:[~2006-11-15  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 10:32 Cornelia Huck
2006-11-15  6:50 ` Greg KH
2006-11-15  7:28   ` Cornelia Huck
2006-11-15  8:44     ` Kay Sievers
2006-11-15  9:24       ` Cornelia Huck [this message]
2006-11-15  9:31         ` Kay Sievers
2006-11-15 10:11           ` Cornelia Huck
2006-11-15 16:44             ` Dmitry Torokhov
2006-11-15 17:23               ` Cornelia Huck
2006-11-15 17:39             ` Cornelia Huck

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=20061115102409.6e6e5dc0@gondolin.boeblingen.de.ibm.com \
    --to=cornelia.huck@de.ibm.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    /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: link
Be 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

all inboxes | Powered by JetHome®