diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-01-27 01:05:20 +0000 |
commit | 546db14ee74118296f425f3b91634fb767d67290 (patch) | |
tree | 22b613a3da8d4bf663eec5e155af01b87fdf9094 /include/asm-arm/namei.h | |
parent | 1e25e41c4f5474e14452094492dbc169b800e4c8 (diff) |
Merge with Linux 2.3.23. The new bootmem stuff has broken various
platforms. At this time I've only verified that IP22 support compiles
and IP27 actually works.
Diffstat (limited to 'include/asm-arm/namei.h')
-rw-r--r-- | include/asm-arm/namei.h | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/include/asm-arm/namei.h b/include/asm-arm/namei.h index 858f400b6..082f2c910 100644 --- a/include/asm-arm/namei.h +++ b/include/asm-arm/namei.h @@ -1,18 +1,62 @@ /* * linux/include/asm-arm/namei.h * + * Routines to handle famous /usr/gnemul + * Derived from the Sparc version of this file + * * Included from linux/fs/namei.c */ #ifndef __ASMARM_NAMEI_H #define __ASMARM_NAMEI_H -/* This dummy routine maybe changed to something useful - * for /usr/gnemul/ emulation stuff. - * Look at asm-sparc/namei.h for details. - */ +#define ARM_BSD_EMUL "usr/gnemul/bsd/" + +static inline struct dentry * +__arm_lookup_dentry(const char *name, int lookup_flags) +{ + struct dentry *base; + char *emul; + + switch (current->personality) { + case PER_BSD: + emul = ARM_BSD_EMUL; break; + default: + return NULL; + } + + base = lookup_dentry (emul, dget (current->fs->root), + (LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_SLASHOK)); + + if (IS_ERR (base)) return NULL; + + base = lookup_dentry (name, base, lookup_flags); + + if (IS_ERR (base)) return NULL; + + if (!base->d_inode) { + struct dentry *fromroot; + + fromroot = lookup_dentry (name, dget (current->fs->root), + lookup_flags); + + if (IS_ERR (fromroot)) return base; + + if (fromroot->d_inode) { + dput(base); + return fromroot; + } + + dput(fromroot); + } + + return base; +} -#define __prefix_lookup_dentry(name, lookup_flags) \ - do {} while (0) +#define __prefix_lookup_dentry(name, lookup_flags) \ + if (current->personality) { \ + dentry = __arm_lookup_dentry (name, lookup_flags); \ + if (dentry) return dentry; \ + } #endif /* __ASMARM_NAMEI_H */ |