Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385Ab0HBLU0 (ORCPT ); Mon, 2 Aug 2010 07:20:26 -0400 Received: from fxip-0047f.externet.hu ([88.209.222.127]:42493 "EHLO pomaz-ex.szeredi.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275Ab0HBLUX (ORCPT ); Mon, 2 Aug 2010 07:20:23 -0400 Message-Id: <20100802112017.554748935@szeredi.hu> References: <20100802111955.025275647@szeredi.hu> User-Agent: quilt/0.46-1 Date: Mon, 02 Aug 2010 13:19:58 +0200 From: Miklos Szeredi To: viro@ZenIV.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Luck , Fenghua Yu Subject: [PATCH 3/7] ia64: perfmon: add d_dname method Content-Disposition: inline; filename=vfs-add-d_dname-method.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1833 Lines: 61 From: Miklos Szeredi 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 CC: Fenghua Yu Signed-off-by: Miklos Szeredi --- 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 */ -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/