Date: Tue, 10 Apr 2007 10:52:29 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 117821 for review Message-ID: <200704101052.l3AAqTfX061439@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=117821 Change 117821 by rwatson@rwatson_cinnamon_afs on 2007/04/10 10:51:46 Various compile fixes for FreeBSD. Quite a few of these can be immediately upstreamed to the Arla developers, as they will also affect other BSD platforms (improper ifdef'ing, etc). Affected files ... .. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_locl.h#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_vfsops-bsd.h#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_message.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_node-bsd.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_syscalls-wrap-freebsd.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_vfsops-bsd.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_vfsops-freebsd.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_vnodeops-bsd.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_vnodeops-common.c#2 edit .. //depot/projects/arla/sys/fs/nnpfs/nnpfs_wrap-bsd.c#2 edit Differences ... ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_locl.h#2 (text+ko) ==== @@ -286,7 +286,7 @@ struct genfs_ops nnpfs_genfsops; #endif -#if __NetBSD_Version__ >= 399001900 /* NetBSD 3.99.19 */ +#if defined (__NetBSD__) && __NetBSD_Version__ >= 399001900 /* NetBSD 3.99.19 */ typedef struct kauth_cred *nnpfs_kernel_cred; #define nnpfs_cred_get_uid(cred) kauth_cred_getuid(cred) #else @@ -552,4 +552,4 @@ struct vop_##n##_args; \ int nnpfs_##n(struct vop_##n##_args *) -#include "nnpfs/nnpfs_vopdefs.h" +// #include "nnpfs/nnpfs_vopdefs.h" ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs/nnpfs_vfsops-bsd.h#2 (text+ko) ==== @@ -78,8 +78,11 @@ int nnpfs_root(struct mount *mp, struct vnode **vpp); +/* + * XXXRW: Need an ifdef for arg. + */ int -nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p); +nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p); int nnpfs_statfs(struct mount *mp, nnpfs_statvfs *sbp, d_thread_t *p); ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_message.c#2 (text+ko) ==== @@ -413,7 +413,7 @@ nnpfs_block_free_all(VNODE_TO_XNODE(vp)); -#if HAVE_KERNEL_VGONEL +#ifdef HAVE_KERNEL_VGONEL vgonel (vp, p); #else /* !have vgonel nor is dragonfly */ nnpfs_interlock_unlock(&vp->v_interlock); ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_node-bsd.c#2 (text+ko) ==== @@ -720,7 +720,7 @@ * The real change is sys/kern/vfs_cache:1.20 */ -#if __NetBSD_Version__ >= 104120000 || OpenBSD > 200211 +#if (defined(__NetBSD__) && (__NetBSD_Version__ >= 104120000)) || (defined(OpenBSD) && (OpenBSD > 200211)) if (cache_lookup(dvp, &dummy, cnp) != -1) { nnpfs_vfs_unlock(dummy, nnpfs_cnp_to_proc(cnp)); printf ("NNPFS PANIC WARNING! nnpfs_dnlc_enter: %s already in cache\n", @@ -765,7 +765,7 @@ cn->cn_nameptr = (char *)name; cn->cn_namelen = strlen(name); cn->cn_flags = 0; -#if __APPLE__ +#if defined(__APPLE__) cn->cn_hash = 0; /* Let the vfs compute the hash */ #elif defined(HAVE_KERNEL_NAMEI_HASH) { ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_syscalls-wrap-freebsd.c#2 (text+ko) ==== @@ -46,8 +46,6 @@ #include <nnpfs/nnpfs_node.h> #include <nnpfs/nnpfs_deb.h> -#include <kafs.h> - int nnpfs_syscall_num = AFS_SYSCALL; static int ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_vfsops-bsd.c#2 (text+ko) ==== @@ -83,8 +83,11 @@ return nnpfs_root_common(mp, vpp, nnpfs_curproc()); } +/* + * XXXRW: Need an ifdef for caddr_t? + */ int -nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, caddr_t arg, d_thread_t *p) +nnpfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, d_thread_t *p) { NNPFSDEB(XDEBVFOPS, ("nnpfs_quotactl: mp = %lx, cmd = %d, uid = %u, " "arg = %lx, proc = %lx\n", @@ -392,7 +395,10 @@ int error; struct mount *mp; #if !(defined(HAVE_GETFH) && defined(HAVE_FHOPEN)) - struct ucred *cred = proc->p_ucred; + /* + * XXXRW: Need a new ifdef for td_ucred. + */ + struct ucred *cred = proc->td_ucred; struct vattr vattr; fsid_t fsid; struct nnpfs_fh_args *fh_args = (struct nnpfs_fh_args *)fhp->fhdata; @@ -418,7 +424,10 @@ error = VFS_VGET(mp, &ino, vpp); } #else - error = VFS_VGET(mp, SCARG(fh_args, fileid), vpp); + /* + * XXXRW: Need ifdef magic here. + */ + error = VFS_VGET(mp, LK_EXCLUSIVE, SCARG(fh_args, fileid), vpp); #endif if (error) ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_vfsops-freebsd.c#2 (text+ko) ==== ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_vnodeops-bsd.c#2 (text+ko) ==== @@ -64,7 +64,7 @@ */ #ifdef HAVE_VOP_OPEN -int +static int nnpfs_open(struct vop_open_args * ap) /* struct vop_open { @@ -85,7 +85,7 @@ #endif /* HAVE_VOP_OPEN */ #ifdef HAVE_VOP_FSYNC -int +static int nnpfs_fsync(struct vop_fsync_args * ap) /* vop_fsync { @@ -110,7 +110,7 @@ #endif /* HAVE_VOP_FSYNC */ #ifdef HAVE_VOP_CLOSE -int +static int nnpfs_close(struct vop_close_args * ap) /* vop_close { IN struct vnode *vp; @@ -160,7 +160,7 @@ #endif /* HAVE_VOP_WRITE */ #ifdef HAVE_VOP_IOCTL -int +static int nnpfs_ioctl(struct vop_ioctl_args * ap) /* struct vnode *vp, int com, @@ -175,7 +175,7 @@ #endif /* HAVE_VOP_IOCTL */ #ifdef HAVE_VOP_SELECT -int +static int nnpfs_select(struct vop_select_args * ap) /* struct vnode *vp, int which, @@ -188,7 +188,7 @@ #endif /* HAVE_VOP_SELECT */ #ifdef HAVE_VOP_SEEK -int +static int nnpfs_seek(struct vop_seek_args * ap) /* struct vop_seek_args { @@ -206,7 +206,10 @@ #endif /* HAVE_VOP_SEEK */ #ifdef HAVE_VOP_POLL -int +/* + * XXXRW: Without a prototype, we need static. + */ +static int nnpfs_poll(struct vop_poll_args * ap) /* vop_poll { IN struct vnode *vp; @@ -220,7 +223,7 @@ #endif /* HAVE_VOP_POLL */ #ifdef HAVE_VOP_GETATTR -int +static int nnpfs_getattr(struct vop_getattr_args * ap) /* struct vnode *vp, struct vattr *vap, @@ -237,7 +240,7 @@ #endif /* HAVE_VOP_GETATTR */ #ifdef HAVE_VOP_SETATTR -int +static int nnpfs_setattr(struct vop_setattr_args * ap) /* struct vnode *vp, struct vattr *vap, @@ -250,7 +253,7 @@ #endif /* HAVE_VOP_SETATTR */ #ifdef HAVE_VOP_ACCESS -int +static int nnpfs_access(struct vop_access_args * ap) /* struct vnode *vp, @@ -264,7 +267,7 @@ #endif /* HAVE_VOP_ACCESS */ #ifdef HAVE_VOP_LOOKUP -int +static int nnpfs_lookup(struct vop_lookup_args * ap) /* struct vop_lookup_args { struct vnodeop_desc *a_desc; @@ -327,7 +330,7 @@ #endif /* HAVE_VOP_LOOKUP */ #ifdef HAVE_VOP_CACHEDLOOKUP -int +static int nnpfs_cachedlookup(struct vop_cachedlookup_args * ap) /* struct vop_cachedlookup_args { struct vnodeop_desc *a_desc; @@ -368,7 +371,7 @@ } #ifdef HAVE_VOP_CREATE -int +static int nnpfs_create(struct vop_create_args *ap) { struct vnode *dvp = ap->a_dvp; @@ -399,7 +402,7 @@ #endif /* HAVE_VOP_CREATE */ #ifdef HAVE_VOP_REMOVE -int +static int nnpfs_remove(struct vop_remove_args * ap) /* struct vnode *dvp, struct vnode *vp, @@ -427,7 +430,7 @@ #endif /* HAVE_VOP_REMOVE */ #ifdef HAVE_VOP_RENAME -int +static int nnpfs_rename(struct vop_rename_args * ap) /* vop_rename { IN WILLRELE struct vnode *fdvp; @@ -464,7 +467,7 @@ #endif /* HAVE_VOP_RENAME */ #ifdef HAVE_VOP_MKDIR -int +static int nnpfs_mkdir(struct vop_mkdir_args * ap) /* struct vnode *dvp, char *nm, @@ -499,7 +502,7 @@ #endif /* HAVE_VOP_MKDIR */ #ifdef HAVE_VOP_RMDIR -int +static int nnpfs_rmdir(struct vop_rmdir_args * ap) /* struct vnode *dvp, struct vnode *vp, @@ -539,7 +542,7 @@ #error dunno want kind of cookies you have #endif -int +static int nnpfs_readdir(struct vop_readdir_args * ap) /* struct vnode *vp, struct uio *uiop, @@ -594,7 +597,7 @@ #endif #ifdef HAVE_VOP_LINK -int +static int nnpfs_link(struct vop_link_args * ap) /* WILLRELE struct vnode *tdvp; @@ -664,7 +667,7 @@ #endif /* HAVE_VOP_LINK */ #ifdef HAVE_VOP_SYMLINK -int +static int nnpfs_symlink(struct vop_symlink_args * ap) /* IN WILLRELE struct vnode *dvp; @@ -721,7 +724,7 @@ #endif /* HAVE_VOP_READLINK */ #ifdef HAVE_VOP_INACTIVE -int +static int nnpfs_inactive(struct vop_inactive_args * ap) { #ifdef HAVE_FREEBSD_THREAD @@ -733,7 +736,7 @@ #endif /* HAVE_VOP_INACTICE */ #ifdef HAVE_VOP_RECLAIM -int +static int nnpfs_reclaim(struct vop_reclaim_args * ap) /*struct vop_reclaim_args { struct vnodeop_desc *a_desc; @@ -1027,7 +1030,7 @@ #endif /* !HAVE_KERNEL_VNODE_PAGER_GENERIC_GETPAGES */ #ifdef __FreeBSD__ -int +static int nnpfs_getpages (struct vop_getpages_args *ap) /* struct vnodeop_desc *a_desc; @@ -1067,7 +1070,7 @@ #include <vm/vm_page.h> #include <vm/vm_pager.h> -int +static int nnpfs_putpages (struct vop_putpages_args *ap) /* struct vnodeop_desc *a_desc; @@ -1131,7 +1134,7 @@ #endif /* HAVE_VOP_CNTL */ #ifdef HAVE_VOP_PRINT -int +static int nnpfs_print (struct vop_print_args *v) { struct vop_print_args /* { @@ -1143,9 +1146,13 @@ #endif #ifdef HAVE_VOP_ADVLOCK -int +static int nnpfs_advlock(struct vop_advlock_args *v) { + /* + * XXXRW: warning/error generated on freebsd for unused ap. + */ +#if 0 struct vop_advlock_args /* { struct vnode *a_vp; caddr_t a_id; @@ -1153,6 +1160,7 @@ struct flock *a_fl; int a_flags; } */ *ap = v; +#endif #if 0 struct nnpfs_node *xn = VNODE_TO_XNODE(ap->a_vp); int ret; @@ -1202,7 +1210,7 @@ #endif /* HAVE_VOP_REVOKE */ #ifdef HAVE_VOP_CREATEVOBJECT -int +static int nnpfs_createvobject(struct vop_createvobject_args *ap) /* struct vop_createvobject_args { @@ -1219,7 +1227,7 @@ #endif /* HAVE_VOP_CREATEVOBJECT */ #ifdef HAVE_VOP_DESTROYVOBJECT -int +static int nnpfs_destroyvobject(struct vop_destroyvobject_args *ap) /* struct vop_destroyvobject_args { @@ -1234,7 +1242,7 @@ #endif /* HAVE_VOP_DESTROYVOBJECT */ #ifdef HAVE_VOP_GETVOBJECT -int +static int nnpfs_getvobject(struct vop_getvobject_args *ap) /* struct vop_getvobject_args { @@ -1250,7 +1258,7 @@ #endif /* HAVE_VOP_GETVOBJECT */ #ifdef HAVE_VOP_PATHCONF -int +static int nnpfs_pathconf(struct vop_pathconf_args *ap) /* struct vop_pathconf_args { @@ -1353,7 +1361,7 @@ static struct filterops nnpfsvnode_filtops = { 1, NULL, filt_nnpfsdetach, filt_nnpfsvnode }; -int +static int nnpfs_kqfilter(struct vop_kqfilter_args *ap) { struct vnode *vp = ap->a_vp; ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_vnodeops-common.c#2 (text+ko) ==== @@ -49,7 +49,7 @@ static void nnpfs_handle_stale(struct nnpfs_node *xn) { -#if __APPLE__ +#ifdef __APPLE__ struct vnode *vp = XNODE_TO_VNODE(xn); #endif ==== //depot/projects/arla/sys/fs/nnpfs/nnpfs_wrap-bsd.c#2 (text+ko) ==== @@ -41,7 +41,7 @@ RCSID("$Id: nnpfs_wrap-bsd.c,v 1.55 2005/12/22 13:49:25 tol Exp $"); -#include "version.h" +// #include "version.h" int nnpfs_dev_major;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704101052.l3AAqTfX061439>