mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[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>
This commit is contained in:
parent
ac20427ef6
commit
5f45f1a78f
8 changed files with 12 additions and 46 deletions
|
@ -453,17 +453,6 @@ static int usbfs_fill_super(struct super_block *sb, void *data, int silent)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct dentry * get_dentry(struct dentry *parent, const char *name)
|
||||
{
|
||||
struct qstr qstr;
|
||||
|
||||
qstr.name = name;
|
||||
qstr.len = strlen(name);
|
||||
qstr.hash = full_name_hash(name,qstr.len);
|
||||
return lookup_hash(&qstr,parent);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* fs_create_by_name - create a file, given a name
|
||||
* @name: name of file
|
||||
|
@ -496,7 +485,7 @@ static int fs_create_by_name (const char *name, mode_t mode,
|
|||
|
||||
*dentry = NULL;
|
||||
down(&parent->d_inode->i_sem);
|
||||
*dentry = get_dentry (parent, name);
|
||||
*dentry = lookup_one_len(name, parent, strlen(name));
|
||||
if (!IS_ERR(dentry)) {
|
||||
if ((mode & S_IFMT) == S_IFDIR)
|
||||
error = usbfs_mkdir (parent->d_inode, *dentry, mode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue