blob: 401e8082006c534499a977870df50a37b9a1a21d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
/* $Id: namei.h,v 1.11 1998/01/15 12:58:24 jj Exp $
* linux/include/asm-sparc/namei.h
*
* Routines to handle famous /usr/gnemul/s*.
* Included from linux/fs/namei.c
*/
#ifndef __SPARC_NAMEI_H
#define __SPARC_NAMEI_H
#define SPARC_BSD_EMUL "usr/gnemul/sunos/"
#define SPARC_SOL_EMUL "usr/gnemul/solaris/"
static inline struct dentry *
__sparc_lookup_dentry(const char *name, int follow_link)
{
struct dentry *base;
char *emul;
switch (current->personality) {
#if 0
/* Until we solve, why SunOS apps sometime crash, disable gnemul support for SunOS */
case PER_BSD:
emul = SPARC_BSD_EMUL; break;
#endif
case PER_SVR4:
emul = SPARC_SOL_EMUL; break;
default:
return NULL;
}
base = lookup_dentry (emul, dget (current->fs->root), 1);
if (IS_ERR (base)) return NULL;
base = lookup_dentry (name, base, follow_link);
if (IS_ERR (base)) return NULL;
if (!base->d_inode) {
struct dentry *fromroot;
fromroot = lookup_dentry (name, dget (current->fs->root), follow_link);
if (IS_ERR (fromroot)) return base;
if (fromroot->d_inode) {
dput(base);
return fromroot;
}
dput(fromroot);
}
return base;
}
#define __prefix_lookup_dentry(name, follow_link) \
if (current->personality) { \
dentry = __sparc_lookup_dentry (name, follow_link); \
if (dentry) return dentry; \
}
#endif /* __SPARC_NAMEI_H */
|