aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dir.c')
-rw-r--r--fs/ocfs2/dir.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c
index 4bb54406354b..4791683a119c 100644
--- a/fs/ocfs2/dir.c
+++ b/fs/ocfs2/dir.c
@@ -628,6 +628,23 @@ leave:
628 return status; 628 return status;
629} 629}
630 630
631/*
632 * Convenience function for callers which just want the block number
633 * mapped to a name and don't require the full dirent info, etc.
634 */
635int ocfs2_lookup_ino_from_name(struct inode *dir, const char *name,
636 int namelen, u64 *blkno)
637{
638 int ret;
639 struct buffer_head *bh = NULL;
640 struct ocfs2_dir_entry *dirent = NULL;
641
642 ret = ocfs2_find_files_on_disk(name, namelen, blkno, dir, &bh, &dirent);
643 brelse(bh);
644
645 return ret;
646}
647
631/* Check for a name within a directory. 648/* Check for a name within a directory.
632 * 649 *
633 * Return 0 if the name does not exist 650 * Return 0 if the name does not exist