X-Git-Url: http://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Fafs%2Fafs_osi.h;h=b2ba0cc45892f4a0cf4a4c6fe96fe7a2ea7fc5ee;hp=2e2879d73d04ddaa38cf1fb367c66a58c6c9560c;hb=a5cb6d6c4e4fef19dc1b02a138bc671605e68a8a;hpb=116c2d680ebcb7bd977ee13c8ad2fe94e59ecfe3 diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 2e2879d..b2ba0cc 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -123,25 +123,25 @@ struct afs_osi_WaitHandle { /* * Vnode related macros */ -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) +#if defined(AFS_DARWIN80_ENV) +#define vType(vc) vnode_vtype(AFSTOV(vc)) +#else +#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #define vSetVfsp(vc, vfsp) AFSTOV(vc)->v_mount = (vfsp) #define vSetType(vc, type) AFSTOV(vc)->v_type = (type) #define vType(vc) AFSTOV(vc)->v_type -#else -#define vType(vc) (vc)->v.v_type -#define vSetType(vc,type) (vc)->v.v_type = (type) -#define vSetVfsp(vc,vfsp) (vc)->v.v_vfsp = (vfsp) -#endif - -#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) extern int (**afs_vnodeop_p) (); #define IsAfsVnode(v) ((v)->v_op == afs_vnodeop_p) #define SetAfsVnode(v) /* nothing; done in getnewvnode() */ #else +#define vType(vc) (vc)->v.v_type +#define vSetType(vc,type) (vc)->v.v_type = (type) +#define vSetVfsp(vc,vfsp) (vc)->v.v_vfsp = (vfsp) extern struct vnodeops *afs_ops; #define IsAfsVnode(v) ((v)->v_op == afs_ops) #define SetAfsVnode(v) (v)->v_op = afs_ops #endif +#endif #ifdef AFS_SGI65_ENV #define gop_lookupname(fnamep,segflg,followlink,compvpp) \ @@ -304,6 +304,18 @@ typedef struct timeval osi_timeval_t; AFS_GLOCK(); \ } while(0) +#if defined(AFS_DARWIN80_ENV) +#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ + do { \ + int haveGlock = ISAFS_GLOCK(); \ + if (haveGlock) \ + AFS_GUNLOCK(); \ + uio_setrw((UIO),(RW)); \ + CODE = uiomove((SRC),(LEN),(UIO)); \ + if (haveGlock) \ + AFS_GLOCK(); \ + } while(0) +#else #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ @@ -326,6 +338,7 @@ typedef struct timeval osi_timeval_t; AFS_GLOCK(); \ } while(0) #endif +#endif /* AFS_DARWIN80_ENV */ #else /* AFS_GLOBAL_SUNLOCK */ @@ -344,6 +357,13 @@ typedef struct timeval osi_timeval_t; CODE = copyout((SRC),(DST),(LEN)); \ } while(0) +#if defined(AFS_DARWIN80_ENV) +#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ + do { \ + uio_setrw((UIO),(RW)); \ + CODE = uiomove((SRC),(LEN),(UIO)); \ + } while(0) +#else /* AFS_OSF_ENV || AFS_FBSD_ENV */ #if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) #define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \ do { \ @@ -356,9 +376,19 @@ typedef struct timeval osi_timeval_t; CODE = uiomove((SRC),(LEN),(RW),(UIO)); \ } while(0) #endif /* AFS_OSF_ENV || AFS_FBSD_ENV */ +#endif /* AFS_DARWIN80_ENV */ #endif /* AFS_GLOBAL_SUNLOCK */ +#ifdef AFS_DARWIN80_ENV +#define AFS_UIO_OFFSET(uio) uio_offset(uio) +#define AFS_UIO_RESID(uio) uio_resid(uio) +#else +#define AFS_UIO_OFFSET(uio) (uio)->uio_offset +#define AFS_UIO_RESID(uio) (uio)->uio_resid +#endif + + /* * encapsulation of kernel data structure accesses */