From patchwork Sun Aug 11 04:53:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Marineau X-Patchwork-Id: 2842676 Return-Path: X-Original-To: patchwork-v9fs-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 32B8E9F294 for ; Sun, 11 Aug 2013 05:18:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 52A79201EE for ; Sun, 11 Aug 2013 05:18:12 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2F419201ED for ; Sun, 11 Aug 2013 05:18:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V8O2a-0001bA-Rp; Sun, 11 Aug 2013 05:18:08 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V8O2Z-0001az-K2 for v9fs-developer@lists.sourceforge.net; Sun, 11 Aug 2013 05:18:07 +0000 Received-SPF: pass (sog-mx-1.v43.ch3.sourceforge.com: domain of coreos.com designates 209.85.212.51 as permitted sender) client-ip=209.85.212.51; envelope-from=michael.marineau@coreos.com; helo=mail-vb0-f51.google.com; Received: from mail-vb0-f51.google.com ([209.85.212.51]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1V8O2X-0007zM-TV for v9fs-developer@lists.sourceforge.net; Sun, 11 Aug 2013 05:18:07 +0000 Received: by mail-vb0-f51.google.com with SMTP id x16so4998617vbf.38 for ; Sat, 10 Aug 2013 22:17:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vp6Vt3O9SO3oJ/c3Ph04dnaPvHrDunZmFEmnj7imNV0=; b=EC//NH6BhGMfSK6aLDbN2/bSbAxbpDG0I+M+z3+gVzOvcF9t3CXrluO+tbddbhwbzX NAlEapDHP9KZzcRXrwsRGKt/Zw56aN8FYDl6gglT0aTkrnzPvjKIiSwrqMFKON89UaQf XYaP8JIkVEh6gaYx2FlxEi4VdOPN3m0mHSgdLmjtDhBVOIGEz+k7gb6/561reyjxjqX5 j17aiofj7kv06NSQVTBo/KmUcJMDXw5MdjWNzJcMR5Ceq0tcVu9ymmIdVWZFr1CDbLj4 dG9EzqKhS5tPpw1+HuN5bLDybOQUl9hHgExQ8cLbyDwZ9OZQGB+hjI1+hGo+ifA6L8vb U/VA== X-Gm-Message-State: ALoCoQkc4YqzonoJP/V4OUtiLObSyees2ijREjowPacgKlhJJq/gjxdjBiQDlbXGlcUQv8LXTmPs X-Received: by 10.220.162.135 with SMTP id v7mr10117530vcx.35.1376196850763; Sat, 10 Aug 2013 21:54:10 -0700 (PDT) Received: from kraken.kc.marineau.org (kc.marineau.org. [173.13.98.38]) by mx.google.com with ESMTPSA id dz7sm6436495vdc.5.2013.08.10.21.54.09 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 10 Aug 2013 21:54:10 -0700 (PDT) From: Michael Marineau To: Eric Van Hensbergen Date: Sun, 11 Aug 2013 00:53:45 -0400 Message-Id: <1376196825-19793-1-git-send-email-michael.marineau@coreos.com> X-Mailer: git-send-email 1.8.1.5 X-Spam-Score: -1.6 (-) X-Headers-End: 1V8O2X-0007zM-TV Cc: v9fs-developer@lists.sourceforge.net, Michael Marineau , linux-kernel@vger.kernel.org Subject: [V9fs-developer] [PATCH] 9p: send uevent after adding/removing mount_tag attribute X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This driver adds an attribute to the existing virtio device so a CHANGE event is required in order udev rules to make use of it. The ADD event happens before this driver is probed and unlike a more typical driver like a block device there isn't a higher level device to watch for. Signed-off-by: Michael Marineau --- net/9p/trans_virtio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index e1c26b1..990afab 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c @@ -577,6 +577,10 @@ static int p9_virtio_probe(struct virtio_device *vdev) mutex_lock(&virtio_9p_lock); list_add_tail(&chan->chan_list, &virtio_chan_list); mutex_unlock(&virtio_9p_lock); + + /* Let udev rules use the new mount_tag attribute. */ + kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE); + return 0; out_free_tag: @@ -654,6 +658,7 @@ static void p9_virtio_remove(struct virtio_device *vdev) list_del(&chan->chan_list); mutex_unlock(&virtio_9p_lock); sysfs_remove_file(&(vdev->dev.kobj), &dev_attr_mount_tag.attr); + kobject_uevent(&(vdev->dev.kobj), KOBJ_CHANGE); kfree(chan->tag); kfree(chan->vc_wq); kfree(chan);