diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-20 03:05:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:11 -0400 |
commit | d6b4fd2faeb9ddf55ce09cf90b88981e579ee010 (patch) | |
tree | eb122aadde2b5e8fa2dcb2b800c6890d7fcb73b2 /fs | |
parent | b1fc3d6144d56360d1373b01c7881826f558b6cd (diff) |
sysfs: open code sysfs_attach_dentry()
sysfs_attach_dentry() now has only one caller and isn't doing much
other than obfuscating the code. Open code and kill it.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/sysfs/dir.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 6ee76a82eb38..48a3ed4f4537 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -332,21 +332,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type) | |||
332 | return NULL; | 332 | return NULL; |
333 | } | 333 | } |
334 | 334 | ||
335 | /** | ||
336 | * sysfs_attach_dentry - associate sysfs_dirent with dentry | ||
337 | * @sd: target sysfs_dirent | ||
338 | * @dentry: dentry to associate | ||
339 | * | ||
340 | * LOCKING: | ||
341 | * mutex_lock(sysfs_mutex) | ||
342 | */ | ||
343 | static void sysfs_attach_dentry(struct sysfs_dirent *sd, struct dentry *dentry) | ||
344 | { | ||
345 | dentry->d_op = &sysfs_dentry_ops; | ||
346 | dentry->d_fsdata = sysfs_get(sd); | ||
347 | d_rehash(dentry); | ||
348 | } | ||
349 | |||
350 | static int sysfs_ilookup_test(struct inode *inode, void *arg) | 335 | static int sysfs_ilookup_test(struct inode *inode, void *arg) |
351 | { | 336 | { |
352 | struct sysfs_dirent *sd = arg; | 337 | struct sysfs_dirent *sd = arg; |
@@ -696,8 +681,11 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, | |||
696 | goto out_unlock; | 681 | goto out_unlock; |
697 | } | 682 | } |
698 | 683 | ||
684 | /* instantiate and hash dentry */ | ||
685 | dentry->d_op = &sysfs_dentry_ops; | ||
686 | dentry->d_fsdata = sysfs_get(sd); | ||
699 | d_instantiate(dentry, inode); | 687 | d_instantiate(dentry, inode); |
700 | sysfs_attach_dentry(sd, dentry); | 688 | d_rehash(dentry); |
701 | 689 | ||
702 | out_unlock: | 690 | out_unlock: |
703 | mutex_unlock(&sysfs_mutex); | 691 | mutex_unlock(&sysfs_mutex); |