From: Hiroshi Doyu <hdoyu@nvidia.com>
To: Hiroshi Doyu <hdoyu@nvidia.com>
Cc: <iommu@lists.linux-foundation.org>, <linux-tegra@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] debugfs: Allow debugfs_create_dir() to take data
Date: Wed, 8 Aug 2012 09:24:32 +0300 [thread overview]
Message-ID: <1344407073-12030-2-git-send-email-hdoyu@nvidia.com> (raw)
In-Reply-To: <1344407073-12030-1-git-send-email-hdoyu@nvidia.com>
Add __debugfs_create_dir(), which takes data passed from caller.
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
fs/debugfs/inode.c | 7 ++++---
include/linux/debugfs.h | 9 ++++++++-
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 4733eab..423df9f 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -387,7 +387,7 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode,
EXPORT_SYMBOL_GPL(debugfs_create_file);
/**
- * debugfs_create_dir - create a directory in the debugfs filesystem
+ * __debugfs_create_dir - create a directory in the debugfs filesystem
* @name: a pointer to a string containing the name of the directory to
* create.
* @parent: a pointer to the parent dentry for this file. This should be a
@@ -404,10 +404,11 @@ EXPORT_SYMBOL_GPL(debugfs_create_file);
* If debugfs is not enabled in the kernel, the value -%ENODEV will be
* returned.
*/
-struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)
+struct dentry *__debugfs_create_dir(const char *name, struct dentry *parent,
+ void *data)
{
return __create_file(name, S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
- parent, NULL, NULL);
+ parent, data, NULL);
}
EXPORT_SYMBOL_GPL(debugfs_create_dir);
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 66c434f..4ba9f0a 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -50,7 +50,14 @@ struct dentry *debugfs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data,
const struct file_operations *fops);
-struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
+struct dentry *__debugfs_create_dir(const char *name, struct dentry *parent,
+ void *data);
+
+static inline struct dentry *debugfs_create_dir(const char *name,
+ struct dentry *parent)
+{
+ return __debugfs_create_dir(name, parent, NULL);
+}
struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
const char *dest);
--
1.7.5.4
next parent reply other threads:[~2012-08-08 6:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1344407073-12030-1-git-send-email-hdoyu@nvidia.com>
2012-08-08 6:24 ` Hiroshi Doyu [this message]
2012-08-08 13:34 ` Greg Kroah-Hartman
2012-08-09 12:56 ` Hiroshi Doyu
2012-08-15 5:40 ` Hiroshi Doyu
2012-08-15 13:40 ` Greg Kroah-Hartman
[not found] ` <1345009652-13408-1-git-send-email-hdoyu@nvidia.com>
[not found] ` <502BCA9E.5090206@wwwdotorg.org>
2012-09-04 6:51 ` [v2 1/1] iommu/tegra: smmu: Use debugfs_create_dir for directory Hiroshi Doyu
2012-09-10 18:24 ` Stephen Warren
2012-09-17 16:28 ` joerg.roedel
2012-08-08 6:24 ` [PATCH 2/2] iommu/tegra: smmu: Use __debugfs_create_dir Hiroshi Doyu
2012-08-08 15:11 ` Felipe Balbi
2012-08-08 15:31 ` Felipe Balbi
2012-08-15 6:34 ` Hiroshi Doyu
2012-08-15 7:07 ` Felipe Balbi
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=1344407073-12030-2-git-send-email-hdoyu@nvidia.com \
--to=hdoyu@nvidia.com \
--cc=gregkh@linuxfoundation.org \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome