From c212f73d340a25fd1d8faa6c1bc1461d44450d49 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 20 Sep 2007 16:05:11 +0900 Subject: [PATCH] --- yaml --- r: 67995 b: refs/heads/master c: d6b4fd2faeb9ddf55ce09cf90b88981e579ee010 h: refs/heads/master i: 67993: 9d0452c3079510d07982c62035f907ed69c32fdc 67991: 2ae88a3c272e82391fe72f25ba46d93cb65e18ed v: v3 --- [refs] | 2 +- trunk/fs/sysfs/dir.c | 20 ++++---------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 0b96fe296669..c35d1097d0ec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1fc3d6144d56360d1373b01c7881826f558b6cd +refs/heads/master: d6b4fd2faeb9ddf55ce09cf90b88981e579ee010 diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c index 6ee76a82eb38..48a3ed4f4537 100644 --- a/trunk/fs/sysfs/dir.c +++ b/trunk/fs/sysfs/dir.c @@ -332,21 +332,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type) return NULL; } -/** - * sysfs_attach_dentry - associate sysfs_dirent with dentry - * @sd: target sysfs_dirent - * @dentry: dentry to associate - * - * LOCKING: - * mutex_lock(sysfs_mutex) - */ -static void sysfs_attach_dentry(struct sysfs_dirent *sd, struct dentry *dentry) -{ - dentry->d_op = &sysfs_dentry_ops; - dentry->d_fsdata = sysfs_get(sd); - d_rehash(dentry); -} - static int sysfs_ilookup_test(struct inode *inode, void *arg) { struct sysfs_dirent *sd = arg; @@ -696,8 +681,11 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, goto out_unlock; } + /* instantiate and hash dentry */ + dentry->d_op = &sysfs_dentry_ops; + dentry->d_fsdata = sysfs_get(sd); d_instantiate(dentry, inode); - sysfs_attach_dentry(sd, dentry); + d_rehash(dentry); out_unlock: mutex_unlock(&sysfs_mutex);