Skip to content

Commit

Permalink
kill find_inode_number()
Browse files Browse the repository at this point in the history
the only remaining caller (in ncpfs) is guaranteed to return 0 -
we only hit it if we'd just checked that there's no dentry with
such name.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jun 29, 2013
1 parent 6b5e122 commit 0b3fca1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
29 changes: 0 additions & 29 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -2984,35 +2984,6 @@ void d_tmpfile(struct dentry *dentry, struct inode *inode)
}
EXPORT_SYMBOL(d_tmpfile);

/**
* find_inode_number - check for dentry with name
* @dir: directory to check
* @name: Name to find.
*
* Check whether a dentry already exists for the given name,
* and return the inode number if it has an inode. Otherwise
* 0 is returned.
*
* This routine is used to post-process directory listings for
* filesystems using synthetic inode numbers, and is necessary
* to keep getcwd() working.
*/

ino_t find_inode_number(struct dentry *dir, struct qstr *name)
{
struct dentry * dentry;
ino_t ino = 0;

dentry = d_hash_and_lookup(dir, name);
if (!IS_ERR_OR_NULL(dentry)) {
if (dentry->d_inode)
ino = dentry->d_inode->i_ino;
dput(dentry);
}
return ino;
}
EXPORT_SYMBOL(find_inode_number);

static __initdata unsigned long dhash_entries;
static int __init set_dhash_entries(char *str)
{
Expand Down
2 changes: 0 additions & 2 deletions fs/ncpfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,6 @@ ncp_fill_cache(struct file *file, struct dir_context *ctx,
if (!valid)
ctl.valid = 0;
if (!ctl.filled && (ctl.fpos == ctx->pos)) {
if (!ino)
ino = find_inode_number(dentry, &qname);
if (!ino)
ino = iunique(dir->i_sb, 2);
ctl.filled = !dir_emit(ctx, qname.name, qname.len,
Expand Down
1 change: 0 additions & 1 deletion include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,6 @@ extern struct file * open_exec(const char *);
/* fs/dcache.c -- generic fs support functions */
extern int is_subdir(struct dentry *, struct dentry *);
extern int path_is_under(struct path *, struct path *);
extern ino_t find_inode_number(struct dentry *, struct qstr *);

#include <linux/err.h>

Expand Down

0 comments on commit 0b3fca1

Please sign in to comment.