COMPILE_PART2=; $(MAKE) install SYS_NAME=${SYS_NAME} DESTDIR=$(shell pwd)/${SYS_NAME}/dest/ SRCDIR=$(shell pwd)/${SYS_NAME}/dest/
MKDIR_IF_NEEDED=[ -d $$1 ] || mkdir -p $$1
+# Enable build+install of obsolete and insecure packages
+# Set to anything other than YES, or comment out to disable the build
+WITH_DEPRECATED=YES
+
# To compile AFS from scratch in the src tree run "make SYS_NAME=<type>".
# This recursively calls "make install ..." and does not depend on the
# existence of any non-standard programs.
cmd: basics comerr
${COMPILE_PART1} cmd ${COMPILE_PART2}
@case ${SYS_NAME} in \
- sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* ) \
+ sgi_6* | sun4x_57 | sun4x_58 | hp_ux11* | sparc64_linux* | alpha_linux* ) \
${COMPILE_PART1} cmd ${COMPILE_PART2} install64 ;; \
esac
tviced: project viced vlserver libafsrpc libafsauthent
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux*) \
+ alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \
*) \
echo Not building MT viced for ${SYS_NAME} ;; \
gtx: project null auth # kauth rxkad ?
case ${SYS_NAME} in \
- rs_aix* | sun4x_5? | sgi_6? | *linux*) \
+ rs_aix* | sun4x_5? | sgi_6? | *linux* | ppc_darwin* | *fbsd*) \
rm -f ${DESTDIR}lib/afs/libtermlib.a; \
ln -s libnull.a ${DESTDIR}lib/afs/libtermlib.a; \
${COMPILE_PART1} gtx ${COMPILE_PART2};; \
scout: project gtx fsprobe
${COMPILE_PART1} scout ${COMPILE_PART2}
-mpp: project
- ${COMPILE_PART1} mpp ${COMPILE_PART2}
-
-package: project mpp
- ${COMPILE_PART1} package ${COMPILE_PART2}
-
-package.files: package
- ${DESTDIR}/bin/makepkgfiles afs.dev
-
uss: des kauth project rx vlserver vol
${COMPILE_PART1} uss ${COMPILE_PART2}
-ntp: project volser
- case ${SYS_NAME} in \
- sun4x_58 ) echo skipping ntp for ${SYS_NAME} ;; \
- *linux* ) echo skipping ntp for ${SYS_NAME} ;; \
- * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
- esac
-
-#convert: project ntp
-# ${COMPILE_PART1} convert ${COMPILE_PART2}
-
bozo: project ntp audit
${COMPILE_PART1} bozo ${COMPILE_PART2}
vfsck: minproject vol
set -x; \
case ${SYS_NAME} in \
- sgi_* | *linux*) \
- echo skip vfsck for ${SYS_NAME} ;; \
- rs_aix42) \
- echo skip vfsck for ${SYS_NAME} ;; \
- sun4x_58 ) \
+ sgi_* | *linux* | rs_aix42 | ppc_darwin* | hp_ux* | *fbsd* ) \
echo skip vfsck for ${SYS_NAME} ;; \
* ) \
${COMPILE_PART1} vfsck ${COMPILE_PART2} ;; \
${COMPILE_PART1} sia ${COMPILE_PART2} ;; \
sun4x_55 ) \
${COMPILE_PART1} login ${COMPILE_PART2} ;; \
- sun4x_* | hp_ux11* | *linux* ) \
+ sun4x_* | hp_ux11* | *linux* | *fbsd* ) \
${COMPILE_PART1} pam ${COMPILE_PART2} ;; \
+ ppc_darwin* ) \
+ echo Skipping login for ${SYS_NAME} ;; \
* ) \
${COMPILE_PART1} login ${COMPILE_PART2} ;; \
esac
-ftpd43+: project kauth rxkad
- case ${SYS_NAME} in \
- rs_aix* | sun4x_55 | *linux*) \
- ${COMPILE_PART1} ftpd43+ ${COMPILE_PART2} ;; \
- * ) echo skip ftpd43+ for ${SYS_NAME} ;; \
- esac
-
-inetd: project kauth rxkad
- ${COMPILE_PART1} inetd ${COMPILE_PART2}
-
-rsh: project inetd
- ${COMPILE_PART1} rsh ${COMPILE_PART2}
-
-rlogind: project rsh ftpd43+ login
- case ${SYS_NAME} in \
- rs_aix*) \
- ${COMPILE_PART1} rlogind ${COMPILE_PART2} ;; \
- * ) echo skipping rlogind for ${SYS_NAME} ;; \
- esac
-
-sgistuff: project rlogind
- case ${SYS_NAME} in \
- sgi_* ) ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
- * ) echo skipping sgistuff for ${SYS_NAME} ;; \
- esac
-
-rcp: project rsh inetd
- case ${SYS_NAME} in \
- sgi_* ) echo skip rcp for ${SYS_NAME} ;; \
- *) ${COMPILE_PART1} rcp ${COMPILE_PART2} ;; \
- esac
-
-allrcmds: project rcp rlogind
-
KERNELDIR= \
afs \
dir \
${COMPILE_PART1} libafs ${COMPILE_PART2}
libuafs: minproject libuafs_setup ${UKERNELDIR}
- ${COMPILE_PART1} libuafs ${COMPILE_PART2}
+ set -x; \
+ case ${SYS_NAME} in \
+ hp_ux102* ) \
+ echo Skipping libuafs for ${SYS_NAME} ;; \
+ * ) \
+ ${COMPILE_PART1} libuafs ${COMPILE_PART2} ;; \
+ esac
afsweb: minproject kauth dauth
${COMPILE_PART1} afsweb ${COMPILE_PART2}
tbutc: project bubasics butm budb bucoord cmd butc
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux*) \
+ alpha_dux*|sgi_*|sun4x_*|rs_aix4*|*linux*|hp_ux110) \
${COMPILE_PART1} tbutc ${COMPILE_PART2} ;; \
*) \
echo Not building MT butc for ${SYS_NAME} ;; \
afsmonitor: project gtx xstat
${COMPILE_PART1} afsmonitor ${COMPILE_PART2}
+#
+# Washtool internal targets
+#
ircs: project
case ${SYS_NAME} in \
sgi_* ) \
# pthread based user space RX library
libafsrpc: rx rxkad des
- ${COMPILE_PART1} libafsrpc ${COMPILE_PART2}
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
+ ${COMPILE_PART1} libafsrpc ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT libafsrpc for ${SYS_NAME} ;; \
+ esac
libafsauthent: ubik auth kauth libafsrpc
- ${COMPILE_PART1} libafsauthent ${COMPILE_PART2}
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
+ ${COMPILE_PART1} libafsauthent ${COMPILE_PART2} ;; \
+ *) \
+ echo Not building MT libafsrpc for ${SYS_NAME} ;; \
+ esac
-libadmin: libafsauthent bozo
+libadmin_real:
${COMPILE_PART1} libadmin ${COMPILE_PART2}
${COMPILE_PART1} libadmin/adminutil ${COMPILE_PART2}
${COMPILE_PART1} libadmin/vos ${COMPILE_PART2}
${COMPILE_PART1} libadmin/cfg ${COMPILE_PART2}
${COMPILE_PART1} libadmin/test ${COMPILE_PART2}
${COMPILE_PART1} libadmin/samples ${COMPILE_PART2}
-
+libadmin: libafsauthent bozo
+ case ${SYS_NAME} in \
+ alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
+ $(MAKE) libadmin_real SYS_NAME=$(SYS_NAME) \
+ WASHTOOL="$(WASHTOOL)" \
+ COMPILE_PART1="$(COMPILE_PART1)" \
+ COMPILE_PART2="$(COMPILE_PART2)" \
+ SRCDIR=$(SRCDIR) DESTDIR=$(DESTDIR) \
+ DBG_DEFS=$(DBG_DEFS) ;; \
+ *) \
+ echo Not building MT libadmin for ${SYS_NAME} ;; \
+ esac
finale: project cmd comerr afsd allrcmds butc tbutc libuafs audit kauth log package \
ptserver scout bu_utils ubik uss bozo vfsck volser \
venus update xstat afsmonitor dauth tests libafsrpc \
MKAFS_OSTYPE=HPUX;; \
*linux*) \
MKAFS_OSTYPE=LINUX;; \
+ *fbsd*) \
+ MKAFS_OSTYPE=FBSD;; \
rs_aix* ) \
MKAFS_OSTYPE=AIX;; \
sgi_* ) \
MKAFS_OSTYPE=IRIX;; \
sun4x_5* ) \
MKAFS_OSTYPE=SOLARIS;; \
+ ppc_darwin* ) \
+ MKAFS_OSTYPE=DARWIN;; \
* ) \
echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
esac; \
MKAFS_OSTYPE=HPUX;; \
*linux*) \
MKAFS_OSTYPE=LINUX;; \
+ *fbsd*) \
+ MKAFS_OSTYPE=FBSD;; \
rs_aix* ) \
MKAFS_OSTYPE=AIX;; \
sun4x_5* ) \
MKAFS_OSTYPE=DUX;; \
sgi_6* ) \
MKAFS_OSTYPE=IRIX;; \
+ ppc_darwin* ) \
+ MKAFS_OSTYPE=DARWIN;; \
* ) \
echo WARNING: No MakefileProto for sys ${SYS_NAME} ; \
esac; \
# "COMPILE_PART1=${COMPILE_PART1}" "COMPILE_PART2=${COMPILE_PART2}" SYS_NAME=${SYS_NAME} ;;
+TARGET=finale
install:
- $(MAKE) finale "SYS_NAME=${SYS_NAME}" "WASHTOOL=${WASHTOOL}" \
+ $(MAKE) $(TARGET) "SYS_NAME=${SYS_NAME}" "WASHTOOL=${WASHTOOL}" \
"COMPILE_PART1=${COMPILE_PART1}" \
"COMPILE_PART2=${COMPILE_PART2}" \
DESTDIR=`pwd`/${SYS_NAME}/dest/ \
for file in `find [!NW]* -type f -print` ; do \
/bin/ln -s `pwd`/$${file} $${here}/obj/$${file} ; \
done;
+
+#
+# Below targets are all deprecated, insecure, or obsolte,
+# see README.OBSOLETE and README.INSECURE for more info
+#
+
+mpp: project
+ @case ${WITH_DEPRECATED} in \
+ YES) ${COMPILE_PART1} mpp ${COMPILE_PART2} ;; \
+ *) echo skipping deprecated target: mpp ;; \
+ esac
+
+package: project mpp
+ @case ${WITH_DEPRECATED} in \
+ YES) ${COMPILE_PART1} package ${COMPILE_PART2} ;; \
+ *) echo skipping deprecated target: package ;; \
+ esac
+
+package.files: package
+ @case ${WITH_DEPRECATED} in \
+ YES) ${DESTDIR}/bin/makepkgfiles afs.dev ;; \
+ *) echo skipping deprecated target: package.files ;; \
+ esac
+
+ntp: project volser
+ @case ${WITH_DEPRECATED} in \
+ YES) case ${SYS_NAME} in \
+ sun4x_58 | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
+ * ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
+ esac ;; \
+ *) echo skipping deprecated target: ntp ;; \
+ esac
+
+sgistuff: project rlogind
+ @case ${WITH_DEPRECATED} in \
+ YES) case ${SYS_NAME} in \
+ sgi_* ) ${COMPILE_PART1} sgistuff ${COMPILE_PART2} ;; \
+ * ) echo skipping sgistuff for ${SYS_NAME} ;; \
+ esac ;; \
+ *) echo skipping deprecated target: sgistuff ;; \
+ esac
+
+ftpd43+: project kauth rxkad
+ @case ${WITH_DEPRECATED} in \
+ YES) case ${SYS_NAME} in \
+ rs_aix* | sun4x_55 | *linux*) \
+ ${COMPILE_PART1} ftpd43+ ${COMPILE_PART2} ;; \
+ *) echo skip ftpd43+ for ${SYS_NAME} ;; \
+ esac ;; \
+ *) echo skipping deprecated target: ftpd43+ ;; \
+ esac
+
+inetd: project kauth rxkad
+ @case ${WITH_DEPRECATED} in \
+ YES) ${COMPILE_PART1} inetd ${COMPILE_PART2} ;; \
+ *) echo skipping deprecated target: inetd ;; \
+ esac
+
+rsh: project inetd
+ @case ${WITH_DEPRECATED} in \
+ YES) ${COMPILE_PART1} rsh ${COMPILE_PART2} ;; \
+ *) echo skipping deprecated target: rsh ;; \
+ esac
+
+rlogind: project rsh ftpd43+ login
+ @case ${WITH_DEPRECATED} in \
+ YES) case ${SYS_NAME} in \
+ rs_aix*) ${COMPILE_PART1} rlogind ${COMPILE_PART2} ;; \
+ *) echo skipping rlogind for ${SYS_NAME} ;; \
+ esac ;; \
+ *) echo skipping deprecated target: rlogind ;; \
+ esac
+
+rcp: project rsh inetd
+ @case ${WITH_DEPRECATED} in \
+ YES) case ${SYS_NAME} in \
+ sgi_* ) echo skip rcp for ${SYS_NAME} ;; \
+ *) ${COMPILE_PART1} rcp ${COMPILE_PART2} ;; \
+ esac ;; \
+ *) echo skipping deprecated target: rcp ;; \
+ esac
+
+allrcmds: project rcp rlogind
+
+
lock_kernel();
code = inode_change_ok(inode, &newattrs);
if (!code)
+#ifdef INODE_SETATTR_NOT_VOID
+ code = inode_setattr(inode, &newattrs);
+#else
inode_setattr(inode, &newattrs);
+#endif
unlock_kernel();
+ if (!code)
+ truncate_inode_pages(&inode->i_data, asize);
#else
if (inode->i_sb->s_op && inode->i_sb->s_op->notify_change) {
code = inode->i_sb->s_op->notify_change(&afile->dentry, &newattrs);
#else
if (ip->i_nrpages) {
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ truncate_inode_pages(&ip->i_data, 0);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
+ truncate_inode_pages(ip, 0);
+#else
invalidate_inode_pages(ip);
+#endif
#if defined(AFS_LINUX24_ENV)
if (ip->i_data.nrpages) {
#else
ICL_TYPE_POINTER, avc,
ICL_TYPE_POINTER, dp);
}
-
+ if (avc)
+ AFS_RELE(avc);
+ crfree(credp);
} /* if bad parent */
return;
asmlinkage int (*sys_settimeofdayp)(struct timeval *tv, struct timezone *tz);
+#if !defined(AFS_ALPHA_LINUX20_ENV)
asmlinkage int (*sys_socketcallp)(int call, long *args);
+#endif /* no socketcall on alpha */
asmlinkage int (*sys_killp)(int pid, int signal);
asmlinkage int (*sys_setgroupsp)(int gidsetsize, gid_t *grouplist);
+#ifdef AFS_SPARC64_LINUX20_ENV
extern unsigned int sys_call_table[]; /* changed to uint because SPARC64 has syscaltable of 32bit items */
+#else
+extern void * sys_call_table[]; /* safer for other linuces */
+#endif
extern struct file_system_type afs_file_system;
static long get_page_offset(void);
/* Since sys_ni_syscall is not exported, I need to cache it in order to restore
* it.
*/
+#ifdef AFS_SPARC64_LINUX20_ENV
static unsigned int afs_ni_syscall = 0;
-
+#else
+static void* afs_ni_syscall = 0;
+#endif
+
#ifdef AFS_SPARC64_LINUX20_ENV
static unsigned int afs_ni_syscall32 = 0;
asmlinkage int (*sys_setgroupsp32)(int gidsetsize, __kernel_gid_t32 *grouplist);
}
#endif
+#if defined(AFS_LINUX24_ENV)
+asmlinkage int (*sys_setgroups32p)(int gidsetsize, __kernel_gid32_t *grouplist);
+#endif
+
+#ifdef AFS_SPARC64_LINUX20_ENV
#define POINTER2SYSCALL (unsigned int)(unsigned long)
#define SYSCALL2POINTER (void *)(long)
+#else
+#define POINTER2SYSCALL (void *)
+#define SYSCALL2POINTER (void *)
+#endif
int init_module(void)
{
extern int afs_syscall();
extern int afs_xsetgroups();
-#ifdef AFS_SPARC64_LINUX20_ENV
+#if defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_LINUX24_ENV)
extern int afs_xsetgroups32();
#endif
/* obtain PAGE_OFFSET value */
afs_linux_page_offset = get_page_offset();
+#ifndef AFS_S390_LINUX22_ENV
if (afs_linux_page_offset == 0) {
/* couldn't obtain page offset so can't continue */
printf("afs: Unable to obtain PAGE_OFFSET. Exiting..");
return -EIO;
}
+#endif
/* Initialize pointers to kernel syscalls. */
sys_settimeofdayp = SYSCALL2POINTER sys_call_table[__NR_settimeofday];
+#if !defined(AFS_ALPHA_LINUX20_ENV)
sys_socketcallp = SYSCALL2POINTER sys_call_table[__NR_socketcall];
+#endif /* no socketcall on alpha */
sys_killp = SYSCALL2POINTER sys_call_table[__NR_kill];
/* setup AFS entry point. */
sys_setgroupsp32 = SYSCALL2POINTER sys_call_table32[__NR_setgroups];
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL afs_xsetgroups32;
#endif
+#if defined(__NR_setgroups32)
+ sys_setgroups32p = SYSCALL2POINTER sys_call_table[__NR_setgroups32];
+ sys_call_table[__NR_setgroups32] = POINTER2SYSCALL afs_xsetgroups32;
+#endif
return 0;
}
sys_call_table32[__NR_setgroups] = POINTER2SYSCALL sys_setgroupsp32;
sys_call_table32[__NR_afs_syscall] = afs_ni_syscall32;
#endif
-
+#if defined(__NR_setgroups32)
+ sys_call_table[__NR_setgroups32] = POINTER2SYSCALL sys_setgroups32p;
+#endif
unregister_filesystem(&afs_file_system);
osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */
static long get_page_offset(void)
{
-#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV)
+#if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV)
return PAGE_OFFSET;
#else
struct task_struct *p;
/* filldir returns -EINVAL when the buffer is full. */
#ifdef AFS_LINUX24_ENV
- code = (*filldir)(dirbuf, de->name, len, offset, ino, DT_UNKNOWN);
+ {
+ unsigned int type=DT_UNKNOWN;
+ struct VenusFid afid;
+ struct vcache *tvc;
+ int vtype;
+ afid.Cell=avc->fid.Cell;
+ afid.Fid.Volume=avc->fid.Fid.Volume;
+ afid.Fid.Vnode=ntohl(de->fid.vnode);
+ afid.Fid.Unique=ntohl(de->fid.vunique);
+ if ((avc->states & CForeign) == 0 &&
+ (ntohl(de->fid.vnode) & 1)) {
+ type=DT_DIR;
+ } else if ((tvc=afs_FindVCache(&afid,0,0,0,0))) {
+ if (tvc->mvstat) {
+ type=DT_DIR;
+ } else if (((tvc->states) & (CStatd|CTruth))) {
+ /* CTruth will be set if the object has
+ *ever* been statd */
+ vtype=vType(tvc);
+ if (vtype == VDIR)
+ type=DT_DIR;
+ else if (vtype == VREG)
+ type=DT_REG;
+ /* Don't do this until we're sure it can't be a mtpt */
+ /* else if (vtype == VLNK)
+ type=DT_LNK; */
+ /* what other types does AFS support? */
+ }
+ /* clean up from afs_FindVCache */
+ afs_PutVCache(tvc, WRITE_LOCK);
+ }
+ code = (*filldir)(dirbuf, de->name, len, offset, ino, type);
+ }
#else
code = (*filldir)(dirbuf, de->name, len, offset, ino);
#endif
lock_kernel();
#endif
- /* If it's a negative dentry, then there's nothing to do. */
- if (!vcp) {
-#ifdef AFS_LINUX24_ENV
- unlock_kernel();
-#endif
- AFS_GUNLOCK();
- return 0;
- }
-
/* Make this a fast path (no crref), since it's called so often. */
if (vcp->states & CStatd) {
if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
return -code ;
}
-/* Validate a dentry. Return 0 if unchanged, 1 if VFS layer should re-evaluate.
- * In kernels 2.2.10 and above, we are passed an additional flags var which
- * may have either the LOOKUP_FOLLOW OR LOOKUP_DIRECTORY set in which case
- * we are advised to follow the entry if it is a link or to make sure that
- * it is a directory. But since the kernel itself checks these possibilities
- * later on, we shouldn't have to do it until later. Perhaps in the future..
- */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
static int afs_linux_dentry_revalidate(struct dentry *dp, int flags)
#else
static int afs_linux_dentry_revalidate(struct dentry *dp)
#endif
{
- int code;
- cred_t *credp;
- struct vrequest treq;
- struct vcache *vcp = (struct vcache*)dp->d_inode;
-
- AFS_GLOCK();
-#ifdef AFS_LINUX24_ENV
- lock_kernel();
-#endif
-
- /* If it's a negative dentry, then there's nothing to do. */
- if (!vcp) {
-#ifdef AFS_LINUX24_ENV
- unlock_kernel();
-#endif
- AFS_GUNLOCK();
- return 0;
- }
-
- /* Make this a fast path (no crref), since it's called so often. */
- if (vcp->states & CStatd) {
- if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
- check_bad_parent(dp); /* check and correct mvid */
- vcache2inode(vcp);
-#ifdef AFS_LINUX24_ENV
- unlock_kernel();
-#endif
- AFS_GUNLOCK();
- return 0;
- }
-
- credp = crref();
- code = afs_InitReq(&treq, credp);
- if (!code)
- code = afs_VerifyVCache(vcp, &treq);
-
-#ifdef AFS_LINUX24_ENV
- unlock_kernel();
-#endif
- AFS_GUNLOCK();
- crfree(credp);
-
- return 1;
+ /* Force revalidation as this may be a different client than the
+ one which caused an entry to get cached */
+ return 0;
}
/* afs_dentry_iput */
#endif
dp->d_op = afs_dops;
+ /* This DV is probably wrong, unfortunately, Perhaps we should
+ VerifyVCache the directory */
+ dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
d_instantiate(dp, ip);
}
ip->i_op = &afs_symlink_iops;
#endif
}
+ /* directory ought to be stat'd here.... */
+ dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
dp->d_op = afs_dops;
d_add(dp, (struct inode*)vcp);
AFS_GUNLOCK();
if (!code) {
d_delete(dp);
- if (putback)
+ if (putback) {
+ /* This DV is probably wrong, unfortunately, Perhaps we should
+ VerifyVCache the directory */
+ dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
d_add(dp, NULL); /* means definitely does _not_ exist */
}
+ }
crfree(credp);
return -code;
}
tvcp->v.v_fop = &afs_dir_fops;
#endif
dp->d_op = afs_dops;
+ /* This DV is probably wrong, unfortunately, Perhaps we should
+ VerifyVCache the directory */
+ dp->d_time=hgetlo(((struct vcache *)dip)->m.DataVersion);
d_instantiate(dp, (struct inode*)tvcp);
}
AFS_GUNLOCK();
newname, credp);
AFS_GUNLOCK();
- if (!code)
+ if (!code) {
+ /* update time so it doesn't expire immediately */
+ /* This DV is probably wrong, unfortunately, Perhaps we should
+ VerifyVCache the directory */
+ newdp->d_time=hgetlo(((struct vcache *)newdp->d_parent->d_inode)->m.DataVersion);
d_move(olddp, newdp);
+ }
crfree(credp);
return -code;
{
int code;
cred_t *credp = crref();
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ char *address;
+ loff_t offset = pp->index << PAGE_CACHE_SHIFT;
+#else
ulong address = afs_linux_page_address(pp);
+ loff_t offset = pageoff(pp);
+#endif
uio_t tuio;
struct iovec iovec;
struct inode *ip = FILE_INODE(fp);
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, cnt,
ICL_TYPE_INT32, 99999); /* not a possible code value */
- atomic_add(1, &pp->count);
-#if defined(AFS_LINUX24_ENV)
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ address = kmap(pp);
ClearPageError(pp);
+
+ lock_kernel();
#else
+ atomic_add(1, &pp->count);
set_bit(PG_locked, &pp->flags); /* other bits? See mm.h */
clear_bit(PG_error, &pp->flags);
#endif
-#if defined(AFS_LINUX24_ENV)
- setup_uio(&tuio, &iovec, (char*)address, pp->index << PAGE_CACHE_SHIFT,
- PAGESIZE, UIO_READ, AFS_UIOSYS);
-#else
- setup_uio(&tuio, &iovec, (char*)address, pageoff(pp), PAGESIZE,
+ setup_uio(&tuio, &iovec, (char*)address, offset, PAGESIZE,
UIO_READ, AFS_UIOSYS);
-#endif
-#if defined(AFS_LINUX24_ENV)
- lock_kernel();
-#endif
code = afs_rdwr((struct vcache*)ip, &tuio, UIO_READ, 0, credp);
-#if defined(AFS_LINUX24_ENV)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
unlock_kernel();
#endif
if (tuio.uio_resid) /* zero remainder of page */
memset((void*)(address+(PAGESIZE-tuio.uio_resid)), 0,
tuio.uio_resid);
-#if defined(AFS_LINUX24_ENV)
-#ifndef __powerpc__
- flush_dcache_page(pp);
-#endif
- SetPageUptodate(pp);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ flush_dcache_page(pp);
+ SetPageUptodate(pp);
#else
set_bit(PG_uptodate, &pp->flags);
#endif
}
-#if defined(AFS_LINUX24_ENV)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+ kunmap(pp);
UnlockPage(pp);
#else
clear_bit(PG_locked, &pp->flags);
wake_up(&pp->wait);
-#endif
free_page(address);
+#endif
crfree(credp);
afs_Trace4(afs_iclSetp, CM_TRACE_READPAGE,
AFS_GUNLOCK();
SetPageUptodate(pp);
UnlockPage(pp);
- /* kunmap(pp); */
if (status == offset)
return 0;
else
unsigned int count)
{
struct vcache *vcp = (struct vcache *) ip;
- u8 *page_addr = (u8*) afs_linux_page_address(pp);
+ char *buffer;
+ loff_t base;
int code = 0;
cred_t *credp;
uio_t tuio;
struct iovec iovec;
int f_flags = 0;
+ buffer = kmap(pp) + offset;
+ base = (pp->index << PAGE_CACHE_SHIFT) + offset;
+
credp = crref();
afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, atomic_read(&pp->count),
ICL_TYPE_INT32, 99999);
- setup_uio(&tuio, &iovec, page_addr + offset,
- (pp->index << PAGE_CACHE_SHIFT) + offset, count,
- UIO_WRITE, AFS_UIOSYS);
+ setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS);
code = afs_write(vcp, &tuio, f_flags, credp, 0);
ICL_TYPE_INT32, code);
crfree(credp);
+ kunmap(pp);
return code;
}
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, atomic_read(&pp->count),
ICL_TYPE_INT32, 99999);
- setup_uio(&tuio, &iovec, page_addr + offset, pageoff(pp) + offset, count,
+ setup_uio(&tuio, &iovec, page_addr + offset, pp->offset + offset, count,
UIO_WRITE, AFS_UIOSYS);
code = afs_write(vcp, &tuio, fp->f_flags, credp, 0);
#if defined(AFS_LINUX24_ENV)
static int afs_linux_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to)
{
- long status;
+ int code;
AFS_GLOCK();
lock_kernel();
- status = afs_linux_updatepage(file, page, offset, to-offset);
+ code = afs_linux_updatepage(file, page, offset, to-offset);
unlock_kernel();
AFS_GUNLOCK();
kunmap(page);
- return status;
+ return code;
}
static int afs_linux_prepare_write(struct file *file, struct page *page,
AFS_GLOCK();
lock_kernel();
code = afs_linux_ireadlink(ip, p, PAGE_SIZE, AFS_UIOSYS);
- unlock_kernel();
- AFS_GUNLOCK();
if (code<0)
goto fail;
p[code] = '\0'; /* null terminate? */
+ unlock_kernel();
+ AFS_GUNLOCK();
+
SetPageUptodate(page);
kunmap(page);
UnlockPage(page);
return 0;
fail:
+ unlock_kernel();
+ AFS_GUNLOCK();
+
SetPageError(page);
kunmap(page);
UnlockPage(page);
#define __AFS_SYSINCLUDESH__ 1
#include <stdio.h>
+#if !defined(AFS_USR_DARWIN_ENV) && !defined(AFS_USR_FBSD_ENV) /* must be included after KERNEL undef'd */
#include <errno.h>
+#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#define FREAD 0x0001
#endif /* AFS_USR_LINUX22_ENV */
+#if defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV)
+#ifdef KERNEL
+#undef KERNEL
+#define AFS_USR_UNDEF_KERNEL_ENV 1
+#endif
+#include <errno.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <sys/file.h>
+#include <sys/ioctl.h>
+#include <sys/stat.h>
+#include <sys/fcntl.h>
+#include <sys/uio.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#ifndef O_SYNC
+#define O_SYNC O_FSYNC
+#endif
+#endif /* AFS_USR_DARWIN_ENV || AFS_USR_FBSD_ENV */
+
/* glibc 2.2 has pthread_attr_setstacksize */
#if defined(AFS_LINUX22_ENV) || defined(AFS_USR_LINUX22_ENV) && (__GLIBC_MINOR__ < 2)
#define pthread_attr_setstacksize(a,b) 0
#undef socket
#endif /* AFS_USR_SGI_ENV */
+#if defined(AFS_USR_DARWIN_ENV) || defined(AFS_USR_FBSD_ENV)
+#undef if_mtu
+#undef if_metric
+#endif
+
#define mount usr_mount
#define fs usr_fs
#define uio usr_uio
struct usr_ucred {
unsigned long cr_ref;
long cr_uid;
+#if !defined(AFS_USR_FBSD_ENV)
long cr_gid;
+#endif
long cr_ruid;
long cr_rgid;
long cr_suid;
#else
struct min_direct { /* miniature direct structure */
/* If struct direct changes, this must too */
+#ifdef AFS_DARWIN_ENV
+ afs_uint32 d_fileno;
+ u_short d_reclen;
+ u_char d_type;
+ u_char d_namlen;
+#else
#ifdef AFS_SUN5_ENV
afs_uint32 d_fileno;
afs_int32 d_off;
u_short d_reclen;
u_short d_namlen;
#endif
+#endif
};
#endif /* AFS_SGI_ENV */
#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
sdirEntry.d_off = off;
#endif
+#if defined(AFS_DARWIN_ENV)
+ sdirEntry.d_type=DT_UNKNOWN;
+#endif
#if defined(AFS_SGI_ENV)
AFS_UIOMOVE(&sdirEntry, DIRENTBASESIZE, UIO_READ, auio, code);
* It has to do with 'offset' (seek locations).
*/
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs_readdir(OSI_VC_ARG(avc), auio, acred, eofp)
int *eofp;
#else
#endif /* AFS_SGI61_ENV */
#endif /* defined(AFS_SGI53_ENV) */
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
/* Not really used by the callee so we ignore it for now */
if (eofp) *eofp = 0;
#endif
#define VPageCleaning 0x2 /* Solaris - Cache Trunc Daemon sez keep out */
#define CPSIZE 2
+#if !defined(AFS_FBSD_ENV)
#define vrefCount v.v_count
+#else
+#define vrefCount v.v_usecount
+#endif /* AFS_FBSD_ENV */
#define AFS_MAXDV 0x7fffffff /* largest dataversion number */
#define AFS_NOTRUNC 0x7fffffff /* largest dataversion number */
* Do not try to get the vcache lock when the vlock is held */
afs_rwlock_t vlock;
#endif /* defined(AFS_SUN5_ENV) */
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV)
#if defined(AFS_SUN5_ENV)
krwlock_t rwlock;
struct cred *credp;
#endif
#ifdef AFS_AIX_ENV
int ownslock; /* pid of owner of excl lock, else 0 - defect 3083 */
+#endif
+#ifdef AFS_DARWIN_ENV
+ struct lock__bsd__ rwlock;
#endif
afs_int32 parentVnode; /* Parent dir, if a file. */
afs_int32 parentUnique;
(((avc)->states & CStatd) ? (vcache2inode(avc), 0) : \
afs_VerifyVCache2((avc),areq))
#else
+#ifdef AFS_DARWIN_ENV
+#define afs_VerifyVCache(avc, areq) \
+ (((avc)->states & CStatd) ? (osi_VM_Setup(avc), 0) : \
+ afs_VerifyVCache2((avc),areq))
+#else
#define afs_VerifyVCache(avc, areq) \
(((avc)->states & CStatd) ? 0 : afs_VerifyVCache2((avc),areq))
#endif
+#endif
#define DO_STATS 1 /* bits used by FindVCache */
#define DO_VLRU 2
#define VN_UNLOCK(vp) simple_unlock(&(vp)->v_lock)
#endif
+/* get a file's serial number from a vnode */
+#ifndef afs_vnodeToInumber
+#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#define afs_vnodeToInumber(V) VnodeToIno(V)
+#else
+#ifdef AFS_DECOSF_ENV
+#define afs_vnodeToInumber(V) osi_vnodeToInumber(V)
+#else
+#define afs_vnodeToInumber(V) (VTOI(V)->i_number)
+#endif /* AFS_DECOSF_ENV */
+#endif /* AFS_SGI62_ENV */
+#endif
+
+/* get a file's device number from a vnode */
+#ifndef afs_vnodeToDev
+#if defined(AFS_SGI62_ENV) || defined(AFS_HAVE_VXFS) || defined(AFS_DARWIN_ENV)
+#define afs_vnodeToDev(V) VnodeToDev(V)
+#else
+#ifdef AFS_DECOSF_ENV
+#define afs_vnodeToDev(V) osi_vnodeToDev(V)
+#else
+#define afs_vnodeToDev(V) (VTOI(V)->i_dev)
+#endif /* AFS_DECOSF_ENV */
+#endif /* AFS_SGI62_ENV */
+#endif
+
#endif /* _AFS_H_ */
struct afs_icl_set *afs_iclSetp = (struct afs_icl_set*)0;
struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set*)0;
-#if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
+#if defined(AFS_GLOBAL_SUNLOCK) && !defined(AFS_HPUX_ENV) && !defined(AFS_AIX41_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+
kmutex_t afs_global_lock;
kmutex_t afs_rxglobal_lock;
#if defined(AFS_OSF_ENV)
simple_lock_data_t afs_global_lock;
+#elif defined(AFS_DARWIN_ENV)
+struct lock__bsd__ afs_global_lock;
+#endif
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
thread_t afs_global_owner;
#endif /* AFS_OSF_ENV */
if (!afs_suser() && (parm != AFSOP_GETMTU)
&& (parm != AFSOP_GETMASK)) {
/* only root can run this code */
-#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(EACCES);
return(EACCES);
#else
while (afs_initState < AFSOP_START_AFS)
afs_osi_Sleep(&afs_initState);
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
temp = AFS_MINBUFFERS; /* Should fix this soon */
#else
temp = ((afs_bufferpages * NBPG)>>11); /* number of 2k buffers we could get from all of the buffer space */
struct afsop_cell tcell;
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *lcnamep = 0;
char *tbuffer1 = osi_AllocSmallSpace(AFS_SMALLOCSIZ), *cnamep = 0;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
while (afs_initState < AFSOP_START_BKG) afs_osi_Sleep(&afs_initState);
AFS_COPYIN((char *)parm2, (caddr_t) &cparms, sizeof(cparms), code);
if (code) {
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined (AFS_SGI64_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
goto out;
#else
setuerror(code);
code = afs_InitCacheFile((char *) 0, ainode);
}
else if (parm == AFSOP_ROOTVOLUME) {
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
else if (parm == AFSOP_CACHEFILE || parm == AFSOP_CACHEINFO ||
parm == AFSOP_VOLUMEINFO || parm == AFSOP_AFSLOG) {
char *tbuffer = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t bufferSize;
#else /* AFS_SGI61_ENV */
u_int bufferSize;
#endif /* AFS_SGI62_ENV && !AFS_SGI65_ENV */
#endif /* AFS_SGI53_ENV */
else if (parm == AFSOP_SHUTDOWN) {
-#if defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
extern struct mount *afs_globalVFS;
#else /* AFS_OSF_ENV */
extern struct vfs *afs_globalVFS;
afs_vfs_mount(parm2, parm3, parm4, parm5);
#endif /* AFS_HPUX100_ENV */
#else /* defined(AFS_HPUX_ENV) */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL;
#else
setuerror(EINVAL);
}
#endif /* AFS_SUN57_64BIT_ENV */
-#if defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV)
struct iparam32 dst32;
#ifdef AFS_SPARC64_LINUX20_ENV
- if (current->tss.flags & SPARC_FLAG_32BIT) {
+ if (current->tss.flags & SPARC_FLAG_32BIT)
#else
#error Not done for this linux version
-#endif
+#endif /* AFS_SPARC64_LINUX20_ENV */
+ {
AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code);
if (!code)
iparam32_to_iparam(&dst32, dst);
{
int *retval = &rvp->r_val1;
#else /* AFS_SUN5_ENV */
-#if defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
afs3_syscall(p, args, retval)
struct proc *p;
void *args;
mutex_exit(&procp->p_crlock);
#else
AFS_GLOCK();
-#if defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
code = afs_setpag(p, args, retval);
#else /* AFS_OSF_ENV */
code = afs_setpag();
AFS_GLOCK();
#ifdef AFS_SUN5_ENV
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, rvp, CRED());
+#else
+#ifdef AFS_DARWIN_ENV
+ code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4, p->p_cred->pc_ucred);
#else
code = afs_syscall_pioctl(uap->parm1, uap->parm2, uap->parm3, uap->parm4);
+#endif
#endif
AFS_GUNLOCK();
} else if (uap->syscall == AFSCALL_ICREATE) {
code = copyin_iparam((char *)uap->parm3, &iparams);
if (code) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(code);
#endif
} else
iparams.param3, iparams.param4, rvp, CRED());
#else
code = afs_syscall_icreate(uap->parm1, uap->parm2, iparams.param1, iparams.param2,
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
iparams.param3, iparams.param4, retval);
#else
iparams.param3, iparams.param4);
#ifdef AFS_SUN5_ENV
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, rvp, CRED());
#else
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3, retval);
#else
code = afs_syscall_iopen(uap->parm1, uap->parm2, uap->parm3);
}
#else
if (code) {
-#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
+#if !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(code);
#endif
}
#endif /* !AFS_LINUX20_ENV */
} else {
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL;
#else
setuerror(EINVAL);
register afs_int32 code;
struct afs_icl_log *logp;
struct afs_icl_set *setp;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
size_t temp;
#else /* AFS_SGI61_ENV */
afs_uint32 temp;
}
#else
if (!afs_suser()) { /* only root can run this code */
-#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV)
setuerror(EACCES);
return EACCES;
#else
/*
* Vnode related macros
*/
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+extern int (**afs_vnodeop_p)();
+#define IsAfsVnode(vc) ((vc)->v_op == afs_vnodeop_p)
+#define SetAfsVnode(vc) (vc)->v_op = afs_vnodeop_p
+#else
extern struct vnodeops *afs_ops;
-#define vType(vc) (vc)->v.v_type
-#define vSetType(vc,type) (vc)->v.v_type = (type)
#define IsAfsVnode(vc) ((vc)->v_op == afs_ops)
#define SetAfsVnode(vc) (vc)->v_op = afs_ops
+#endif
+#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)
#ifdef AFS_SGI65_ENV
* (Also, of course, the vnode is assumed to be one of ours. Can't use this
* macro for V-file vnodes.)
*/
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+/* Bare refcount manipulation would probably work on this platform, but just
+ calling VREF does not */
+#define AFS_FAST_HOLD(vp) osi_vnhold((vp),0)
+#else
#define AFS_FAST_HOLD(vp) VN_HOLD(&(vp)->v)
+#endif
#define AFS_FAST_RELE(vp) AFS_RELE(&(vp)->v)
/*
AFS_GLOCK(); \
} while(0)
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
int haveGlock = ISAFS_GLOCK(); \
if (haveGlock) \
AFS_GLOCK(); \
} while(0)
-#else /* AFS_OSF_ENV */
+#else /* AFS_OSF_ENV || AFS_FBSD_ENV */
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
int haveGlock = ISAFS_GLOCK(); \
if (haveGlock) \
AFS_GLOCK(); \
} while(0)
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_OSF_ENV || AFS_FBSD_ENV */
#else /* AFS_GLOBAL_SUNLOCK */
CODE = copyout((SRC),(DST),(LEN)); \
} while(0)
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
(UIO)->uio_rw = (RW); \
CODE = uiomove((SRC),(LEN),(UIO)); \
} while(0)
-#else /* AFS_OSF_ENV */
+#else /* AFS_OSF_ENV || AFS_FBSD_ENV */
#define AFS_UIOMOVE(SRC,LEN,RW,UIO,CODE) \
do { \
CODE = uiomove((SRC),(LEN),(RW),(UIO)); \
} while(0)
-#endif /* AFS_OSF_ENV */
+#endif /* AFS_OSF_ENV || AFS_FBSD_ENV */
#endif /* AFS_GLOBAL_SUNLOCK */
}
#endif /* defined(AFS_SGI_ENV) && (_MIPS_SZLONG==64) */
-#if defined(AFS_LINUX_64BIT_KERNEL)
+#if defined(AFS_LINUX_64BIT_KERNEL) && !defined(AFS_ALPHA_LINUX20_ENV)
struct afs_ioctl32 dst32;
#ifdef AFS_SPARC64_LINUX20_ENV
- if (current->tss.flags & SPARC_FLAG_32BIT) {
+ if (current->tss.flags & SPARC_FLAG_32BIT)
#else
#error Not done for this linux type
-#endif
+#endif /* AFS_SPARC64_LINUX20_ENV */
+ {
AFS_COPYIN(cmarg, (caddr_t) &dst32, sizeof dst32, code);
if (!code)
afs_ioctl32_to_afs_ioctl(&dst32, dst);
caddr_t arg;
} *uap = (struct a *)args;
#else /* AFS_OSF_ENV */
+#ifdef AFS_DARWIN_ENV
+struct ioctl_args {
+ int fd;
+ u_long com;
+ caddr_t arg;
+};
+afs_xioctl(p, uap, retval)
+ struct proc *p;
+ register struct ioctl_args *uap;
+ register_t *retval;
+{
+#else
#ifdef AFS_LINUX22_ENV
struct afs_ioctl_sys {
unsigned int com;
caddr_t arg;
} *uap = (struct a *)u.u_ap;
#endif /* AFS_LINUX22_ENV */
+#endif /* AFS_DARWIN_ENV */
#endif /* AFS_OSF_ENV */
#endif /* AFS_SUN5_ENV */
#endif
#ifndef AFS_LINUX22_ENV
-#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
struct file *fd;
#else
register struct file *fd;
register int ioctlDone = 0, code = 0;
AFS_STATCNT(afs_xioctl);
+#ifdef AFS_DARWIN_ENV
+ if ((code=fdgetf(p, uap->fd, &fd)))
+ return code;
+#else
#ifdef AFS_LINUX22_ENV
ua.com = com;
ua.arg = arg;
#endif
#endif
#endif
+#endif
#endif
/* first determine whether this is any sort of vnode */
if (code) {
osi_FreeSmallSpace(datap);
AFS_GUNLOCK();
+#ifdef AFS_DARWIN_ENV
+ return code;
+#else
#if defined(AFS_SUN5_ENV)
#ifdef AFS_SUN54_ENV
releasef(uap->fd);
return;
#endif
#endif
+#endif
#endif
}
code = HandleIoctl(tvc, uap->com, datap);
#endif
code = ioctl(uap, rvp);
#else
+#if defined(AFS_DARWIN_ENV)
+ return ioctl(p, uap, retval);
+#else
#ifdef AFS_OSF_ENV
code = ioctl(p, args, retval);
#ifdef AFS_OSF30_ENV
#endif
#endif
#endif
+#endif
#endif
}
#ifdef AFS_SUN5_ENV
#ifdef AFS_LINUX22_ENV
return -code;
#else
-#if !defined(AFS_OSF_ENV)
+#if !defined(AFS_OSF_ENV) && !defined(AFS_DARWIN_ENV)
if (!getuerror())
setuerror(code);
#if defined(AFS_AIX32_ENV) && !defined(AFS_AIX41_ENV)
#endif
#endif /* AFS_LINUX22_ENV */
#endif /* AFS_SUN5_ENV */
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#endif
}
extern struct mount *afs_globalVFS;
#else /* AFS_OSF_ENV */
+#ifdef AFS_DARWIN_ENV
+afs_pioctl(p, args, retval)
+ struct proc *p;
+ void *args;
+ int *retval;
+{
+ struct a {
+ char *path;
+ int cmd;
+ caddr_t cmarg;
+ int follow;
+ } *uap = (struct a *) args;
+
+ AFS_STATCNT(afs_pioctl);
+ return (afs_syscall_pioctl(uap->path, uap->cmd, uap->cmarg, uap->follow, p->p_cred->pc_ucred));
+}
+
+extern struct mount *afs_globalVFS;
+#else /* AFS_OSF_ENV */
extern struct vfs *afs_globalVFS;
#endif
+#endif
/* macro to avoid adding any more #ifdef's to pioctl code. */
#if defined(AFS_LINUX22_ENV) || defined(AFS_AIX41_ENV)
rval_t *rvp;
struct AFS_UCRED *credp;
#else
+#ifdef AFS_DARWIN_ENV
+afs_syscall_pioctl(path, com, cmarg, follow, credp)
+ struct AFS_UCRED *credp;
+#else
afs_syscall_pioctl(path, com, cmarg, follow)
+#endif
#endif
char *path;
- int com;
+ unsigned int com;
caddr_t cmarg;
int follow;
{
#ifndef AFS_SUN5_ENV
if (! _VALIDVICEIOCTL(com)) {
PIOCTL_FREE_CRED();
-#ifdef AFS_OSF_ENV
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV)
return EINVAL;
#else /* AFS_OSF_ENV */
#if defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
code = copyin_afs_ioctl(cmarg, &data);
if (code) {
PIOCTL_FREE_CRED();
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
setuerror(code);
#endif
}
if ((com & 0xff) == PSetClientContext) {
-#ifdef AFS_LINUX22_ENV
+#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return EINVAL; /* Not handling these yet. */
-#endif
+#else
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV)
code = HandleClientContext(&data, &com, &foreigncreds, credp);
#else
code = HandleClientContext(&data, &com, &foreigncreds, u.u_cred);
#endif /* AFS_SGI_ENV */
#endif
+#endif
#endif
if (code) {
if (foreigncreds) {
crfree(foreigncreds);
}
PIOCTL_FREE_CRED();
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return (setuerror(code), code);
#endif
}
}
-#ifndef AFS_LINUX22_ENV
+#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
/*
* We could have done without temporary setting the u.u_cred below
if ((com & 0xff) == 15) {
/* special case prefetch so entire pathname eval occurs in helper process.
otherwise, the pioctl call is essentially useless */
-#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = Prefetch(path, &data, follow,
foreigncreds ? foreigncreds : credp);
#else
#endif /* AFS_SGI64_ENV */
#endif /* AFS_HPUX101_ENV */
#endif
-#ifndef AFS_LINUX22_ENV
+#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred); /* restore original credentials */
}
#endif /* AFS_LINUX22_ENV */
PIOCTL_FREE_CRED();
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return (setuerror(code), code);
#endif /* AFS_AIX41_ENV */
AFS_GLOCK();
if (code) {
-#ifndef AFS_LINUX22_ENV
+#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred); /* restore original credentials */
}
#endif /* AFS_LINUX22_ENV */
PIOCTL_FREE_CRED();
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
return(setuerror(code), code);
code = afs_HandlePioctl(vp, com, &data, follow, &credp);
}
#else
-#ifdef AFS_LINUX22_ENV
+#if defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = afs_HandlePioctl(vp, com, &data, follow, &credp);
#else
code = afs_HandlePioctl(vp, com, &data, follow, &u.u_cred);
#endif /* AFS_AIX41_ENV */
#endif /* AFS_SUN5_ENV */
} else {
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
code = EINVAL; /* not in /afs */
#else
setuerror(EINVAL);
#endif
}
-#ifndef AFS_LINUX22_ENV
+#if !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV)
if (foreigncreds) {
#ifdef AFS_AIX41_ENV
crset(tmpcred);
#endif
}
PIOCTL_FREE_CRED();
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (code);
#else
if (!getuerror())
afs_PutCell(tcell, READ_LOCK);
if (set_parent_pag) {
int pag;
+#ifdef AFS_DARWIN_ENV
+ struct proc *p=current_proc(); /* XXX */
+ uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
+ p->p_pid, p->p_comm);
+ if (!setpag(p, acred, -1, &pag, 1)) {
+#else
#ifdef AFS_OSF_ENV
if (!setpag(u.u_procp, acred, -1, &pag, 1)) { /* XXX u.u_procp is a no-op XXX */
#else
if (!setpag(acred, -1, &pag, 1)) {
+#endif
#endif
afs_InitReq(&treq, *acred);
areq = &treq;
cp = ain;
bcopy(cp, (char *)&volstat, sizeof(AFSFetchVolumeStatus));
cp += sizeof(AFSFetchVolumeStatus);
+ if (strlen(cp) >= sizeof(volName))
+ return E2BIG;
strcpy(volName, cp);
cp += strlen(volName)+1;
+ if (strlen(cp) >= sizeof(offLineMsg))
+ return E2BIG;
strcpy(offLineMsg, cp);
cp += strlen(offLineMsg)+1;
+ if (strlen(cp) >= sizeof(motd))
+ return E2BIG;
strcpy(motd, cp);
storeStat.Mask = 0;
if (volstat.MinQuota != -1) {
{
register char *tp;
register afs_int32 code;
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV)
+ size_t bufferSize;
+#else
u_int bufferSize;
+#endif
AFS_STATCNT(Prefetch);
if (!apath) return EINVAL;
if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) {
#if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
VN_HOLD((struct vnode *)tvc);
+#else
+#if defined(AFS_DARWIN_ENV)
+ osi_vnhold(tvc, 0);
#else
tvc->vrefCount++;
+#endif
#endif
ReleaseReadLock(&afs_xvcache);
#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
AFS_STATCNT(PSetSysName);
if (!afs_globalVFS) {
/* Afsd is NOT running; disable it */
-#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV) || defined(AFS_DARWIN_ENV)
return (EINVAL);
#else
return (setuerror(EINVAL), EINVAL);
#define AFS_XLATOR_MAGIC 0x87654321
#endif
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#define AFS_NFSXLATORREQ(cred) 0
+#else
#ifdef AFS_OSF_ENV
#define AFS_NFSXLATORREQ(cred) ((cred)->cr_ruid == NFSXLATOR_CRED)
#else
#define AFS_NFSXLATORREQ(cred) ((cred)->cr_rgid == NFSXLATOR_CRED)
#endif
+#endif
struct exporterops {
int (*export_reqhandler)();
SRCDIR = DEST/
SOURCES = afsd.c sys.c
-INSTALL = ${SRCDIR}bin/install
-INSTALLro = ${SRCDIR}bin/install -m 644
-INSTALLex = ${SRCDIR}bin/install -m 755
COMPONENT=afsd
include ../config/Makefile.${SYS_NAME}
include ../config/Makefile.version
+INSTALLro = ${INSTALL} -m 644
+INSTALLex = ${INSTALL} -m 755
CFLAGS = -g -I${SRCDIR}include ${XCFLAGS}
LDFLAGS = -g ${XLDFLAGS}
afsd: afsd.o $(AFSLIBS)
case ${SYS_NAME} in \
- rs_aix*) \
- ${CC} ${CFLAGS} -g -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} ;; \
sgi_61 | sgi_62 | sgi_63) \
${CC} ${CFLAGS} -g -o afsd afsd.o $(NON_SHARED) $(LDFLAGS) $(AFSLIBS) ${XLIBS} /usr/lib/libdwarf.a /usr/lib/libelf.a ;; \
sgi_64 | sgi_65 ) \
hp?00_ux10? ) \
${INSTALL} afs.rc.hpux10 ${DESTDIR}root.client/usr/vice/etc/dkload/afs.rc ;;\
*linux* ) \
- ${INSTALLex} -f afs.rc.linux ${DESTDIR}root.client/usr/vice/etc/afs.rc; \
- ${INSTALL} afs.conf.linux ${DESTDIR}root.client/usr/vice/etc/afs.conf ;; \
+ ${INSTALLex} afs.rc.linux ${DESTDIR}root.client/usr/vice/etc/afs.rc; \
+ ${INSTALL} afs.conf.linux ${DESTDIR}root.client/usr/vice/etc/afs.conf ;; \
+ ppc_darwin*) \
+ mkdir -p ${DESTDIR}root.client/usr/vice/etc/afs.kext/Contents/MacOS ;\
+ ${INSTALL} -f afs.ppc_darwin.plist ${DESTDIR}root.client/usr/vice/etc/afs.kext/Contents/Info.plist ; \
+ ${INSTALLex} -f afs.rc.darwin ${DESTDIR}root.client/usr/vice/etc/afs.rc ; \
+ ${INSTALL} -f afs.rc.darwin.plist ${DESTDIR}root.client/usr/vice/etc/StartupParameters.plist ;; \
+ *fbsd*) \
+ mkdir -p ${DESTDIR}root.client/usr/vice/etc/afs.rc; \
+ ${INSTALL} -f afs.rc.fbsd ${DESTDIR}root.client/usr/vice/etc/afs.rc.fbsd ;; \
* ) \
echo No rc scripts installed for ${SYS_NAME} ;; \
esac
+
+
+
AR=ar
AS=as
CP=cp
-INSTALL=install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=install
#
# Other OS specific requirements
#
AR=ar
AS=as
CP=cp
-INSTALL=install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=install
#
# Other OS specific requirements
#
AR=ar
AS=as
CP=cp
-INSTALL=install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=install
#
# Other OS specific requirements
#
AR=ar
AS=as
CP=cp
-INSTALL=${SRCDIR}bin/install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=${DESTDIR}bin/install
#
# Other OS specific requirements
#
AR=ar
AS=as
CP=cp
-INSTALL=install
LD=ld
MT_CC=cc
MV=mv
RANLIB=ranlib
RM=rm
-WASHTOOL=${SRCDIR}bin/washtool
+WASHTOOL=${DESTDIR}bin/washtool
+INSTALL=install
#
# Other OS specific requirements
#
SHELL=/bin/sh
DESTDIR = DEST/
SRCDIR = DEST/
-INSTALL = install
INCLUDE= -I. -I/usr/include
Aobj=COMMON
Dobj=DYNEL
# -Wall
<i386_linux22 i386_linux24>
CCFLAGS = -O2 -fomit-frame-pointer \
- -fno-strength-reduce -pipe -m486 -malign-loops=2 -malign-jumps=2 \
+ -fno-strength-reduce -pipe -march=i486 -malign-loops=2 -malign-jumps=2 \
-malign-functions=2
-DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
+DEFINES = -D__KERNEL__ -DCPU=586 -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF} ${KDEFINES}
+<alpha_linux_22 alpha_linux_24>
+CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce -pipe -mno-fp-regs -ffixed-8
+DEFINES = -D__KERNEL__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
<s390_linux22 s390_linux24>
-CCFLAGS = -O2 -fomit-frame-pointer -fno-strength-reduce \
+CCFLAGS = -O -fomit-frame-pointer -fno-strength-reduce \
-fno-strict-aliasing -fsigned-char
DEFINES = -D__KERNEL__ -D__s390__ -DKERNEL -D_KERNEL -DMODULE ${SMP_DEF}
KOBJ = MODLOAD
MPS = MP SP
+# To pick up anything we might have missed
+include Makefile.extradefs
+
# COMPDIRS is called in Makefile.common to do the actual builds.
COMPDIRS=linux_compdirs
mkdir -p $${KDIR}; \
ln -fs ../Makefile $${KDIR}/Makefile ; \
ln -fs ../Makefile.common $${KDIR}/Makefile.common; \
+<i386_linux22 i386_linux24>
+ sh ./redhat.sh ${LINUX_VERS} $${KDIR}/Makefile.extradefs; \
+<all>
done \
done
rm -f sys; \
ln -s $${IDIR} sys; \
rm -f asm; \
+<alpha_linux_22 alpha_linux_24>
+ ln -s ${LINUX_SRCDIR}$$v/include/asm-alpha asm ; \
<i386_linux22 i386_linux24>
ln -s ${LINUX_SRCDIR}/include/asm-i386 asm ; \
+<s390_linux22 s390_linux24>
+ ln -s ${LINUX_SRCDIR}/include/asm-s390 asm ; \
<ppc_linux22 ppc_linux24>
ln -s ${LINUX_SRCDIR}/include/asm-ppc asm ; \
<sparc_linux22 sparc_linux24>
KDIR=${KOBJ}-$$m ; \
echo Building in directory: $${KDIR} ; \
if [ "$$m" = "MP" ] ; then \
- SMP_DEF="-DAFS_SMP" ; \
+ SMP_DEF="-DAFS_SMP -D__BOOT_KERNEL_SMP=1 -D__BOOT_KERNEL_UP=0 -D__SMP__" ; \
TARG="libafs.mp" ; \
else \
- SMP_DEF="" ; \
+ SMP_DEF="-D__BOOT_KERNEL_SMP=0 -D__BOOT_KERNEL_UP=1 -U__SMP__" ; \
TARG=libafs ; \
fi ; \
cd $${KDIR} ; \
- $(MAKE) DESTDIR=${DESTDIR} SMP_DEF=$${SMP_DEF} $${TARG} CLIENT="" || exit $$?; \
+ $(MAKE) DESTDIR=${DESTDIR} SMP_DEF="$${SMP_DEF}" $${TARG} CLIENT= || exit $$?; \
cd ../ ; \
done \
done
extern void *malloc(int size);
extern void *realloc(void *ptr, int size);
#endif
-#if defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_S390_LINUX20_ENV)
extern int PRE_Block; /* from preempt.c */
#else
extern char PRE_Block; /* from preempt.c */
#ifdef __hp9000s800
savecontext(Create_Process_Part2, &temp2->context, stackptr+MINFRAME);
#else
-#ifdef AFS_SGI62_ENV
+#if defined(AFS_SGI62_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
/* Need to have the sp on an 8-byte boundary for storing doubles. */
savecontext(Create_Process_Part2, &temp2->context,
stackptr+stacksize-16); /* 16 = 2 * jmp_buf_type*/
savecontext(Dispatcher, &(temp -> context),
&(LWPANCHOR.dsptchstack[MINFRAME]));
#else
-#ifdef AFS_SGI62_ENV
+#if defined(AFS_SGI62_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
savecontext(Dispatcher, &(temp -> context),
&(LWPANCHOR.dsptchstack[(sizeof LWPANCHOR.dsptchstack)-8]));
#else
\*******************************************************************/
#include <afs/param.h>
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
int PRE_Block = 0;
#else
#include <sys/time.h>
#elif defined(AFS_SPARC64_LINUX20_ENV) && defined(AFS_32BIT_USR_ENV)
#define LWP_SP 0
#define LWP_FP 1
+#elif defined(AFS_ALPHA_LINUX20_ENV)
+#define LWP_SP 8
+#define LWP_FP 7
#else
#error Unsupported linux LWP system type.
#endif
+#elif defined(AFS_X86_FBSD_ENV)
+#define LWP_SP 4
+#elif defined(AFS_DARWIN_ENV)
+#define LWP_SP 16
#else
Need offset to SP in jmp_buf for this platform.
#endif
typedef __uint64_t jmp_buf_type;
#endif
#else
+#ifdef AFS_ALPHA_LINUX20_ENV
+typedef long jmp_buf_type;
+#else
typedef int jmp_buf_type;
-#endif
+#endif /*AFS_ALPHA_LINUX20_ENV*/
+#endif /*SGI*/
static jmp_buf jmp_tmp;
static char (*EP)();
extern afs_uint32 LWP_ThreadId();
#endif /* RXDEBUG */
+int (*registerProgram)() = 0;
+int (*swapNameProgram)() = 0;
+
#ifdef AFS_GLOBAL_RXLOCK_KERNEL
struct rx_tq_debug {
afs_int32 rxi_start_aborted; /* rxi_start awoke after rxi_Send in error. */
** pretty good that the next packet coming in is from the same connection
** as the last packet, since we're send multiple packets in a transmit window.
*/
-struct rx_connection *rxLastConn;
+struct rx_connection *rxLastConn = 0;
#ifdef RX_ENABLE_LOCKS
/* The locking hierarchy for rx fine grain locking is composed of five
void rx_StartServer(donateMe)
{
register struct rx_service *service;
- register int i;
+ register int i, nProcs;
SPLVAR;
clock_NewTime();
AFS_RXGUNLOCK();
USERPRI;
- if (donateMe) rx_ServerProc(); /* Never returns */
+ if (donateMe) {
+#ifndef AFS_NT40_ENV
+#ifndef KERNEL
+ int code;
+ char name[32];
+#ifdef AFS_PTHREAD_ENV
+ pid_t pid;
+ pid = pthread_self();
+#else /* AFS_PTHREAD_ENV */
+ PROCESS pid;
+ code = LWP_CurrentProcess(&pid);
+#endif /* AFS_PTHREAD_ENV */
+
+ sprintf(name,"srv_%d", ++nProcs);
+ if (registerProgram)
+ (*registerProgram)(pid, name);
+#endif /* KERNEL */
+#endif /* AFS_NT40_ENV */
+ rx_ServerProc(); /* Never returns */
+ }
return;
}
} else if (call->nSoftAcks > (u_short)rxi_SoftAckRate) {
rxevent_Cancel(call->delayedAckEvent, call, RX_CALL_REFCOUNT_DELAY);
np = rxi_SendAck(call, np, seq, serial, flags,
- RX_ACK_DELAY, istack);
+ RX_ACK_IDLE, istack);
} else if (call->nSoftAcks) {
clock_GetTime(&when);
if (haveLast && !(flags & RX_CLIENT_INITIATED)) {
if (tp->header.seq >= first) break;
call->tfirst = tp->header.seq + 1;
if (tp->header.serial == serial) {
- rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
+ /* Use RTT if not delayed by client. */
+ if (ap->reason != RX_ACK_DELAY)
+ rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
#ifdef ADAPT_WINDOW
rxi_ComputeRate(peer, call, tp, np, ap->reason);
#endif
}
- else if ((tp->firstSerial == serial)) {
- rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
+ else if (tp->firstSerial == serial) {
+ /* Use RTT if not delayed by client. */
+ if (ap->reason != RX_ACK_DELAY)
+ rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
#ifdef ADAPT_WINDOW
rxi_ComputeRate(peer, call, tp, np, ap->reason);
#endif
#endif /* RX_ENABLE_LOCKS */
#endif /* AFS_GLOBAL_RXLOCK_KERNEL */
if (tp->header.serial == serial) {
- rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
+ /* Use RTT if not delayed by client. */
+ if (ap->reason != RX_ACK_DELAY)
+ rxi_ComputeRoundTripTime(tp, &tp->timeSent, peer);
#ifdef ADAPT_WINDOW
rxi_ComputeRate(peer, call, tp, np, ap->reason);
#endif
}
else if ((tp->firstSerial == serial)) {
- rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
+ /* Use RTT if not delayed by client. */
+ if (ap->reason != RX_ACK_DELAY)
+ rxi_ComputeRoundTripTime(tp, &tp->firstSent, peer);
#ifdef ADAPT_WINDOW
rxi_ComputeRate(peer, call, tp, np, ap->reason);
#endif
if (call->flags & RX_CALL_CLEARED) {
/* send an ack now to start the packet flow up again */
call->flags &= ~RX_CALL_CLEARED;
- rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_DELAY, 0);
+ rxi_SendAck(call, 0, 0, 0, 0, RX_ACK_IDLE, 0);
}
#ifdef RX_ENABLE_LOCKS
CV_SIGNAL(&sq->cv);
}
/* Send all of the packets in the list in single datagram */
-static void rxi_SendList(call, list, len, istack, moreFlag, now, retryTime)
+static void rxi_SendList(call, list, len, istack, moreFlag, now, retryTime, resending)
struct rx_call *call;
struct rx_packet **list;
int len;
int moreFlag;
struct clock *now;
struct clock *retryTime;
+ int resending;
{
int i;
int requestAck = 0;
MUTEX_ENTER(&peer->peer_lock);
peer->nSent += len;
+ if (resending) peer->reSends += len;
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.dataPacketsSent += len;
MUTEX_EXIT(&rx_stats_mutex);
MUTEX_ENTER(&peer->peer_lock);
peer->nSent++;
+ if (resending) peer->reSends++;
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.dataPacketsSent++;
MUTEX_EXIT(&rx_stats_mutex);
* We always keep the last list we should have sent so we
* can set the RX_MORE_PACKETS flags correctly.
*/
-static void rxi_SendXmitList(call, list, len, istack, now, retryTime)
+static void rxi_SendXmitList(call, list, len, istack, now, retryTime, resending)
struct rx_call *call;
struct rx_packet **list;
int len;
int istack;
struct clock *now;
struct clock *retryTime;
+ int resending;
{
int i, cnt, lastCnt = 0;
struct rx_packet **listP, **lastP = 0;
|| list[i]->acked
|| list[i]->length > RX_JUMBOBUFFERSIZE)) {
if (lastCnt > 0) {
- rxi_SendList(call, lastP, lastCnt, istack, 1, now, retryTime);
+ rxi_SendList(call, lastP, lastCnt, istack, 1, now, retryTime, resending);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error || (call->flags & RX_CALL_FAST_RECOVER_WAIT))
|| list[i]->length != RX_JUMBOBUFFERSIZE) {
if (lastCnt > 0) {
rxi_SendList(call, lastP, lastCnt, istack, 1,
- now, retryTime);
+ now, retryTime, resending);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error || (call->flags&RX_CALL_FAST_RECOVER_WAIT))
}
if (lastCnt > 0) {
rxi_SendList(call, lastP, lastCnt, istack, morePackets,
- now, retryTime);
+ now, retryTime, resending);
/* If the call enters an error state stop sending, or if
* we entered congestion recovery mode, stop sending */
if (call->error || (call->flags & RX_CALL_FAST_RECOVER_WAIT))
return;
}
if (morePackets) {
- rxi_SendList(call, listP, cnt, istack, 0, now, retryTime);
+ rxi_SendList(call, listP, cnt, istack, 0, now, retryTime, resending);
}
} else if (lastCnt > 0) {
- rxi_SendList(call, lastP, lastCnt, istack, 0, now, retryTime);
+ rxi_SendList(call, lastP, lastCnt, istack, 0, now, retryTime, resending);
}
}
int nXmitPackets;
int maxXmitPackets;
struct rx_packet **xmitList;
+ int resending = 0;
/* If rxi_Start is being called as a result of a resend event,
* then make sure that the event pointer is removed from the call
if (event && event == call->resendEvent) {
CALL_RELE(call, RX_CALL_REFCOUNT_RESEND);
call->resendEvent = NULL;
+ resending = 1;
if (queue_IsEmpty(&call->tq)) {
/* Nothing to do */
return;
* ready to send. Now we loop to send the packets */
if (nXmitPackets > 0) {
rxi_SendXmitList(call, xmitList, nXmitPackets, istack,
- &now, &retryTime);
+ &now, &retryTime, resending);
}
osi_Free(xmitList, maxXmitPackets * sizeof(struct rx_packet *));
{
struct clock thisRtt, *rttp = &thisRtt;
+#if defined(AFS_ALPHA_LINUX22_ENV) && defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
+ /* making year 2038 bugs to get this running now - stroucki */
+ struct timeval temptime;
+#endif
register int rtt_timeout;
static char id[]="@(#)adaptive RTO";
- clock_GetTime(rttp);
+#if defined(AFS_ALPHA_LINUX20_ENV) && defined(AFS_PTHREAD_ENV) && !defined(KERNEL)
+ /* yet again. This was the worst Heisenbug of the port - stroucki */
+ clock_GetTime(&temptime);
+ rttp->sec=(afs_int32)temptime.tv_sec;
+ rttp->usec=(afs_int32)temptime.tv_usec;
+#else
+ clock_GetTime(rttp);
+#endif
if (clock_Lt(rttp, sentp)) {
clock_Zero(rttp);
return; /* somebody set the clock back, don't count this time. */
#include <windows.h>
#include <WINNT\afssw.h>
#endif
+#ifdef AFS_DARWIN_ENV
+#include <unistd.h>
+#endif
/* local vars */
/* static storage for path strings */
strcpy(afsSrvDirPath, AFSDIR_CANONICAL_SERVER_AFS_DIRPATH);
/* setup the root client directory path */
+#ifdef AFS_DARWIN_ENV
+ if (access(AFSDIR_ALTERNATE_CLIENT_VICE_DIRPATH, F_OK) == 0)
+ strcpy(afsClntDirPath, AFSDIR_ALTERNATE_CLIENT_VICE_DIRPATH);
+ else
+#endif
strcpy(afsClntDirPath, AFSDIR_CANONICAL_CLIENT_VICE_DIRPATH);
/* setup top level dirpath; valid for both server and client */
#define AFSDIR_CANONICAL_USR_DIRPATH "/usr"
#define AFSDIR_CANONICAL_SERVER_AFS_DIRPATH "/etc/openafs"
#define AFSDIR_CANONICAL_CLIENT_VICE_DIRPATH "/etc/openafs"
+#ifdef AFS_DARWIN_ENV
+#define AFSDIR_ALTERNATE_CLIENT_VICE_DIRPATH "/var/db/openafs"
+#endif
+
#define AFSDIR_CANONICAL_SERVER_BIN_DIRPATH \
"/usr/lib/openafs/" AFSDIR_BIN_DIR
LINUX_VERS=dummy
include ../config/Makefile.${SYS_NAME}
-INSTALL = ${DESTDIR}bin/install
-INSTALLex = ${DESTDIR}bin/install -m 755
+INSTALLex = ${INSTALL} -m 755
CCXPG2= /usr/xpg2bin/cc
CFLAGS = ${OPTMZ} -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS}
# set -x; \
# case ${SYS_NAME} in \
# sgi_6? ) \
-# ${INSTALLex} -f kdump.sh.sgi_ipnos $@; \
+# ${INSTALLex} kdump.sh.sgi_ipnos $@; \
# ln -fs kdump ${DESTDIR}etc/kdump32; \
# ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP22; \
# ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP32; \
# do ${INSTALL} -s $$f ${DESTDIR}etc/$$f || exit $$? ; \
# done ;; \
# sun4x_57 ) \
-# ${INSTALLex} -f kdump.sh.solaris7 $@; \
+# ${INSTALLex} kdump.sh.solaris7 $@; \
# ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
# *linux* ) \
# for lv in ${LINUX_VERS}; do \
# ${INSTALL} -s kdump-$$lv ${DESTDIR}etc/kdump-$$lv ; \
# done ;; \
# hp_ux11* ) \
-# ${INSTALLex} -f kdump.sh.hp_ux11 $@; \
+# ${INSTALLex} kdump.sh.hp_ux11 $@; \
# ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
# *) \
# ${INSTALL} -s $? $@ ;; \
# esac
+${DESTDIR}etc/kdump: kdump
+ -set -x; \
+ case ${SYS_NAME} in \
+ sgi_6? ) \
+ ${INSTALLex} kdump.sh.sgi_ipnos $@; \
+ ln -fs kdump ${DESTDIR}etc/kdump32; \
+ ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP22; \
+ ln -fs kdump.IP20 ${DESTDIR}etc/kdump.IP32; \
+ for f in kdump.IP??; \
+ do ${INSTALL} -s $$f ${DESTDIR}etc/$$f || exit $$? ; \
+ done ;; \
+ sun4x_57 ) \
+ ${INSTALLex} kdump.sh.solaris7 $@; \
+ ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
+ *linux* ) \
+ for lv in ${LINUX_VERS}; do \
+ ${INSTALL} -s kdump-$$lv ${DESTDIR}etc/kdump-$$lv ; \
+ done ;; \
+ hp_ux11* ) \
+ ${INSTALLex} kdump.sh.hp_ux11 $@; \
+ ${INSTALL} -s -f $? ${DESTDIR}etc/kdump32;; \
+ *) \
+ ${INSTALL} -s $? $@ ;; \
+ esac
+
+${DESTDIR}etc/kdump64: kdump64
+ -set -x; \
+ case ${SYS_NAME} in \
+ sun4x_57 | hp_ux11* ) \
+ ${INSTALL} -s $? $@ ;;\
+ * ) \
+ echo skipping kdump64 for ${SYS_NAME} ;; \
+ esac
+from
+r
install: all ${DESTDIR}bin/fs ${DESTDIR}root.server/usr/afs/bin/fs \
$(CC) -o cmdebug cmdebug.o ${CFLAGS} ${CMLIBS} ${XLIBS}
kdump.o: kdump.c ${INCLS} AFS_component_version_number.c
- set -x; \
+ -set -x; \
case ${SYS_NAME} in \
+ alpha_linux* ) \
+ for lv in ${LINUX_VERS}; do \
+ ${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS} -mno-fp-regs -ffixed-8 -o kdump-$$lv.o -c kdump.c ; \
+ done ;; \
*linux* ) \
for lv in ${LINUX_VERS}; do \
${CC} -g -I${LINUX_SRCDIR}$$lv/include -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS} -o kdump-$$lv.o -c kdump.c ; \
esac ;
kdump64.o : kdump.c ${INCLS} AFS_component_version_number.c
- set -x; \
+ -set -x; \
case ${SYS_NAME} in \
sun4x_57 | hp_ux11* ) \
${CC} -g -I${DESTDIR}include -I${SRCDIR}include ${XCFLAGS64} -o kdump64.o -c kdump.c ;; \
esac
kdump: kdump.o
- set -x; \
+ -set -x; \
case ${SYS_NAME} in \
sun4c_51 | sun4c_52 | sun4m_51 | sun4m_52 | sun4c_53 | sun4m_53 | sun4_53 | sun4_54 | sun4c_54 | sun4m_54 | sunx86_54) \
${CC} -g -o kdump kdump.o ${DESTDIR}lib/afs/libcmd.a ${DESTDIR}lib/afs/util.a /usr/lib/libkvm.a -lelf ${XLIBS} ;; \
## kdump to read from 64 bit kernel dumps
kdump64 : kdump64.o
- set -x; \
+ -set -x; \
case ${SYS_NAME} in \
sun4x_57 | hp_ux11* ) \
${CC} -g ${XCFLAGS64} -o kdump64 kdump64.o ${DESTDIR}lib/afs/libcmd64.a ${XLIBELFA} ${XLIBKVM} ${XLIBS} ;; \
#include <afs/param.h>
#include <stdio.h>
#include <sys/types.h>
-#if !defined(AFS_SUN3_ENV) && !defined(sys_vax_ul43)
+#if !defined(AFS_SUN3_ENV) && !defined(sys_vax_ul43) && !defined(AFS_DARWIN_ENV)
#include <time.h>
/*#ifdef AFS_AIX_ENV*/
#include <sys/time.h>
#ifndef lint
#endif
/*
+
System: VICE-TWO
Module: partition.c
Institution: The Information Technology Center, Carnegie-Mellon University
#include <winioctl.h>
#else
#include <sys/param.h>
-
+#include <sys/types.h>
+
#if AFS_HAVE_STATVFS
#include <sys/statvfs.h>
#endif /* AFS_HAVE_STATVFS */
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <sys/mount.h>
+#endif
#if !defined(AFS_SGI_ENV)
#ifdef AFS_OSF_ENV
#ifdef AFS_SUN5_ENV
#include <sys/fs/ufs_fs.h>
#else
+#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#include <ufs/ufs/dinode.h>
+#include <ufs/ffs/fs.h>
+#else
#include <ufs/fs.h>
#endif
+#endif
#else /* AFS_VFSINCL_ENV */
-#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV)
+#if !defined(AFS_AIX_ENV) && !defined(AFS_LINUX22_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
#include <sys/fs.h>
#endif
#endif /* AFS_VFSINCL_ENV */
#include "ntops.h"
#else
#include "namei_ops.h"
-#endif
+#if defined(AFS_SGI_ENV)
+#include <sys/dir.h>
+#else
+#include <dirent.h>
+#endif /* AFS_SGI_ENV */
+#endif /* AFS_NT40_ENV */
#endif /* AFS_NAMEI_ENV */
#include "vnode.h"
#include "volume.h"
char *devname;
{
struct stat status;
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_NT40_ENV)
+ char AFSIDatPath[MAXPATHLEN];
+#endif
/* Only keep track of "/vicepx" partitions since it can get hairy
* when NFS mounts are involved.. */
}
#endif
+#if !defined(AFS_LINUX20_ENV) && !defined(AFS_NT40_ENV)
+ strcpy(AFSIDatPath, part);
+ strcat(AFSIDatPath, "/AFSIDat");
+#ifdef AFS_NAMEI_ENV
+ if (stat(AFSIDatPath, &status) < 0) {
+ DIR *dirp;
+ struct dirent *dp;
+
+ dirp = opendir(part);
+ assert(dirp);
+ while (dp = readdir(dirp)) {
+ if (dp->d_name[0] == 'V') {
+ Log("This program is compiled with AFS_NAMEI_ENV, but partition %s seems to contain volumes which don't use the namei-interface; aborting\n", part);
+ closedir(dirp);
+ return -1;
+ }
+ }
+ closedir(dirp);
+ }
+#else /* AFS_NAMEI_ENV */
+ if (stat(AFSIDatPath, &status) == 0) {
+ Log("This program is compiled without AFS_NAMEI_ENV, but partition %s seems to contain volumes which use the namei-interface; aborting\n", part);
+ return -1;
+ }
+#endif /* AFS_NAMEI_ENV */f
+#endif
+
#ifdef AFS_SGI_XFS_IOPS_ENV
if (VerifyXFSInodeSize(part, status.st_fstype) < 0)
return -1;
}
#endif
-#ifdef AFS_DUX40_ENV
+#if defined(AFS_DUX40_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
int VAttachPartitions(void)
{
int errors = 0;
else if (strcmp(argv[code], "-enable_process_stats")==0) {
rx_enableProcessRPCStats();
}
+#ifndef AFS_NT40_ENV
+ else if (strcmp(argv[code], "-syslog")==0) {
+ /* set syslog logging flag */
+ serverLogSyslog = 1;
+ }
+ else if (strncmp(argv[code], "-syslog=", 8)==0) {
+ serverLogSyslog = 1;
+ serverLogSyslogFacility = atoi(argv[code]+8);
+ }
+#endif
else {
printf("volserver: unrecognized flag '%s'\n", argv[code]);
usage:
printf("Usage: volserver [-log] [-p <number of processes>] "
"[-udpsize <size of socket buffer in bytes>] "
+#ifndef AFS_NT40_ENV
+ "[-syslog[=FACILITY]] "
+#endif
/* "[-enable_peer_stats] [-enable_process_stats] " */
"[-help]\n");
VS_EXIT(1);