typedef unsigned int fsblkcnt_t;
#endif
-#ifdef AFS_AFSDB_ENV
#include <arpa/nameser.h>
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#include <arpa/nameser_compat.h>
#endif
#include <resolv.h>
-#endif /* AFS_AFSDB_ENV */
/* glibc 2.2 has pthread_attr_setstacksize */
#if (defined(AFS_LINUX22_ENV) && !defined(AFS_USR_LINUX22_ENV)) || (defined(AFS_USR_LINUX22_ENV) && (__GLIBC_MINOR__ < 2))
#define vattr usr_vattr
#define buf usr_buf
#define statfs usr_statfs
-#define ucred usr_ucred
+/* #define ucred usr_ucred */
#define user usr_user
-#define proc usr_proc
+/* #define proc usr_proc */
#define file usr_file
#define dirent usr_dirent
#define flock usr_flock
#define fid usr_fid
#define sysent usr_sysent
+#define ifaddr usr_ifaddr
+#define ifnet usr_ifnet
#define in_ifaddr usr_in_ifaddr
-#define ifaddr usr_ifaddr
-#define ifnet usr_ifnet
#define socket usr_socket
#define crget usr_crget
#define crcopy usr_crcopy
#ifdef VFIFO
#undef VFIFO
#endif
-#ifdef VDOOR
-#undef VDOOR
-#endif
-#ifdef VBAD
-#undef VBAD
-#endif
#ifdef VSOCK
#undef VSOCK
#endif
-#define VNON 0
-#define VREG 1
-#define VDIR 2
-#define VBLK 3
-#define VCHR 4
-#define VLNK 5
-#define VFIFO 6
-#define VDOOR 7
-#define VBAD 8
-#define VSOCK 9
+#define VNON 0
+#define VREG S_IFREG
+#define VDIR S_IFDIR
+#define VBLK S_IFBLK
+#define VCHR S_IFCHR
+#define VLNK S_IFLNK
+#define VSOCK S_IFSOCK
+#define VFIFO S_IFIFO
typedef int usr_vtype_t;
pthread_attr_t attr; \
assert(pthread_attr_init(&attr) == 0); \
assert(pthread_attr_setstacksize(&attr, 124288) == 0); \
- assert(pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) == 0); \
assert(pthread_create((A), &attr, (B), (void *)(C)) == 0); \
assert(pthread_attr_destroy(&attr) == 0); \
} while(0)
+#define usr_thread_join(A,B) pthread_join(A, B)
#define usr_thread_detach(A) pthread_detach(A)
#define usr_keycreate(A,B) assert(pthread_key_create(A,B) == 0)
#define usr_setspecific(A,B) pthread_setspecific(A,B)
AFS_ASSERT_GLOCK(); \
usr_assert((vp)->v_count > 0); \
if (--((vp)->v_count) == 0) \
- afs_inactive(VTOAFS(vp), u.u_cred); \
+ afs_inactive(VTOAFS(vp), get_user_struct()->u_cred); \
} while(0)
struct usr_statfs {
extern struct usr_ucred *usr_crcopy(struct usr_ucred *);
extern int usr_crhold(struct usr_ucred *);
extern int usr_crfree(struct usr_ucred *);
-extern struct usr_ucred *afs_global_ucredp;
struct usr_proc {
unsigned long p_flag;
((sizeof (struct usr_dirent)+4 - (MAXNAMLEN+1)) + (((len)+1 + 3) &~ 3))
struct vcache;
-#define AFS_UCRED struct usr_ucred
+#define afs_ucred_t struct usr_ucred
#define AFS_FLOCK flock
struct usr_vnodeops {
- int (*vn_open) (struct vcache **, afs_int32, AFS_UCRED *);
- int (*vn_close) (struct vcache *, afs_int32, AFS_UCRED *);
+ int (*vn_open) (struct vcache **, afs_int32, afs_ucred_t *);
+ int (*vn_close) (struct vcache *, afs_int32, afs_ucred_t *);
int (*vn_rdwr) (struct usr_vnode *avc, struct usr_uio *uio,
int rw, int io, struct usr_ucred *cred);
int (*vn_ioctl) (void);
int (*vn_select) (void);
- int (*vn_getattr) (struct vcache *avc, struct vattr *, AFS_UCRED *);
- int (*vn_setattr) (struct vcache *avc, struct vattr *, AFS_UCRED *);
- int (*vn_access) (struct vcache *avc, afs_int32, AFS_UCRED *);
+ int (*vn_getattr) (struct vcache *avc, struct vattr *, afs_ucred_t *);
+ int (*vn_setattr) (struct vcache *avc, struct vattr *, afs_ucred_t *);
+ int (*vn_access) (struct vcache *avc, afs_int32, afs_ucred_t *);
int (*vn_lookup) (struct vcache *adp, char *, struct vcache **,
- AFS_UCRED *, int);
+ afs_ucred_t *, int);
int (*vn_create) (struct vcache *adp, char *, struct vattr *,
- enum vcexcl, int, struct vcache **, AFS_UCRED *);
- int (*vn_remove) (struct vcache *adp, char *, AFS_UCRED *);
+ enum vcexcl, int, struct vcache **, afs_ucred_t *);
+ int (*vn_remove) (struct vcache *adp, char *, afs_ucred_t *);
int (*vn_link) (struct vcache *avc, struct vcache *adp, char *,
- AFS_UCRED *);
+ afs_ucred_t *);
int (*vn_rename) (struct vcache *aodp, char *, struct vcache *, char *,
- AFS_UCRED *);
+ afs_ucred_t *);
int (*vn_mkdir) (struct vcache *adp, char *, struct vattr *,
- struct vcache **, AFS_UCRED *);
- int (*vn_rmdir) (struct vcache *adp, char *, AFS_UCRED *);
- int (*vn_readdir) (struct vcache *avc, struct uio *, AFS_UCRED *);
+ struct vcache **, afs_ucred_t *);
+ int (*vn_rmdir) (struct vcache *adp, char *, afs_ucred_t *);
+ int (*vn_readdir) (struct vcache *avc, struct uio *, afs_ucred_t *);
int (*vn_symlink) (struct vcache *adp, char *, struct vattr *, char *,
- AFS_UCRED *);
- int (*vn_readlink) (struct vcache *avc, struct uio *, AFS_UCRED *);
- int (*vn_fsync) (struct vcache *avc, AFS_UCRED *);
- int (*vn_inactive) (struct vcache *avc, AFS_UCRED *acred);
+ afs_ucred_t *);
+ int (*vn_readlink) (struct vcache *avc, struct uio *, afs_ucred_t *);
+ int (*vn_fsync) (struct vcache *avc, afs_ucred_t *);
+ int (*vn_inactive) (struct vcache *avc, afs_ucred_t *acred);
int (*vn_bmap) (void);
int (*vn_strategy) (void);
int (*vn_bread) (void);
int (*vn_brelse) (void);
int (*vn_lockctl) (struct vcache *, struct AFS_FLOCK *, int,
- AFS_UCRED *);
+ afs_ucred_t *);
int (*vn_fid) (struct vcache *avc, struct fid **);
};
struct usr_vfsops *vfs_op;
};
-struct usr_sysent {
- char sy_narg;
- int (*sy_call) (void);
-};
-extern struct usr_sysent usr_sysent[];
-
struct usr_ifnet {
struct usr_ifnet *if_next;
short if_flags;
};
extern struct usr_in_ifaddr *usr_in_ifaddr;
-extern usr_key_t afs_global_u_key; /* for per thread authentication */
-
-#if defined(AFS_USR_OSF_ENV)
-extern char V;
-#else
-extern long V;
-#endif
-
#endif /* UKERNEL */
struct min_direct {
-#if defined(AFS_OFS_ENV) || defined(AFS_USR_OSF_ENV)
+#if defined(AFS_USR_OSF_ENV)
unsigned int d_fileno;
#else /* AFS_OFS_ENV || AFS_USR_OSF_ENV */
unsigned long d_fileno;
} u_r;
};
#define u_rval1 u_r.r_val1
-#define u (*(get_user_struct()))
extern struct usr_user *get_user_struct(void);