Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758594AbYFXGuU (ORCPT ); Tue, 24 Jun 2008 02:50:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757601AbYFXGty (ORCPT ); Tue, 24 Jun 2008 02:49:54 -0400 Received: from relay.2ka.mipt.ru ([194.85.82.65]:38605 "EHLO 2ka.mipt.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756541AbYFXGtx (ORCPT ); Tue, 24 Jun 2008 02:49:53 -0400 Date: Tue, 24 Jun 2008 10:49:53 +0400 From: Evgeniy Polyakov To: Li Zefan Cc: David Miller , LKML , netdev@vger.kernel.org Subject: Re: [PATCH] CONNECTOR: add a proc entry to list connectors Message-ID: <20080624064953.GA1736@2ka.mipt.ru> References: <48604E44.5040402@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48604E44.5040402@cn.fujitsu.com> User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1405 Lines: 45 Hi. On Tue, Jun 24, 2008 at 09:30:44AM +0800, Li Zefan (lizf@cn.fujitsu.com) wrote: > I got a problem when I wanted to check if the kernel supports process > event connector, and It seems there's no way to do this check. > > At best I can check if the kernel supports connector or not, by looking > into /proc/net/netlink, or maybe checking the return value of bind() to > see if it's ENOENT. > > So how about add /proc/net/connector to list all supported connectors? > # cat /proc/net/connector > Name ID > connector 4294967295:4294967295 > cn_proc 1:1 > w1 3:1 I like the idea, but if it is not appropriate way, I can extend connector core itself so it will support not only add/remove notification of added/removed users, but will also allow to query if given user exists. > Signed-off-by: Li Zefan Ack. > +static int cn_proc_show(struct seq_file *m, void *v) > +{ > + struct cn_queue_dev *dev = cdev.cbdev; > + struct cn_callback_entry *cbq; > + unsigned long flags; > + > + seq_printf(m, "Name ID\n"); > + > + spin_lock_irqsave(&dev->queue_lock, flags); It can be BH lock only. -- Evgeniy Polyakov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/