Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * QNX6 file system, Linux implementation.
0004  *
0005  * Version : 1.0.0
0006  *
0007  * History :
0008  *
0009  * 01-02-2012 by Kai Bankett (chaosman@ontika.net) : first release.
0010  * 16-02-2012 pagemap extension by Al Viro
0011  *
0012  */
0013 
0014 #include "qnx6.h"
0015 
0016 struct dentry *qnx6_lookup(struct inode *dir, struct dentry *dentry,
0017                 unsigned int flags)
0018 {
0019     unsigned ino;
0020     struct page *page;
0021     struct inode *foundinode = NULL;
0022     const char *name = dentry->d_name.name;
0023     int len = dentry->d_name.len;
0024 
0025     if (len > QNX6_LONG_NAME_MAX)
0026         return ERR_PTR(-ENAMETOOLONG);
0027 
0028     ino = qnx6_find_entry(len, dir, name, &page);
0029     if (ino) {
0030         foundinode = qnx6_iget(dir->i_sb, ino);
0031         qnx6_put_page(page);
0032         if (IS_ERR(foundinode))
0033             pr_debug("lookup->iget ->  error %ld\n",
0034                  PTR_ERR(foundinode));
0035     } else {
0036         pr_debug("%s(): not found %s\n", __func__, name);
0037     }
0038     return d_splice_alias(foundinode, dentry);
0039 }