aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-06-23 03:09:12 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:20 -0400
commit5f45f1a78fbac3cc859ec10c5366e97d20d40fa2 (patch)
treebafacf11adbfb4eebf2d2d80d92e1fe2d9c02b18 /fs/sysfs/file.c
parentac20427ef6aa63da663bdc88b71d16f7394f5e23 (diff)
[PATCH] remove duplicate get_dentry functions in various places
Various filesystem drivers have grown a get_dentry() function that's a duplicate of lookup_one_len, except that it doesn't take a maximum length argument and doesn't check for \0 or / in the passed in filename. Switch all these places to use lookup_one_len. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Greg KH <greg@kroah.com> Cc: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r--fs/sysfs/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 849aac115460..e9cfa39f4099 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -5,6 +5,7 @@
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/dnotify.h> 6#include <linux/dnotify.h>
7#include <linux/kobject.h> 7#include <linux/kobject.h>
8#include <linux/namei.h>
8#include <asm/uaccess.h> 9#include <asm/uaccess.h>
9#include <asm/semaphore.h> 10#include <asm/semaphore.h>
10 11
@@ -400,7 +401,7 @@ int sysfs_update_file(struct kobject * kobj, const struct attribute * attr)
400 int res = -ENOENT; 401 int res = -ENOENT;
401 402
402 down(&dir->d_inode->i_sem); 403 down(&dir->d_inode->i_sem);
403 victim = sysfs_get_dentry(dir, attr->name); 404 victim = lookup_one_len(attr->name, dir, strlen(attr->name));
404 if (!IS_ERR(victim)) { 405 if (!IS_ERR(victim)) {
405 /* make sure dentry is really there */ 406 /* make sure dentry is really there */
406 if (victim->d_inode && 407 if (victim->d_inode &&
@@ -443,7 +444,7 @@ int sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode)
443 int res = -ENOENT; 444 int res = -ENOENT;
444 445
445 down(&dir->d_inode->i_sem); 446 down(&dir->d_inode->i_sem);
446 victim = sysfs_get_dentry(dir, attr->name); 447 victim = lookup_one_len(attr->name, dir, strlen(attr->name));
447 if (!IS_ERR(victim)) { 448 if (!IS_ERR(victim)) {
448 if (victim->d_inode && 449 if (victim->d_inode &&
449 (victim->d_parent->d_inode == dir->d_inode)) { 450 (victim->d_parent->d_inode == dir->d_inode)) {