public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <miklos@szeredi.hu>
To: viro@ZenIV.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>
Subject: [PATCH 3/7] ia64: perfmon: add d_dname method
Date: Tue, 10 Aug 2010 11:41:37 +0200	[thread overview]
Message-ID: <20100810094326.557856708@szeredi.hu> (raw)
In-Reply-To: 20100810094134.596235651@szeredi.hu

[-- Attachment #1: vfs-add-d_dname-method.patch --]
[-- Type: text/plain, Size: 1588 bytes --]

From: Miklos Szeredi <mszeredi@suse.cz>

Switch ia64/perfmon to using the d_dname() instead of relying on
__d_path() to prepend the name of the root dentry to the path.

CC: Tony Luck <tony.luck@intel.com>
CC: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
 arch/ia64/kernel/perfmon.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

Index: linux-2.6/arch/ia64/kernel/perfmon.c
===================================================================
--- linux-2.6.orig/arch/ia64/kernel/perfmon.c	2010-07-06 17:59:04.000000000 +0200
+++ linux-2.6/arch/ia64/kernel/perfmon.c	2010-07-06 18:08:09.000000000 +0200
@@ -2191,8 +2191,15 @@ pfmfs_delete_dentry(struct dentry *dentr
 	return 1;
 }
 
+static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)
+{
+	return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]",
+			     dentry->d_inode->i_ino);
+}
+
 static const struct dentry_operations pfmfs_dentry_operations = {
 	.d_delete = pfmfs_delete_dentry,
+	.d_dname = pfmfs_dname,
 };
 
 
@@ -2202,8 +2209,7 @@ pfm_alloc_file(pfm_context_t *ctx)
 	struct file *file;
 	struct inode *inode;
 	struct path path;
-	char name[32];
-	struct qstr this;
+	struct qstr this = { .name = "" };
 
 	/*
 	 * allocate a new inode
@@ -2218,11 +2224,6 @@ pfm_alloc_file(pfm_context_t *ctx)
 	inode->i_uid  = current_fsuid();
 	inode->i_gid  = current_fsgid();
 
-	sprintf(name, "[%lu]", inode->i_ino);
-	this.name = name;
-	this.len  = strlen(name);
-	this.hash = inode->i_ino;
-
 	/*
 	 * allocate a new dcache entry
 	 */

-- 

  parent reply	other threads:[~2010-08-10  9:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10  9:41 [PATCH 0/7] dcache fixes and cleanups Miklos Szeredi
2010-08-10  9:41 ` [PATCH 1/7] cachefiles: use path_get instead of lone dget Miklos Szeredi
2010-08-10  9:41 ` [PATCH 2/7] vfs: add helpers to get root and pwd Miklos Szeredi
2010-08-10  9:41 ` Miklos Szeredi [this message]
2010-08-10  9:41 ` [PATCH 4/7] vfs: __d_path: dont prepend the name of the root dentry Miklos Szeredi
2010-08-10  9:41 ` [PATCH 5/7] vfs: add prepend_path() helper Miklos Szeredi
2010-08-10  9:41 ` [PATCH 6/7] vfs: only add " (deleted)" where necessary Miklos Szeredi
2010-08-10  9:41 ` [PATCH 7/7] vfs: show unreachable paths in getcwd and proc Miklos Szeredi
  -- strict thread matches above, loose matches on Subject: below --
2010-08-02 11:19 [PATCH 0/7] dcache fixes and cleanups Miklos Szeredi
2010-08-02 11:19 ` [PATCH 3/7] ia64: perfmon: add d_dname method Miklos Szeredi
2010-07-06 17:40 [PATCH 0/7] dcache fixes and cleanups Miklos Szeredi
2010-07-06 17:40 ` [PATCH 3/7] ia64: perfmon: add d_dname method Miklos Szeredi

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=20100810094326.557856708@szeredi.hu \
    --to=miklos@szeredi.hu \
    --cc=fenghua.yu@intel.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --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