Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[linux-block.git] / fs / qnx6 / namei.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
5d026c72
KB
2/*
3 * QNX6 file system, Linux implementation.
4 *
5 * Version : 1.0.0
6 *
7 * History :
8 *
9 * 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
10 * 16-02-2012 pagemap extension by Al Viro
11 *
12 */
13
14#include "qnx6.h"
15
16struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry,
00cd8dd3 17 unsigned int flags)
5d026c72
KB
18{
19 unsigned ino;
5d026c72
KB
20 struct inode *foundinode = NULL;
21 const char *name = dentry->d_name.name;
22 int len = dentry->d_name.len;
23
24 if (len > QNX6_LONG_NAME_MAX)
25 return ERR_PTR(-ENAMETOOLONG);
26
5563040e 27 ino = qnx6_find_ino(len, dir, name);
5d026c72
KB
28 if (ino) {
29 foundinode = qnx6_iget(dir->i_sb, ino);
c1481700 30 if (IS_ERR(foundinode))
fa5a7a41
FF
31 pr_debug("lookup->iget -> error %ld\n",
32 PTR_ERR(foundinode));
5d026c72 33 } else {
fa5a7a41 34 pr_debug("%s(): not found %s\n", __func__, name);
5d026c72 35 }
c1481700 36 return d_splice_alias(foundinode, dentry);
5d026c72 37}