tviced: project viced vlserver libafsrpc libafsauthent
case ${SYS_NAME} in \
- alpha_dux*|sgi_*|sun4x_*|rs_aix*|*linux*|hp_ux110) \
+ alpha_dux*|sgi_*|sun*_*|rs_aix*|*linux*|hp_ux110) \
${COMPILE_PART1} tviced ${COMPILE_PART2} ;; \
*) \
echo Not building MT viced for ${SYS_NAME} ;; \
ntp: project volser
@case ${WITH_OBSOLETE} in \
YES) case ${SYS_NAME} in \
- sun4x_58 | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
+ sun4x_58 | sunx86_* | *linux* | *fbsd* | ppc_darwin* ) echo skipping ntp for ${SYS_NAME} ;; \
* ) ${COMPILE_PART1} ntp ${COMPILE_PART2} ;; \
esac ;; \
*) echo skipping deprecated target: ntp ;; \
int cr_ngroups;
} cred_t;
#define AFS_UCRED cred
+#define AFS_PROC struct task_struct
#define crhold(c) (c)->cr_ref++
/* UIO manipulation */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.10 2002/05/18 20:11:52 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_misc.c,v 1.11 2002/08/02 04:57:38 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
void osi_clear_inode(struct inode *ip)
{
cred_t *credp = crref();
- struct vcache *vc = ITOAFS(ip);
+ struct vcache *vcp = ITOAFS(ip);
#if defined(AFS_LINUX24_ENV)
if (atomic_read(&ip->i_count) > 1)
#endif
printf("afs_put_inode: ino %d (0x%x) has count %d\n", ip->i_ino, ip);
- ObtainWriteLock(&vc->lock, 504);
- afs_InactiveVCache(vc, credp);
- ReleaseWriteLock(&vc->lock);
+ afs_InactiveVCache(vcp, credp);
+ ObtainWriteLock(&vcp->lock, 504);
#if defined(AFS_LINUX24_ENV)
atomic_set(&ip->i_count, 0);
#else
ip->i_count = 0;
#endif
ip->i_nlink = 0; /* iput checks this after calling this routine. */
+ ReleaseWriteLock(&vcp->lock);
crfree(credp);
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.12 2002/05/12 05:50:42 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.13 2002/08/02 04:57:38 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
#endif
extern struct vcache *afs_globalVp;
+extern afs_rwlock_t afs_xvcache;
extern struct dentry_operations *afs_dops;
#if defined(AFS_LINUX24_ENV)
int len;
int origOffset;
cred_t *credp = crref();
+ struct afs_fakestat_state fakestat;
AFS_GLOCK();
AFS_STATCNT(afs_readdir);
return -code;
}
+ afs_InitFakeStat(&fakestat);
+ code = afs_EvalFakeStat(&avc, &fakestat, &treq);
+ if (code) {
+ afs_PutFakeStat(&fakestat);
+ AFS_GUNLOCK();
+ return -code;
+ }
+
/* update the cache entry */
tagain:
code = afs_VerifyVCache(avc, &treq);
if (code) {
+ afs_PutFakeStat(&fakestat);
AFS_GUNLOCK();
return -code;
}
/* get a reference to the entire directory */
tdc = afs_GetDCache(avc, 0, &treq, &origOffset, &len, 1);
if (!tdc) {
+ afs_PutFakeStat(&fakestat);
AFS_GUNLOCK();
return -ENOENT;
}
afs_PutDCache(tdc);
ReleaseReadLock(&avc->lock);
+ afs_PutFakeStat(&fakestat);
AFS_GUNLOCK();
return 0;
}
AFS_GLOCK();
code = afs_lockctl(vcp, &flock, cmd, credp);
AFS_GUNLOCK();
+
+ /* Convert flock back to Linux's file_lock */
+ flp->fl_type = flock.l_type;
+ flp->fl_pid = flock.l_pid;
+ flp->fl_start = flock.l_start;
+ flp->fl_end = flock.l_start + flock.l_len;
+
crfree(credp);
return -code;
cred_t *credp;
struct vrequest treq;
struct vcache *vcp = ITOAFS(dp->d_inode);
+ struct vcache *rootvp = NULL;
AFS_GLOCK();
+
+ if (afs_fakestat_enable && vcp->mvstat == 1 && vcp->mvid &&
+ (vcp->states & CMValid) && (vcp->states & CStatd)) {
+ ObtainSharedLock(&afs_xvcache, 680);
+ rootvp = afs_FindVCache(vcp->mvid, 0, 0, 0, 0);
+ ReleaseSharedLock(&afs_xvcache);
+ }
+
#ifdef AFS_LINUX24_ENV
lock_kernel();
#endif
/* 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 */
+ if (*dp->d_name.name != '/' && vcp->mvstat == 2) /* root vnode */
check_bad_parent(dp); /* check and correct mvid */
- vcache2inode(vcp);
+ if (rootvp)
+ vcache2fakeinode(rootvp, vcp);
+ else
+ vcache2inode(vcp);
#ifdef AFS_LINUX24_ENV
unlock_kernel();
#endif
+ if (rootvp) afs_PutVCache(rootvp);
AFS_GUNLOCK();
return 0;
}
/* afs_dentry_iput */
static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
{
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYIPUT,
+ ICL_TYPE_POINTER, ip,
+ ICL_TYPE_STRING, dp->d_parent->d_name.name,
+ ICL_TYPE_STRING, dp->d_name.name);
+ AFS_GUNLOCK();
+ }
+
osi_iput(ip);
}
+static int afs_dentry_delete(struct dentry *dp)
+{
+ if (ICL_SETACTIVE(afs_iclSetp)) {
+ AFS_GLOCK();
+ afs_Trace3(afs_iclSetp, CM_TRACE_DENTRYDELETE, ICL_TYPE_POINTER,
+ dp->d_inode, ICL_TYPE_STRING, dp->d_parent->d_name.name,
+ ICL_TYPE_STRING, dp->d_name.name);
+ AFS_GUNLOCK();
+ }
+
+ if (dp->d_inode && (ITOAFS(dp->d_inode)->states & CUnlinked))
+ return 1; /* bad inode? */
+
+ return 0;
+}
+
#if defined(AFS_LINUX24_ENV)
struct dentry_operations afs_dentry_operations = {
d_revalidate: afs_linux_dentry_revalidate,
d_iput: afs_dentry_iput,
+ d_delete: afs_dentry_delete,
};
struct dentry_operations *afs_dops = &afs_dentry_operations;
#else
afs_linux_dentry_revalidate, /* d_validate(struct dentry *) */
NULL, /* d_hash */
NULL, /* d_compare */
- NULL, /* d_delete(struct dentry *) */
+ afs_dentry_delete, /* d_delete(struct dentry *) */
NULL, /* d_release(struct dentry *) */
afs_dentry_iput /* d_iput(struct dentry *, struct inode *) */
};
int code;
cred_t *credp = crref();
const char *name = dp->d_name.name;
- int putback = 0;
AFS_GLOCK();
code = afs_remove(ITOAFS(dip), name, credp);
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, atomic_read(&pp->count),
ICL_TYPE_INT32, 99999);
+
setup_uio(&tuio, &iovec, buffer, base, count, UIO_WRITE, AFS_UIOSYS);
code = afs_write(vcp, &tuio, f_flags, credp, 0);
vcache2inode(vcp);
+ if (!code && afs_stats_cmperf.cacheCurrDirtyChunks >
+ afs_stats_cmperf.cacheMaxDirtyChunks) {
+ struct vrequest treq;
+
+ ObtainWriteLock(&vcp->lock, 533);
+ if (!afs_InitReq(&treq, credp))
+ code = afs_DoPartialWrite(vcp, &treq);
+ ReleaseWriteLock(&vcp->lock);
+ }
code = code ? -code : count - tuio.uio_resid;
+
afs_Trace4(afs_iclSetp, CM_TRACE_UPDATEPAGE, ICL_TYPE_POINTER, vcp,
ICL_TYPE_POINTER, pp,
ICL_TYPE_INT32, atomic_read(&pp->count),
esac
case ${SYS_NAME} in \
*linux* ) \
- ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs ;;\
+ ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DESTDIR}${includedir}/afs || true ;;\
* ) \
echo No vfs headers to install for ${SYS_NAME};; \
esac
esac
-case ${SYS_NAME} in \
*linux* ) \
- ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs ;;\
+ ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${DEST}/include/afs || true ;;\
* ) \
echo No vfs headers to install for ${SYS_NAME};; \
esac
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.10 2002/05/12 05:50:43 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_lookup.c,v 1.11 2002/08/02 04:57:38 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
afs_int32 afs_bulkStatsDone;
static int bulkStatCounter = 0; /* counter for bulk stat seq. numbers */
+int afs_fakestat_enable = 0;
/* this would be faster if it did comparison as int32word, but would be
}
/* call under write lock, evaluate mvid field from a mt pt.
- * avc is the vnode of the mount point object.
- * advc is the vnode of the containing directory
+ * avc is the vnode of the mount point object; must be write-locked.
+ * advc is the vnode of the containing directory (optional; if NULL and
+ * EvalMountPoint succeeds, caller must initialize *avolpp->dotdot)
* avolpp is where we return a pointer to the volume named by the mount pt, if success
* areq is the identity of the caller.
*
* to the new path.
*/
tvp->mtpoint = avc->fid; /* setup back pointer to mtpoint */
- tvp->dotdot = advc->fid;
+ if (advc) tvp->dotdot = advc->fid;
*avolpp = tvp;
return 0;
}
+
+/*
+ * afs_InitFakeStat
+ *
+ * Must be called on an afs_fakestat_state object before calling
+ * afs_EvalFakeStat or afs_PutFakeStat. Calling afs_PutFakeStat
+ * without calling afs_EvalFakeStat is legal, as long as this
+ * function is called.
+ */
+
+void
+afs_InitFakeStat(state)
+ struct afs_fakestat_state *state;
+{
+ state->valid = 1;
+ state->did_eval = 0;
+ state->need_release = 0;
+}
+
+/*
+ * afs_EvalFakeStat_int
+ *
+ * The actual implementation of afs_EvalFakeStat and afs_TryEvalFakeStat,
+ * which is called by those wrapper functions.
+ *
+ * Only issues RPCs if canblock is non-zero.
+ */
+static int
+afs_EvalFakeStat_int(avcp, state, areq, canblock)
+ struct vcache **avcp;
+ struct afs_fakestat_state *state;
+ struct vrequest *areq;
+ int canblock;
+{
+ struct vcache *tvc, *root_vp;
+ struct volume *tvolp = NULL;
+ int code = 0;
+
+ osi_Assert(state->valid == 1);
+ osi_Assert(state->did_eval == 0);
+ state->did_eval = 1;
+ if (!afs_fakestat_enable)
+ return 0;
+ tvc = *avcp;
+ if (tvc->mvstat != 1)
+ return 0;
+
+ /* Is the call to VerifyVCache really necessary? */
+ code = afs_VerifyVCache(tvc, areq);
+ if (code)
+ goto done;
+ if (canblock) {
+ ObtainWriteLock(&tvc->lock, 599);
+ code = EvalMountPoint(tvc, NULL, &tvolp, areq);
+ ReleaseWriteLock(&tvc->lock);
+ if (code)
+ goto done;
+ if (tvolp) {
+ tvolp->dotdot = tvc->fid;
+ tvolp->dotdot.Fid.Vnode = tvc->parentVnode;
+ tvolp->dotdot.Fid.Unique = tvc->parentUnique;
+ }
+ }
+ if (tvc->mvid && (tvc->states & CMValid)) {
+ if (!canblock) {
+ afs_int32 retry;
+
+ do {
+ retry = 0;
+ ObtainWriteLock(&afs_xvcache, 597);
+ root_vp = afs_FindVCache(tvc->mvid, 0, 0, &retry, 0);
+ if (root_vp && retry) {
+ ReleaseWriteLock(&afs_xvcache);
+ afs_PutVCache(root_vp, 0);
+ }
+ } while (root_vp && retry);
+ ReleaseWriteLock(&afs_xvcache);
+ } else {
+ root_vp = afs_GetVCache(tvc->mvid, areq, NULL, NULL, WRITE_LOCK);
+ }
+ if (!root_vp) {
+ code = canblock ? ENOENT : 0;
+ goto done;
+ }
+ if (tvolp) {
+ /* Is this always kosher? Perhaps we should instead use
+ * NBObtainWriteLock to avoid potential deadlock.
+ */
+ ObtainWriteLock(&root_vp->lock, 598);
+ if (!root_vp->mvid)
+ root_vp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
+ *root_vp->mvid = tvolp->dotdot;
+ ReleaseWriteLock(&root_vp->lock);
+ }
+ state->need_release = 1;
+ state->root_vp = root_vp;
+ *avcp = root_vp;
+ code = 0;
+ } else {
+ code = canblock ? ENOENT : 0;
+ }
+
+done:
+ if (tvolp)
+ afs_PutVolume(tvolp, WRITE_LOCK);
+ return code;
+}
+
+/*
+ * afs_EvalFakeStat
+ *
+ * Automatically does the equivalent of EvalMountPoint for vcache entries
+ * which are mount points. Remembers enough state to properly release
+ * the volume root vcache when afs_PutFakeStat() is called.
+ *
+ * State variable must be initialized by afs_InitFakeState() beforehand.
+ *
+ * Returns 0 when everything succeeds and *avcp points to the vcache entry
+ * that should be used for the real vnode operation. Returns non-zero if
+ * something goes wrong and the error code should be returned to the user.
+ */
+int
+afs_EvalFakeStat(avcp, state, areq)
+ struct vcache **avcp;
+ struct afs_fakestat_state *state;
+ struct vrequest *areq;
+{
+ return afs_EvalFakeStat_int(avcp, state, areq, 1);
+}
+
+/*
+ * afs_TryEvalFakeStat
+ *
+ * Same as afs_EvalFakeStat, but tries not to talk to remote servers
+ * and only evaluate the mount point if all the data is already in
+ * local caches.
+ *
+ * Returns 0 if everything succeeds and *avcp points to a valid
+ * vcache entry (possibly evaluated).
+ */
+int
+afs_TryEvalFakeStat(avcp, state, areq)
+ struct vcache **avcp;
+ struct afs_fakestat_state *state;
+ struct vrequest *areq;
+{
+ return afs_EvalFakeStat_int(avcp, state, areq, 0);
+}
+
+/*
+ * afs_PutFakeStat
+ *
+ * Perform any necessary cleanup at the end of a vnode op, given that
+ * afs_InitFakeStat was previously called with this state.
+ */
+void
+afs_PutFakeStat(state)
+ struct afs_fakestat_state *state;
+{
+ osi_Assert(state->valid == 1);
+ if (state->need_release)
+ afs_PutVCache(state->root_vp, 0);
+ state->valid = 0;
+}
afs_ENameOK(aname)
register char *aname; {
int no_read_access = 0;
struct sysname_info sysState; /* used only for @sys checking */
int dynrootRetry = 1;
+ struct afs_fakestat_state fakestate;
AFS_STATCNT(afs_lookup);
+ afs_InitFakeStat(&fakestate);
+
+ if (code = afs_InitReq(&treq, acred))
+ goto done;
+
+ code = afs_EvalFakeStat(&adp, &fakestate, &treq);
+ if (code)
+ goto done;
#ifdef AFS_OSF_ENV
ndp->ni_dvp = AFSTOV(adp);
memcpy(aname, ndp->ni_ptr, ndp->ni_namelen);
*avcp = (struct vcache *) 0; /* Since some callers don't initialize it */
- if (code = afs_InitReq(&treq, acred)) {
- goto done;
- }
-
/* come back to here if we encounter a non-existent object in a read-only
volume's directory */
if (!(flags & AFS_LOOKUP_NOEVAL))
/* don't eval mount points */
#endif /* UKERNEL && AFS_WEB_ENHANCEMENTS */
- if (tvc->mvstat == 1) {
- /* a mt point, possibly unevaluated */
- struct volume *tvolp;
+ if (!afs_fakestat_enable && tvc->mvstat == 1) {
+ /* a mt point, possibly unevaluated */
+ struct volume *tvolp;
ObtainWriteLock(&tvc->lock,133);
code = EvalMountPoint(tvc, adp, &tvolp, &treq);
if (!FidCmp(&(tvc->fid), &(adp->fid))) {
afs_PutVCache(*avcp, WRITE_LOCK);
*avcp = NULL;
+ afs_PutFakeStat(&fakestate);
return afs_CheckCode(EISDIR, &treq, 18);
}
}
/* So Linux inode cache is up to date. */
code = afs_VerifyVCache(tvc, &treq);
#else
+ afs_PutFakeStat(&fakestate);
return 0; /* can't have been any errors if hit and !code */
#endif
}
*avcp = (struct vcache *)0;
}
+ afs_PutFakeStat(&fakestate);
return code;
}
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.7 2001/07/15 07:22:27 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/VNOPS/afs_vnop_readdir.c,v 1.8 2002/08/02 04:57:38 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
struct DirEntry *ode = 0, *nde = 0;
int o_slen = 0, n_slen = 0;
afs_uint32 us;
+ struct afs_fakestat_state fakestate;
#if defined(AFS_SGI53_ENV)
afs_int32 use64BitDirent;
#endif /* defined(AFS_SGI53_ENV) */
return code;
}
/* update the cache entry */
+ afs_InitFakeStat(&fakestate);
+ code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+ if (code) goto done;
tagain:
code = afs_VerifyVCache(avc, &treq);
if (code) goto done;
#ifdef AFS_HPUX_ENV
osi_FreeSmallSpace((char *)sdirEntry);
#endif
+ afs_PutFakeStat(&fakestate);
code = afs_CheckCode(code, &treq, 28);
return code;
}
struct minnfs_direct *sdirEntry = (struct minnfs_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
afs_int32 rlen;
#endif
+ struct afs_fakestat_state fakestate;
AFS_STATCNT(afs_readdir);
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
#endif
return code;
}
+ afs_InitFakeStat(&fakestate);
+ code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+ if (code) {
+#ifdef AFS_HPUX_ENV
+ osi_FreeSmallSpace((char *)sdirEntry);
+#endif
+ afs_PutFakeStat(&fakestate);
+ return code;
+ }
/* update the cache entry */
tagain:
code = afs_VerifyVCache(avc, &treq);
#if defined(AFS_HPUX_ENV) || defined(AFS_OSF_ENV)
osi_FreeSmallSpace((char *)sdirEntry);
#endif
+ afs_PutFakeStat(&fakestate);
code = afs_CheckCode(code, &treq, 29);
return code;
}
u_short vlport; /* volume server port */
short states; /* state flags */
short cellIndex; /* relative index number per cell */
+ short realcellIndex; /* as above but ignoring aliases */
time_t timeout; /* data expire time, if non-zero */
char *realName; /* who this cell is an alias for */
};
#ifdef AFS_DARWIN_ENV
struct lock__bsd__ rwlock;
#endif
- afs_int32 parentVnode; /* Parent dir, if a file. */
+ afs_int32 parentVnode; /* Parent dir, if a file. */
afs_int32 parentUnique;
struct VenusFid *mvid; /* Either parent dir (if root) or root (if mt pt) */
char *linkData; /* Link data if a symlink. */
#endif /* AFS_SGI62_ENV */
#endif
+/* fakestat support: opaque storage for afs_EvalFakeStat to remember
+ * what vcache should be released.
+ */
+struct afs_fakestat_state {
+ char valid;
+ char did_eval;
+ char need_release;
+ struct vcache *root_vp;
+};
+
+extern int afs_fakestat_enable;
+
#endif /* _AFS_H_ */
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.12 2002/06/10 12:02:02 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.13 2002/08/02 04:57:37 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
else if (parm == AFSOP_SET_DYNROOT) {
code = afs_SetDynrootEnable(parm2);
}
+ else if (parm == AFSOP_SET_FAKESTAT) {
+ afs_fakestat_enable = parm2;
+ code = 0;
+ }
else
code = EINVAL;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.13 2002/06/10 12:02:03 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.14 2002/08/02 04:57:37 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
PRxStatPeer, /* 54 - control peer RX statistics */
PGetRxkcrypt, /* 55 -- Get rxkad encryption flag */
PSetRxkcrypt, /* 56 -- Set rxkad encryption flag */
- PNoop, /* 57 -- arla: set file prio */
- PNoop, /* 58 -- arla: fallback getfh */
- PNoop, /* 59 -- arla: fallback fhopen */
- PNoop, /* 60 -- arla: controls xfsdebug */
- PNoop, /* 61 -- arla: controls arla debug */
- PNoop, /* 62 -- arla: debug interface */
- PNoop, /* 63 -- arla: print xfs status */
- PNoop, /* 64 -- arla: force cache check */
- PNoop, /* 65 -- arla: break callback */
+ PBogus, /* 57 -- arla: set file prio */
+ PBogus, /* 58 -- arla: fallback getfh */
+ PBogus, /* 59 -- arla: fallback fhopen */
+ PBogus, /* 60 -- arla: controls xfsdebug */
+ PBogus, /* 61 -- arla: controls arla debug */
+ PBogus, /* 62 -- arla: debug interface */
+ PBogus, /* 63 -- arla: print xfs status */
+ PBogus, /* 64 -- arla: force cache check */
+ PBogus, /* 65 -- arla: break callback */
PPrefetchFromTape, /* 66 -- MR-AFS: prefetch file from tape */
PResidencyCmd, /* 67 -- MR-AFS: generic commnd interface */
- PNoop, /* 68 -- arla: fetch stats */
+ PBogus, /* 68 -- arla: fetch stats */
};
static int (*(CpioctlSw[]))() = {
afs_HandlePioctl(avc, acom, ablob, afollow, acred)
- register struct vcache *avc;
+ struct vcache *avc;
afs_int32 acom;
struct AFS_UCRED **acred;
register struct afs_ioctl *ablob;
char *inData, *outData;
int (*(*pioctlSw))();
int pioctlSwSize;
+ struct afs_fakestat_state fakestate;
afs_Trace3(afs_iclSetp, CM_TRACE_PIOCTL, ICL_TYPE_INT32, acom & 0xff,
ICL_TYPE_POINTER, avc, ICL_TYPE_INT32, afollow);
AFS_STATCNT(HandlePioctl);
if (code = afs_InitReq(&treq, *acred)) return code;
+ afs_InitFakeStat(&fakestate);
+ if (avc) {
+ code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+ if (code) {
+ afs_PutFakeStat(&fakestate);
+ return code;
+ }
+ }
device = (acom & 0xff00) >> 8;
switch (device) {
case 'V': /* Original pioctl's */
pioctlSwSize = sizeof(CpioctlSw);
break;
default:
+ afs_PutFakeStat(&fakestate);
return EINVAL;
}
function = acom & 0xff;
if (function >= (pioctlSwSize / sizeof(char *))) {
- return EINVAL; /* out of range */
+ afs_PutFakeStat(&fakestate);
+ return EINVAL; /* out of range */
}
inSize = ablob->in_size;
if (inSize >= PIGGYSIZE) return E2BIG;
}
else code = 0;
if (code) {
- osi_FreeLargeSpace(inData);
- return code;
+ osi_FreeLargeSpace(inData);
+ afs_PutFakeStat(&fakestate);
+ return code;
}
outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
outSize = 0;
AFS_COPYOUT(outData, ablob->out, outSize, code);
}
osi_FreeLargeSpace(outData);
+ afs_PutFakeStat(&fakestate);
return afs_CheckCode(code, &treq, 41);
}
ain += sizeof(afs_int32); /* skip id field */
/* rest is cell name, look it up */
/* some versions of gcc appear to need != 0 in order to get this right */
- if (flag & 0x8000 != 0) { /* XXX Use Constant XXX */
+ if ((flag & 0x8000) != 0) { /* XXX Use Constant XXX */
flag &= ~0x8000;
set_parent_pag = 1;
}
code = ENOENT;
goto out;
}
- if (vType(tvc) != VLNK) {
+ if (tvc->mvstat != 1) {
afs_PutVCache(tvc, WRITE_LOCK);
code = EINVAL;
goto out;
memcpy((char *)&whichCell, tp, sizeof(afs_int32));
tp += sizeof(afs_int32);
- ObtainReadLock(&afs_xcell);
- for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
- tcell = QTOC(cq); tq = QNext(cq);
- if (tcell->states & CAlias) {
- tcell = 0;
- continue;
- }
- if (whichCell == 0) break;
- tcell = 0;
- whichCell--;
- }
+ tcell = afs_GetRealCellByIndex(whichCell, READ_LOCK, 0);
if (tcell) {
cp = aout;
memset(cp, 0, MAXCELLHOSTS * sizeof(afs_int32));
cp += strlen(tcell->cellName)+1;
*aoutSize = cp - aout;
}
- ReleaseReadLock(&afs_xcell);
if (tcell) return 0;
else return EDOM;
}
afs_PutDCache(tdc);
goto out;
}
- if (vType(tvc) != VLNK) {
+ if (tvc->mvstat != 1) {
afs_PutDCache(tdc);
afs_PutVCache(tvc, WRITE_LOCK);
code = EINVAL;
code = ENOENT;
goto out;
}
- if (vType(tvc) != VLNK) {
+ if (tvc->mvstat != 1) {
afs_PutVCache(tvc, WRITE_LOCK);
code = EINVAL;
goto out;
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef CONFIG_X86_LOCAL_APIC
#define CONFIG_X86_LOCAL_APIC
#endif
#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
+
/* Machine / Operating system information */
#define SYS_NAME "i386_linux22"
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef CONFIG_X86_LOCAL_APIC
#define CONFIG_X86_LOCAL_APIC
#endif
#include <afs/afs_sysnames.h>
#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
#define AFSLITTLE_ENDIAN 1
#define AFS_HAVE_FFS 1 /* Use system's ffs. */
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef __SMP__
#define __SMP__
#endif
#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
-
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
/* Machine / Operating system information */
#define SYS_NAME "ppc_linux22"
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef __SMP__
#define __SMP__
#endif
#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
-
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
/* Machine / Operating system information */
#define SYS_NAME "ppc_linux24"
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef __SMP__
#define __SMP__
#endif
* MP to compile for Linux
*/
#ifdef AFS_SMP
-#define CONFIG_SMP
+#define CONFIG_SMP 1
#ifndef __SMP__
#define __SMP__
#endif
#define AFS_USERSPACE_IP_ADDR 1
#define RXK_LISTENER_ENV 1
-#define AFS_GCPAGS 0 /* if nonzero, garbage collect PAGs */
+#define AFS_GCPAGS 2 /* Set to Userdisabled, allow sysctl to override */
/* Machine / Operating system information */
#define SYS_NAME "sparc_linux22"
AFSNFSOBJS = \
afs_nfsclnt.o \
afs_nfsdisp.o \
- afs_nfsdisp_v3.o \
afs_call_nfs.o \
afs_pioctl_nfs.o \
$(AFS_OS_NFSOBJS)
$(CRULE1);
afs_nfsdisp.o: $(AFS)/afs_nfsdisp.c
$(CRULE1);
-afs_nfsdisp_v3.o: $(AFS)/afs_nfsdisp_v3.c
- $(CRULE1);
rx.o: $(RX)/rx.c
$(CRULE1);
rx_clock.o: $(RX)/rx_clock.c
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/vol/partition.c,v 1.10 2002/05/12 05:50:44 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/vol/partition.c,v 1.11 2002/08/02 04:57:39 hartmans Exp $");
#include <ctype.h>
#ifdef AFS_NT40_ENV
else
DiskPartitionList = dp;
dp->next = 0;
- strcpy(dp->name, path);
+ dp->name = (char *)malloc(strlen(path) + 1);
+ strncpy(dp->name, path, strlen(path) + 1);
#if defined(AFS_NAMEI_ENV) && !defined(AFS_NT40_ENV)
/* Create a lockfile for the partition, of the form /vicepa/Lock/vicepa */
+ dp->devName = (char *)malloc(2 * strlen(path) + 6);
strcpy(dp->devName, path);
strcat(dp->devName, "/");
strcat(dp->devName, "Lock");
close(open(dp->devName, O_RDWR | O_CREAT, 0600));
dp->device = volutil_GetPartitionID(path);
#else
- strcpy(dp->devName, devname);
+ dp->devName = (char *)malloc(strlen(devname) + 1);
+ strncpy(dp->devName, devname, strlen(devname) + 1);
dp->device = dev;
#endif
dp->lock_fd = -1;