From: Pavel Roskin <proski@gnu.org>
To: "Luis R. Rodriguez" <mcgrof@gmail.com>, linux-wireless@vger.kernel.org
Subject: [PATCH] compat: move debugfs_remove_recursive() to compat-2.6.27
Date: Fri, 19 Feb 2010 19:09:21 -0500 [thread overview]
Message-ID: <20100220000921.15525.55155.stgit@mj.roinet.com> (raw)
debugfs_remove_recursive() appeared in Linux 2.6.27, so it should be in
compat-2.6.27, not in compat-2.6.26.
---
compat/compat-2.6.26.c | 32 --------------------------------
compat/compat-2.6.27.c | 33 +++++++++++++++++++++++++++++++++
include/linux/compat-2.6.26.h | 7 -------
include/linux/compat-2.6.27.h | 9 +++++++++
4 files changed, 42 insertions(+), 39 deletions(-)
diff --git a/compat/compat-2.6.26.c b/compat/compat-2.6.26.c
index 82134c2..b9bf9e7 100644
--- a/compat/compat-2.6.26.c
+++ b/compat/compat-2.6.26.c
@@ -89,37 +89,5 @@ int dev_set_name(struct device *dev, const char *fmt, ...)
}
EXPORT_SYMBOL_GPL(dev_set_name);
-/*
- * Backport of debugfs_remove_recursive() without using the internals globals
- * which are used by the kernel's version with:
- * simple_release_fs(&debugfs_mount, &debugfs_mount_count);
- */
-void debugfs_remove_recursive(struct dentry *dentry)
-{
- struct dentry *last = NULL;
-
- /* Sanity checks */
- if (!dentry || !dentry->d_parent || !dentry->d_parent->d_inode)
- return;
-
- while (dentry != last) {
- struct dentry *child = dentry;
-
- /* Find a child without children */
- while (!list_empty(&child->d_subdirs))
- child = list_entry(child->d_subdirs.next,
- struct dentry,
- d_u.d_child);
-
- /* Bail out if we already tried to remove that entry */
- if (child == last)
- return;
-
- last = child;
- debugfs_remove(child);
- }
-}
-EXPORT_SYMBOL_GPL(debugfs_remove_recursive);
-
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) */
diff --git a/compat/compat-2.6.27.c b/compat/compat-2.6.27.c
index 4fef36a..a226a0f 100644
--- a/compat/compat-2.6.27.c
+++ b/compat/compat-2.6.27.c
@@ -12,6 +12,7 @@
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27))
+#include <linux/debugfs.h>
#include <linux/pci.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24))
#include <linux/mmc/sdio.h>
@@ -206,6 +207,38 @@ unsigned int sdio_align_size(struct sdio_func *func, unsigned int sz)
EXPORT_SYMBOL_GPL(sdio_align_size);
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) */
+/*
+ * Backport of debugfs_remove_recursive() without using the internals globals
+ * which are used by the kernel's version with:
+ * simple_release_fs(&debugfs_mount, &debugfs_mount_count);
+ */
+void debugfs_remove_recursive(struct dentry *dentry)
+{
+ struct dentry *last = NULL;
+
+ /* Sanity checks */
+ if (!dentry || !dentry->d_parent || !dentry->d_parent->d_inode)
+ return;
+
+ while (dentry != last) {
+ struct dentry *child = dentry;
+
+ /* Find a child without children */
+ while (!list_empty(&child->d_subdirs))
+ child = list_entry(child->d_subdirs.next,
+ struct dentry,
+ d_u.d_child);
+
+ /* Bail out if we already tried to remove that entry */
+ if (child == last)
+ return;
+
+ last = child;
+ debugfs_remove(child);
+ }
+}
+EXPORT_SYMBOL_GPL(debugfs_remove_recursive);
+
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) */
diff --git a/include/linux/compat-2.6.26.h b/include/linux/compat-2.6.26.h
index 498fe44..d98d2a6 100644
--- a/include/linux/compat-2.6.26.h
+++ b/include/linux/compat-2.6.26.h
@@ -18,13 +18,6 @@
#include <linux/fs.h>
#include <linux/types.h>
-#if defined(CONFIG_DEBUG_FS)
-void debugfs_remove_recursive(struct dentry *dentry);
-#else
-static inline void debugfs_remove_recursive(struct dentry *dentry)
-{ }
-#endif
-
/* These jiffie helpers added as of 2.6.26 */
/*
diff --git a/include/linux/compat-2.6.27.h b/include/linux/compat-2.6.27.h
index e9de41e..72b6847 100644
--- a/include/linux/compat-2.6.27.h
+++ b/include/linux/compat-2.6.27.h
@@ -214,4 +214,13 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)) */
+struct dentry;
+
+#if defined(CONFIG_DEBUG_FS)
+void debugfs_remove_recursive(struct dentry *dentry);
+#else
+static inline void debugfs_remove_recursive(struct dentry *dentry)
+{ }
+#endif
+
#endif /* LINUX_26_27_COMPAT_H */
next reply other threads:[~2010-02-20 0:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-20 0:09 Pavel Roskin [this message]
2010-02-20 0:37 ` [PATCH v2] compat: move debugfs_remove_recursive() to compat-2.6.27 Pavel Roskin
2010-02-20 1:17 ` [PATCH v3] " Pavel Roskin
2010-02-20 2:36 ` Luis R. Rodriguez
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=20100220000921.15525.55155.stgit@mj.roinet.com \
--to=proski@gnu.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mcgrof@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.