Re: [RFC bluetooth-next 1/4] 6lowpan: add debugfs support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 11, 2015 at 06:14:36PM +0100, Alexander Aring wrote:
...
> +config 6LOWPAN_DEBUGFS
> +	bool "6LoWPAN debugfs support"
> +	depends on 6LOWPAN

missing:

depends on DEBUG_FS

> +	---help---
> +	  This enables 6LoWPAN debugfs support. For example to manipulate
> +	  IPHC context information at runtime.
> +
>  menuconfig 6LOWPAN_NHC
>  	tristate "Next Header Compression Support"
>  	depends on 6LOWPAN
> diff --git a/net/6lowpan/Makefile b/net/6lowpan/Makefile
> index c6ffc55..54cad8d 100644
> --- a/net/6lowpan/Makefile
> +++ b/net/6lowpan/Makefile
> @@ -1,6 +1,7 @@
>  obj-$(CONFIG_6LOWPAN) += 6lowpan.o
>  
>  6lowpan-y := core.o iphc.o nhc.o
> +6lowpan-$(CONFIG_6LOWPAN_DEBUGFS) += debugfs.o
...
> +
> +int lowpan_dev_debugfs_init(struct net_device *dev)
> +{
> +	static struct dentry *iface;
> +
> +	/* creating the root */
> +	iface = debugfs_create_dir(dev->name, lowpan_debugfs);
> +	if (!iface)
> +		goto fail;
> +
> +	return 0;
> +
> +fail:
> +	lowpan_debugfs_exit();

This is broken, this will delete everything also the
"$DEBUGFS_MOUNTPOINT/6lowpan" directory. What we need is a
debugfs_remove_recursive(iface); call here, which deletes everything
which is registered at iface dentry.

Also we need to call this when a lowpan interface will be unregistered,
otherwise we have still the debugfs entries when an interface doesn't
exist anymore.

I will fix this issues for the next try.

- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux