From: Simon Wilkinson Date: Tue, 21 Jul 2009 19:16:51 +0000 (+0100) Subject: Further prototyping and cleanup of UKERNEL X-Git-Tag: openafs-devel-1_5_61~73 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=09c4b3006d81eeb52b89d870ee7568de455040ea;p=packages%2Fo%2Fopenafs.git Further prototyping and cleanup of UKERNEL This patch continues to reduce the number of warnings that come from a UKERNEL build. It also replaces the use of a system provided suser() call (which isn't available everywhere), with afs_suser that's provided by UKERNEL. Note that this makes UKERNEL applications usable by everyone, not just root. fork_syscall() becomes a normal function call_syscall() is ANSIfied UKERNEL/osi_groups.c gets the includes it needs UKERNEL/osi_machdep.c stops thinking it's on Solaris UKERNEL/osi_vnodeops.c stops confusing vnodes and vcaches Reviewed-on: http://gerrit.openafs.org/http://gerrit.openafs.org/166 Tested-by: Russ Allbery Reviewed-by: Russ Allbery --- diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index d0d435061..ce597ca94 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -138,6 +138,7 @@ pthread_cond_t usr_sleep_cond; #endif /* !NETSCAPE_NSAPI */ int call_syscall(long, long, long, long, long, long); +int fork_syscall(long, long, long, long, long, long); /* @@ -1683,21 +1684,21 @@ uafs_Init(char *rn, char *mountDirParam, char *confDirParam, */ if (afsd_debug) printf("%s: Calling AFSOP_RXLISTENER_DAEMON\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_RXLISTENER_DAEMON, FALSE, FALSE, FALSE); + fork_syscall(AFSCALL_CALL, AFSOP_RXLISTENER_DAEMON, FALSE, FALSE, FALSE, 0); if (afsd_verbose) printf("%s: Forking rx callback listener.\n", rn); /* Child */ if (preallocs < cacheStatEntries + 50) preallocs = cacheStatEntries + 50; - fork_syscall(AFSCALL_CALL, AFSOP_START_RXCALLBACK, preallocs); + fork_syscall(AFSCALL_CALL, AFSOP_START_RXCALLBACK, preallocs, 0, 0, 0); /* * Start the RX event handler. */ if (afsd_debug) printf("%s: Calling AFSOP_RXEVENT_DAEMON\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_RXEVENT_DAEMON, FALSE); + fork_syscall(AFSCALL_CALL, AFSOP_RXEVENT_DAEMON, FALSE, 0, 0, 0); /* * Set up all the kernel processes needed for AFS. @@ -1804,16 +1805,16 @@ uafs_Init(char *rn, char *mountDirParam, char *confDirParam, if (afsd_verbose) printf("%s: Forking AFS daemon.\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_START_AFS); + fork_syscall(AFSCALL_CALL, AFSOP_START_AFS, 0, 0, 0, 0); if (afsd_verbose) printf("%s: Forking check server daemon.\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_START_CS); + fork_syscall(AFSCALL_CALL, AFSOP_START_CS, 0, 0, 0, 0); if (afsd_verbose) printf("%s: Forking %d background daemons.\n", rn, nDaemons); for (i = 0; i < nDaemons; i++) { - fork_syscall(AFSCALL_CALL, AFSOP_START_BKG); + fork_syscall(AFSCALL_CALL, AFSOP_START_BKG, 0, 0, 0, 0); } if (afsd_verbose) @@ -1889,7 +1890,7 @@ uafs_Init(char *rn, char *mountDirParam, char *confDirParam, if (afsd_verbose) printf("%s: Forking trunc-cache daemon.\n", rn); - fork_syscall(AFSCALL_CALL, AFSOP_START_TRUNCDAEMON); + fork_syscall(AFSCALL_CALL, AFSOP_START_TRUNCDAEMON, 0, 0, 0, 0); /* * Mount the AFS filesystem @@ -1996,8 +1997,8 @@ syscallThread(void *argp) } int -fork_syscall(syscall, afscall, param1, param2, param3, param4) - long syscall, afscall, param1, param2, param3, param4; +fork_syscall(long syscall, long afscall, long param1, long param2, + long param3, long param4) { usr_thread_t tid; struct syscallThreadArgs *sysArgsP; @@ -2018,8 +2019,8 @@ fork_syscall(syscall, afscall, param1, param2, param3, param4) } int -call_syscall(syscall, afscall, param1, param2, param3, param4) - long syscall, afscall, param1, param2, param3, param4; +call_syscall(long syscall, long afscall, long param1, long param2, + long param3, long param4) { int code = 0; struct a { diff --git a/src/afs/UKERNEL/osi_groups.c b/src/afs/UKERNEL/osi_groups.c index 7856c6172..6662dc60d 100644 --- a/src/afs/UKERNEL/osi_groups.c +++ b/src/afs/UKERNEL/osi_groups.c @@ -18,7 +18,7 @@ #include "afs/sysincludes.h" #include "afsincludes.h" #include "afs/afs_stats.h" /* statistics */ - +#include "afs/afs_prototypes.h" int afs_xsetgroups(void) diff --git a/src/afs/UKERNEL/osi_machdep.h b/src/afs/UKERNEL/osi_machdep.h index 19a25f55c..5560efd91 100644 --- a/src/afs/UKERNEL/osi_machdep.h +++ b/src/afs/UKERNEL/osi_machdep.h @@ -8,7 +8,7 @@ */ /* - * Solaris OSI header file. Extends afs_osi.h. + * UKERNEL OSI header file. Extends afs_osi.h. * * afs_osi.h includes this file, which is the only way this file should * be included in a source file. This file can redefine macros declared in @@ -40,8 +40,10 @@ #define gop_lookupname(fnamep,segflg,followlink,compvpp) lookupname((fnamep),(segflg),(followlink),(compvpp)) #define osi_vnhold(avc, r) do { VN_HOLD(AFSTOV(avc)); } while(0) -#define afs_suser(x) suser(x) +#if 0 +#define afs_suser(x) suser(x) +#endif /* * Global lock support. */ @@ -67,4 +69,6 @@ extern usr_mutex_t afs_global_lock; extern int afs_bufferpages; +extern int afs_suser(void *credp); + #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/UKERNEL/osi_vnodeops.c b/src/afs/UKERNEL/osi_vnodeops.c index 3c0ee94d0..d04013f1a 100644 --- a/src/afs/UKERNEL/osi_vnodeops.c +++ b/src/afs/UKERNEL/osi_vnodeops.c @@ -22,9 +22,9 @@ afs_vrdwr(struct usr_vnode *avc, struct usr_uio *uio, int rw, int io, int rc; if (rw == UIO_WRITE) { - rc = afs_write(avc, uio, io, cred, 0); + rc = afs_write(VTOAFS(avc), uio, io, cred, 0); } else { - rc = afs_read(avc, uio, cred, 0, 0, 0); + rc = afs_read(VTOAFS(avc), uio, cred, 0, 0, 0); } return rc; diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index f886fd01f..2d2970379 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -575,7 +575,7 @@ extern int AddPag(struct proc *p, afs_int32 aval, struct AFS_UCRED **credpp); extern int AddPag(afs_int32 aval, struct AFS_UCRED **credpp); #endif extern int afs_InitReq(register struct vrequest *av, struct AFS_UCRED *acred); -#if defined(UKERNEL) && defined(AFS_WEB_ENHANCEMENTS) +#if defined(UKERNEL) extern afs_uint32 afs_get_pag_from_groups(gid_t g0a, gid_t g1a); #else #ifdef AFS_LINUX26_ONEGROUP_ENV @@ -871,7 +871,9 @@ extern void afs_AddToMean(struct afs_MeanStats *oldMean, afs_int32 newValue); /* afs_syscall.c */ extern int copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst); - +#ifdef UKERNEL +extern int Afs_syscall(void); +#endif /* UKERNEL/afs_usrops.c */ #ifdef UKERNEL