static struct dentry * bpf_lookup(struct inode *dir, struct dentry *dentry, unsigned flags) { if (strchr(dentry->d_name.name, '.')) return ERR_PTR(-EPERM); return simple_lookup(dir, dentry, flags); }
// FIXME: What if the identifier refers to a set of declarations? Decl& Parser::on_concept_name(Token tok) { Simple_id& id = build.get_id(tok); Decl& decl = simple_lookup(cxt, current_scope(), id); if (is<Concept_decl>(&decl)) return decl; throw Lookup_error("'{}' does not name a concept", id); }
Type& Parser::on_type_name(Token tok) { Simple_id& id = build.get_id(tok); Decl& decl = simple_lookup(cxt, current_scope(), id); if (Type* type = get_type_for_decl(cxt, decl)) return *type; throw Lookup_error("'{}' does not name a type", id); }
Type& Parser::on_type_alias(Token tok) { Simple_id& id = build.get_id(tok); Decl& decl = simple_lookup(cxt, current_scope(), id); if (Type_parm* d = as<Type_parm>(&decl)) return build.get_typename_type(*d); // TODO: Actually support type aliases. throw Lookup_error("'{}' does not name a type", id); }
struct dentry * sjfs_dir_iops_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) { printk("sjfs_dir_iops_lookup -> simple_lookup(\n"); if(dir) { printk("--- dir.ino:%lu\n", dir->i_ino); } else { printk("--- dir.ino:NULL\n"); } if(dentry && &(dentry->d_name) != NULL && (dentry->d_name).name != NULL) { printk("--- dentry.name: \"%s\"\n", (dentry->d_name).name); } else { printk("--- dentry.name: NULL\n"); } printk("--- flags: %#010hx);\n", flags); return simple_lookup(dir, dentry, flags); }