diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-09-12 01:29:55 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-09-12 01:29:55 +0000 |
commit | 545f435ebcfd94a1e7c20b46efe81b4d6ac4e698 (patch) | |
tree | e9ce4bc598d06374bda906f18365984bf22a526a /include/asm-sparc64/namei.h | |
parent | 4291a610eef89d0d5c69d9a10ee6560e1aa36c74 (diff) |
Merge with Linux 2.1.55. More bugfixes and goodies from my private
CVS archive.
Diffstat (limited to 'include/asm-sparc64/namei.h')
-rw-r--r-- | include/asm-sparc64/namei.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h index e80c11979..70d0f337f 100644 --- a/include/asm-sparc64/namei.h +++ b/include/asm-sparc64/namei.h @@ -1,4 +1,4 @@ -/* $Id: namei.h,v 1.5 1997/07/17 02:24:28 davem Exp $ +/* $Id: namei.h,v 1.8 1997/09/06 02:25:27 davem Exp $ * linux/include/asm-sparc64/namei.h * * Routines to handle famous /usr/gnemul/s*. @@ -11,40 +11,39 @@ #define SPARC_BSD_EMUL "usr/gnemul/sunos/" #define SPARC_SOL_EMUL "usr/gnemul/solaris/" -#if 0 /* XXX FIXME */ -extern int __namei(int, const char *, struct inode *, char *, struct inode **, - struct inode **, struct qstr *, struct dentry **, int *); - -static inline int -__prefix_namei(int retrieve_mode, const char * name, struct inode * base, - char * buf, struct inode ** res_dir, struct inode ** res_inode, - struct qstr * last_name, struct dentry ** last_entry, - int * last_error) +static inline struct dentry * +__sparc64_lookup_dentry(const char *name, int follow_link) { - int error; - - if (!(current->personality & (PER_BSD|PER_SVR4))) - return -ENOENT; - - while (*name == '/') - name++; - - atomic_inc(¤t->fs->root->i_count); - error = __namei(NAM_FOLLOW_LINK, - current->personality & PER_BSD ? - SPARC_BSD_EMUL : SPARC_SOL_EMUL, current->fs->root, - buf, NULL, &base, NULL, NULL, NULL); - if (error) - return error; - - error = __namei(retrieve_mode, name, base, buf, res_dir, res_inode, - last_name, last_entry, last_error); - if (error) - return error; - - return 0; + struct dentry *base; + + switch (current->personality) { + case PER_BSD: + case PER_SVR4: + break; + default: + return ERR_PTR(-ENOENT); + } + + base = lookup_dentry ((current->personality == PER_BSD) ? + SPARC_BSD_EMUL : SPARC_SOL_EMUL, + dget (current->fs->root), 1); + + if (IS_ERR (base)) return base; + + base = lookup_dentry (name, base, follow_link); + + if (IS_ERR (base)) return base; + + if (!base->d_inode) { + dput(base); + return ERR_PTR(-ENOENT); + } + + return base; } -#endif /* XXX FIXME */ +#define __prefix_lookup_dentry(name, follow_link) \ + dentry = __sparc64_lookup_dentry (name, follow_link); \ + if (!IS_ERR (dentry)) return dentry; #endif /* __SPARC64_NAMEI_H */ |