Search Linux Wireless

[PATCH] mac80211: use debugfs_rename

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

 



Use the new debugfs_rename function in mac80211's debugfs where
necessary.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

---
debugfs_rename hasn't actually been merged yet, but I hope it will be
merged soon. URL is
http://article.gmane.org/gmane.linux.file-systems/14819

This patch should also apply against net-2.6

 net/mac80211/debugfs_netdev.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- wireless-dev.orig/net/mac80211/debugfs_netdev.c	2007-05-21 17:59:03.538418048 +0200
+++ wireless-dev/net/mac80211/debugfs_netdev.c	2007-05-21 18:03:31.768418048 +0200
@@ -398,6 +398,8 @@ static int netdev_notify(struct notifier
 {
 	struct net_device *dev = ndev;
 	char buf[10+IFNAMSIZ];
+	struct dentry *dir;
+	struct ieee80211_sub_if_data *sdata;
 
 	if (state != NETDEV_CHANGENAME)
 		return 0;
@@ -408,10 +410,12 @@ static int netdev_notify(struct notifier
 	if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid)
 		return 0;
 
-	/* TODO
 	sprintf(buf, "netdev:%s", dev->name);
-	debugfs_rename(IEEE80211_DEV_TO_SUB_IF(dev)->debugfsdir, buf);
-	*/
+	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+	dir = sdata->debugfsdir;
+	if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
+		printk(KERN_ERR "mac80211: debugfs: failed to rename debugfs "
+		       "dir to %s\n", buf);
 
 	return 0;
 }


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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux