+++ /dev/null
-# Microsoft Developer Studio Generated Dependency File, included by _IsUser.mak
-
-.\_Isuser.RC : \
- ".\sdrc.h"\
-
#else
int cr_ref;
#endif
- unsigned short cr_uid; /* euid */
- unsigned short cr_ruid; /* uid */
- unsigned short cr_gid; /* egid */
- unsigned short cr_rgid; /* gid */
+ uid_t cr_uid; /* euid */
+ uid_t cr_ruid; /* uid */
+ gid_t cr_gid; /* egid */
+ gid_t cr_rgid; /* gid */
gid_t cr_groups[NGROUPS]; /* 32 groups - empty set to NOGROUP */
int cr_ngroups;
} cred_t;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.10 2001/09/20 06:47:38 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/LINUX/osi_vnodeops.c,v 1.11 2002/01/22 20:29:44 hartmans Exp $");
#include "../afs/sysincludes.h"
#include "../afs/afsincludes.h"
return -code ;
}
+
+/* Validate a dentry. Return 1 if unchanged, 0 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
+{
+ char *name;
+ cred_t *credp = crref();
+ struct vrequest treq;
+ struct vcache *lookupvcp = NULL;
+ int code, bad_dentry = 1;
+ struct sysname_info sysState;
+ struct vcache *vcp = (struct vcache*) dp->d_inode;
+ struct vcache *parentvcp = (struct vcache*) dp->d_parent->d_inode;
+
+ AFS_GLOCK();
+
+ /* If it's a negative dentry, then there's nothing to do. */
+ if (!vcp || !parentvcp)
+ goto done;
+
+ if (code = afs_InitReq(&treq, credp))
+ goto done;
+
+ Check_AtSys(parentvcp, dp->d_name.name, &sysState, &treq);
+ name = sysState.name;
+
+ /* First try looking up the DNLC */
+ if (lookupvcp = osi_dnlc_lookup(parentvcp, name, WRITE_LOCK)) {
+ /* Verify that the dentry does not point to an old inode */
+ if (vcp != lookupvcp)
+ goto done;
+ /* Check and correct mvid */
+ if (*name != '/' && vcp->mvstat == 2)
+ check_bad_parent(dp);
+ vcache2inode(vcp);
+ bad_dentry = 0;
+ goto done;
+ }
+
+ /* A DNLC lookup failure cannot be trusted. Try a real lookup */
+ code = afs_lookup(parentvcp, name, &lookupvcp, credp);
+
+ /* Verify that the dentry does not point to an old inode */
+ if (vcp != lookupvcp)
+ goto done;
+
+ bad_dentry = 0;
+
+done:
+ /* Clean up */
+ if (lookupvcp)
+ afs_PutVCache(lookupvcp, WRITE_LOCK);
+ if (sysState.allocked)
+ osi_FreeLargeSpace(name);
+
+ AFS_GUNLOCK();
+ crfree(credp);
+
+ if (bad_dentry) {
+ shrink_dcache_parent(dp);
+ d_drop(dp);
+ }
+
+ return !bad_dentry;
+}
+
+#ifdef notdef
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,10)
static int afs_linux_dentry_revalidate(struct dentry *dp, int flags)
#else
unsigned long timeout = 3*HZ; /* 3 seconds */
+ if (!ip)
+ printk("negative dentry: %s\n", dp->d_name.name);
+
if (!(flags & LOOKUP_CONTINUE)) {
long diff = CURRENT_TIME - dp->d_parent->d_inode->i_mtime;
out_bad:
return 0;
}
+#endif
/* afs_dentry_iput */
static void afs_dentry_iput(struct dentry *dp, struct inode *ip)
ip->i_data.a_ops = &afs_symlink_aops;
ip->i_mapping = &ip->i_data;
} else
- printk("afs_linux_lookup: FIXME\n");
+ printk("afs_linux_lookup: ip->i_mode 0x%x dp->d_name.name %s code %d\n", ip->i_mode, dp->d_name.name, code);
#else
if (S_ISDIR(ip->i_mode))
ip->i_op = &afs_dir_iops;
else if (S_ISLNK(ip->i_mode))
ip->i_op = &afs_symlink_iops;
#endif
- }
dp->d_time = jiffies;
dp->d_op = afs_dops;
d_add(dp, (struct inode*)vcp);
+ }
AFS_GUNLOCK();
crfree(credp);
const char *name = dp->d_name.name;
int putback = 0;
- if (!list_empty(&dp->d_hash)) {
- d_drop(dp);
- /* Install a definite non-existence if we're the only user. */
-#if defined(AFS_LINUX24_ENV)
- if (atomic_read(&dp->d_count) == 1)
-#else
- if (dp->d_count == 1)
-#endif
- putback = 1;
- }
-
AFS_GLOCK();
code = afs_remove((struct vcache*)dip, name, credp);
AFS_GUNLOCK();
- if (!code) {
- d_delete(dp);
- if (putback) {
- dp->d_time = jiffies;
- d_add(dp, NULL); /* means definitely does _not_ exist */
- }
- }
+ if (!code)
+ d_drop(dp);
crfree(credp);
return -code;
}
dp->d_time = jiffies;
d_instantiate(dp, (struct inode*)tvcp);
}
+
AFS_GUNLOCK();
crfree(credp);
return -code;
}
if (!code) {
- d_delete(dp);
+ d_drop(dp);
}
AFS_GUNLOCK();
pmax_ul43 | pmax_ul43a) \
${INSTALL} longc_procs.h ${TOP_INCDIR}/afs ;; \
esac
- -case ${SYS_NAME} in \
- *linux* ) \
- ${INSTALL} ${AFS_OSTYPE}/osi_vfs.h ${TOP_INCDIR}/afs ;;\
- * ) \
- echo No vfs headers to install for ${SYS_NAME};; \
- esac
# NOTE: linux case uses --new as well to work around bug in some versions of
# gencat.
short states; /* state flags */
short cellIndex; /* relative index number per cell */
time_t timeout; /* data expire time, if non-zero */
- struct cell *alias; /* what this cell is an alias for */
+ char *realName; /* who this cell is an alias for */
};
#define afs_PutCell(cellp, locktype)
#define VREFCOUNT_SET(v, c) atomic_set(&((vnode_t *) v)->v_count, c)
#define VREFCOUNT_DEC(v) atomic_dec(&((vnode_t *) v)->v_count)
#define VREFCOUNT_INC(v) atomic_inc(&((vnode_t *) v)->v_count)
+#define DLOCK() spin_lock(&dcache_lock)
+#define DUNLOCK() spin_unlock(&dcache_lock)
+#define DGET(d) dget_locked(d)
+#define DCOUNT(d) atomic_read(&(d)->d_count)
#else
#define VREFCOUNT(v) ((v)->vrefCount)
#define VREFCOUNT_SET(v, c) (v)->vrefCount = c;
#define VREFCOUNT_DEC(v) (v)->vrefCount--;
#define VREFCOUNT_INC(v) (v)->vrefCount++;
+#define DLOCK()
+#define DUNLOCK()
+#define DGET(d) dget(d)
+#define DCOUNT(d) ((d)->d_count)
#endif
#define AFS_MAXDV 0x7fffffff /* largest dataversion number */
#define FVHash(acell,avol) (((avol)+(acell)) & (NFENTRIES-1))
extern struct cell *afs_GetCell();
+extern struct cell *afs_GetCellNoLock();
extern struct cell *afs_GetCellByName();
+extern struct cell *afs_GetCellByName2();
extern struct cell *afs_GetCellByIndex();
extern struct unixuser *afs_GetUser();
extern struct volume *afs_GetVolume();
extern int afs_DynrootNewVnode();
extern int afs_SetDynrootEnable();
extern int afs_GetDynrootEnable();
+extern int afs_DynrootVOPSymlink();
+extern int afs_DynrootVOPRemove();
/* Performance hack - we could replace VerifyVCache2 with the appropriate
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.8 2001/10/14 18:43:24 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_call.c,v 1.9 2002/01/22 20:29:43 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
osi_FreeSmallSpace(tbuffer);
osi_FreeSmallSpace(tbuffer1);
}
+ else if (parm == AFSOP_ADDCELLALIAS) {
+ /*
+ * Call arguments:
+ * parm2 is the alias name
+ * parm3 is the real cell name
+ */
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ size_t bufferSize;
+#else /* AFS_SGI61_ENV */
+ u_int bufferSize;
+#endif /* AFS_SGI61_ENV */
+ char *aliasName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ char *cellName = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+
+ AFS_COPYINSTR((char *)parm2, aliasName, AFS_SMALLOCSIZ, &bufferSize, code);
+ if (!code) AFS_COPYINSTR((char *)parm3, cellName, AFS_SMALLOCSIZ, &bufferSize, code);
+ if (!code) afs_NewCell(aliasName, /* new entry name */
+ 0, /* host list */
+ CAlias, /* flags */
+ (char *) 0, /* linked cell */
+ 0, 0, /* fs & vl ports */
+ 0, /* timeout */
+ cellName); /* real cell name */
+
+ osi_FreeSmallSpace(aliasName);
+ osi_FreeSmallSpace(cellName);
+ }
else if (parm == AFSOP_CACHEINIT) {
struct afs_cacheParams cparms;
#include <afsconfig.h>
#include "../afs/param.h"
-RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.10 2001/10/14 18:43:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/afs/afs_pioctl.c,v 1.11 2002/01/22 20:29:43 hartmans Exp $");
#include "../afs/sysincludes.h" /* Standard vendor system headers */
#include "../afs/afsincludes.h" /* Afs-based standard headers */
static int PGetInitParams(), PFlushMount(), PRxStatProc(), PRxStatPeer();
static int PGetRxkcrypt(), PSetRxkcrypt();
static int PPrefetchFromTape(), PResidencyCmd();
+static int PNewAlias(), PListAliases();
int PExportAfs();
static int HandleClientContext(struct afs_ioctl *ablob, int *com, struct AFS_UCRED **acred, struct AFS_UCRED *credp);
extern struct cm_initparams cm_initParams;
-static int (*(pioctlSw[]))() = {
+static int (*(VpioctlSw[]))() = {
PBogus, /* 0 */
PSetAcl, /* 1 */
PGetAcl, /* 2 */
PNoop, /* 65 -- arla: break callback */
PPrefetchFromTape, /* 66 -- MR-AFS: prefetch file from tape */
PResidencyCmd, /* 67 -- MR-AFS: generic commnd interface */
+ PNoop, /* 68 -- arla: fetch stats */
+};
+
+static int (*(CpioctlSw[]))() = {
+ PBogus, /* 0 */
+ PNewAlias, /* 1 -- create new cell alias */
+ PListAliases, /* 2 -- list cell aliases */
};
#define PSetClientContext 99 /* Special pioctl to setup caller's creds */
#endif
AFS_STATCNT(afs_syscall_pioctl);
if (follow) follow = 1; /* compat. with old venus */
-#ifndef AFS_SUN5_ENV
- if (! _VALIDVICEIOCTL(com)) {
- PIOCTL_FREE_CRED();
-#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
- return EINVAL;
-#else /* AFS_OSF_ENV */
-#if defined(AFS_SGI64_ENV) || defined(AFS_LINUX22_ENV)
- return EINVAL;
-#else
- setuerror(EINVAL);
- return EINVAL;
-#endif
-#endif
- }
-#endif
code = copyin_afs_ioctl(cmarg, &data);
if (code) {
PIOCTL_FREE_CRED();
{
struct vrequest treq;
register afs_int32 code;
- register afs_int32 function;
+ register afs_int32 function, device;
afs_int32 inSize, outSize;
char *inData, *outData;
+ int (*(*pioctlSw))();
+ int pioctlSwSize;
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;
+ device = (acom & 0xff00) >> 8;
+ switch (device) {
+ case 'V': /* Original pioctl's */
+ pioctlSw = VpioctlSw;
+ pioctlSwSize = sizeof(VpioctlSw);
+ break;
+ case 'C': /* Coordinated/common pioctl's */
+ pioctlSw = CpioctlSw;
+ pioctlSwSize = sizeof(CpioctlSw);
+ break;
+ default:
+ return EINVAL;
+ }
function = acom & 0xff;
- if (function >= (sizeof(pioctlSw) / sizeof(char *))) {
+ if (function >= (pioctlSwSize / sizeof(char *))) {
return EINVAL; /* out of range */
}
inSize = ablob->in_size;
}
outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
outSize = 0;
- if (function == 3) /* PSetTokens */
+ if (function == 3 && device == 'V') /* PSetTokens */
code = (*pioctlSw[function])(avc, function, &treq, inData, outData, inSize, &outSize, acred);
else
code = (*pioctlSw[function])(avc, function, &treq, inData, outData, inSize, &outSize, *acred);
return code;
}
+static PNewAlias(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
+ struct vcache *avc;
+ int afun;
+ struct vrequest *areq;
+ register char *ain;
+ char *aout;
+ afs_int32 ainSize;
+ struct AFS_UCRED *acred;
+ afs_int32 *aoutSize; /* set this */
+{
+ /* create a new cell alias */
+ register struct cell *tcell;
+ char *tp = ain;
+ register afs_int32 code;
+ char *realName, *aliasName;
+ register struct afs_q *cq, *tq;
+
+ if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
+ return EIO; /* Inappropriate ioctl for device */
+
+ if (!afs_osi_suser(acred))
+ return EACCES;
+
+ aliasName = tp;
+ tp += strlen(aliasName) + 1;
+ realName = tp;
+
+ /*
+ * Prevent user from shooting themselves in the foot -- don't allow
+ * creation of aliases when a real cell already exists with that name.
+ */
+ ObtainReadLock(&afs_xcell);
+ for (cq = CellLRU.next; cq != &CellLRU; cq = tq) {
+ tcell = QTOC(cq); tq = QNext(cq);
+ if ((afs_strcasecmp(tcell->cellName, aliasName) == 0) &&
+ !(tcell->states & CAlias)) {
+ ReleaseReadLock(&afs_xcell);
+ return EEXIST;
+ }
+ }
+ ReleaseReadLock(&afs_xcell);
+
+ code = afs_NewCell(aliasName, 0, CAlias, 0, 0, 0, 0, realName);
+ *aoutSize = 0;
+ return code;
+}
+
static PListCells(avc, afun, areq, ain, aout, ainSize, aoutSize)
struct vcache *avc;
int afun;
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;
- if (tq == &CellLRU) tcell = 0;
+ tcell = 0;
whichCell--;
}
if (tcell) {
else return EDOM;
}
+static PListAliases(avc, afun, areq, ain, aout, ainSize, aoutSize)
+ struct vcache *avc;
+ int afun;
+ struct vrequest *areq;
+ char *ain, *aout;
+ afs_int32 ainSize;
+ afs_int32 *aoutSize; /* set this */
+{
+ afs_int32 whichAlias;
+ register struct cell *tcell=0;
+ register char *cp, *tp = ain;
+ register struct afs_q *cq, *tq;
+
+ if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */
+ return EIO; /* Inappropriate ioctl for device */
+ if (ainSize < sizeof(afs_int32))
+ return EINVAL;
+
+ memcpy((char *)&whichAlias, 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 (whichAlias == 0) break;
+ tcell = 0;
+ whichAlias--;
+ }
+ if (tcell) {
+ cp = aout;
+ strcpy(cp, tcell->cellName);
+ cp += strlen(tcell->cellName)+1;
+ strcpy(cp, tcell->realName);
+ cp += strlen(tcell->realName)+1;
+ *aoutSize = cp - aout;
+ }
+ ReleaseReadLock(&afs_xcell);
+ if (tcell) return 0;
+ else return EDOM;
+}
+
static PRemoveMount(avc, afun, areq, ain, aout, ainSize, aoutSize)
struct vcache *avc;
int afun;
register int k;
if (vlonly) {
- struct cell *tcell;
- for(k=0;k<s;k++) {
- tcell = afs_GetCell(l[k], WRITE_LOCK);
- if (!tcell) continue;
- afs_SortServers(tcell->cellHosts, MAXCELLHOSTS);
- afs_PutCell(tcell, WRITE_LOCK);
- }
- return;
+ struct cell *tcell;
+ ObtainWriteLock(&afs_xcell,300);
+ for(k=0;k<s;k++) {
+ tcell = afs_GetCellNoLock(l[k], WRITE_LOCK);
+ if (!tcell) continue;
+ afs_SortServers(tcell->cellHosts, MAXCELLHOSTS);
+ afs_PutCell(tcell, WRITE_LOCK);
+ }
+ ReleaseWriteLock(&afs_xcell);
+ return;
}
ObtainReadLock(&afs_xvolume);
for (i= 0; i< NVOLS; i++) {
- for (j=afs_volumes[i];j;j=j->next) {
- for (k=0;k<s;k++)
- if (j->cell == l[k]) {
- ObtainWriteLock(&j->lock,233);
- afs_SortServers(j->serverHost, MAXHOSTS);
- ReleaseWriteLock(&j->lock);
- break;
- }
- }
+ for (j=afs_volumes[i];j;j=j->next) {
+ for (k=0;k<s;k++)
+ if (j->cell == l[k]) {
+ ObtainWriteLock(&j->lock,233);
+ afs_SortServers(j->serverHost, MAXHOSTS);
+ ReleaseWriteLock(&j->lock);
+ break;
+ }
+ }
}
ReleaseReadLock(&afs_xvolume);
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.3 2001/11/26 00:27:25 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/bozo/bosoprocs.c,v 1.4 2002/01/22 20:29:44 hartmans Exp $");
#include <afs/stds.h>
#include <sys/types.h>
struct afsconf_cell tcell;
register afs_int32 code;
char caller[MAXKTCNAMELEN];
+ char clones[MAXHOSTSPERCELL];
if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
code = BZACCESS;
}
if (DoLogging) bozo_Log("%s is executing SetCellName '%s'\n", caller, aname);
- code = afsconf_GetCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell);
+ code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones);
if (code)
goto fail;
}
strcpy(tcell.name, aname);
- code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
+ code = afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell, &clones);
fail:
osi_auditU (acall, BOS_SetCellEvent, code, AUD_STR, aname, AUD_END);
BOZO_GetCellHost(acall, awhich, aname)
struct rx_call *acall;
-afs_int32 awhich;
+afs_uint32 awhich;
char **aname; {
register afs_int32 code;
struct afsconf_cell tcell;
register char *tp;
+ char clones[MAXHOSTSPERCELL];
- code = afsconf_GetCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell);
+ code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones);
if (code) goto fail;
if (awhich >= tcell.numServers) {
}
tp = tcell.hostName[awhich];
- *aname = (char *) malloc(strlen(tp)+1);
- strcpy(*aname, tp);
+ *aname = (char *) malloc(strlen(tp)+3);
+ if (clones[awhich]) {
+ strcpy(*aname, "[");
+ strcat(*aname, tp);
+ strcat(*aname, "]");
+ } else
+ strcpy(*aname, tp);
goto done;
fail:
afs_int32 which;
register int i;
char caller[MAXKTCNAMELEN];
+ char clones[MAXHOSTSPERCELL];
if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
code = BZACCESS;
if (DoLogging)
bozo_Log("%s is executing DeleteCellHost '%s'\n", caller, aname);
- code = afsconf_GetCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell);
+ code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones);
if (code)
goto fail;
memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
memset(tcell.hostName[which], 0, MAXHOSTCHARS);
- code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
+ code = afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell, &clones);
fail:
osi_auditU( acall, BOS_DeleteHostEvent, code, AUD_STR, aname, AUD_END);
afs_int32 which;
register int i;
char caller[MAXKTCNAMELEN];
+ char clones[MAXHOSTSPERCELL];
+ char *n;
+ char isClone = 0;
if (!afsconf_SuperUser(bozo_confdir, acall, caller)) {
code = BZACCESS;
if (DoLogging)
bozo_Log("%s is executing AddCellHost '%s'\n", caller, aname);
- code = afsconf_GetCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell);
+ code = afsconf_GetExtendedCellInfo(bozo_confdir, (char *) 0, (char *) 0, &tcell, &clones);
if (code)
goto fail;
+ n = aname;
+ if (*n == '[') {
+ *(n + strlen(n) -1) = 0;
+ ++n;
+ isClone = 1;
+ }
+
which = -1;
for(i=0;i<tcell.numServers;i++) {
- if (strcmp(tcell.hostName[i], aname) == 0) {
+ if (strcmp(tcell.hostName[i], n) == 0) {
which = i;
break;
}
}
memset(&tcell.hostAddr[which], 0, sizeof(struct sockaddr_in));
- strcpy(tcell.hostName[which], aname);
- code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
+ strcpy(tcell.hostName[which], n);
+ clones[which] = isClone;
+ code = afsconf_SetExtendedCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell, &clones);
fail:
osi_auditU(acall, BOS_AddHostEvent, code, AUD_STR, aname, AUD_END);
+++ /dev/null
-#!/bin/sh
-# This is a bridge script until we take care of tightly linking Linux inode
-# internals to AFS vnode internals
-
-IBYTES=""
-SETATTR=""
-
-if [ -e $1/include/linux/fs.h ] ; then
-grep i_bytes $1/include/linux/fs.h > /dev/null
-if [ $? = 0 ]; then
-IBYTES="-DSTRUCT_INODE_HAS_I_BYTES=1"
-fi
-
-grep "extern int inode_setattr" $1/include/linux/fs.h > /dev/null
-if [ $? = 0 ]; then
-SETATTR="-DINODE_SETATTR_NOT_VOID=1"
-fi
-
-if [ -e $2 ] ; then
-/bin/rm $2
-fi
-echo "KDEFINES = ${IBYTES} ${SETATTR}" > $2
-fi
-exit 0
#include <afs/param.h>
#endif
-RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.9 2001/10/14 18:43:29 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/rx/rx.c,v 1.10 2002/01/22 20:29:44 hartmans Exp $");
#ifdef KERNEL
#include "../afs/sysincludes.h"
* last reply packets */
rxevent_Cancel(call->delayedAckEvent, call,
RX_CALL_REFCOUNT_DELAY);
- rxi_AckAll((struct rxevent *)0, call, 0);
+ if (call->state == RX_STATE_PRECALL ||
+ call->state == RX_STATE_ACTIVE) {
+ rxi_SendDelayedAck(call->delayedAckEvent, call, 0);
+ } else {
+ rxi_AckAll((struct rxevent *)0, call, 0);
+ }
}
MUTEX_EXIT(&call->lock);
}
clock_GetTime(&queueTime);
AFS_RXGLOCK();
MUTEX_ENTER(&conn->conn_call_lock);
+
+ /*
+ * Check if there are others waiting for a new call.
+ * If so, let them go first to avoid starving them.
+ * This is a fairly simple scheme, and might not be
+ * a complete solution for large numbers of waiters.
+ */
+ if (conn->makeCallWaiters) {
+#ifdef RX_ENABLE_LOCKS
+ CV_WAIT(&conn->conn_call_cv, &conn->conn_call_lock);
+#else
+ osi_rxSleep(conn);
+#endif
+ }
+
for (;;) {
for (i=0; i<RX_MAXCALLS; i++) {
call = conn->call[i];
}
else {
call = rxi_NewCall(conn, i);
- MUTEX_ENTER(&call->lock);
break;
}
}
MUTEX_ENTER(&conn->conn_data_lock);
conn->flags |= RX_CONN_MAKECALL_WAITING;
MUTEX_EXIT(&conn->conn_data_lock);
+
+ conn->makeCallWaiters++;
#ifdef RX_ENABLE_LOCKS
CV_WAIT(&conn->conn_call_cv, &conn->conn_call_lock);
#else
osi_rxSleep(conn);
#endif
+ conn->makeCallWaiters--;
}
+ /*
+ * Wake up anyone else who might be giving us a chance to
+ * run (see code above that avoids resource starvation).
+ */
+#ifdef RX_ENABLE_LOCKS
+ CV_BROADCAST(&conn->conn_call_cv);
+#else
+ osi_rxWakeup(conn);
+#endif
CALL_HOLD(call, RX_CALL_REFCOUNT_BEGIN);
/* Allocate a call structure, for the indicated channel of the
* supplied connection. The mode and state of the call must be set by
- * the caller. */
+ * the caller. Returns the call with mutex locked. */
struct rx_call *rxi_NewCall(conn, channel)
register struct rx_connection *conn;
register int channel;
the call number is valid from the last time this channel was used */
if (*call->callNumber == 0) *call->callNumber = 1;
- MUTEX_EXIT(&call->lock);
return call;
}
}
if (!call) {
call = rxi_NewCall(conn, channel);
- MUTEX_ENTER(&call->lock);
*call->callNumber = np->header.callNumber;
call->state = RX_STATE_PRECALL;
clock_GetTime(&call->queueTime);
* seconds) to ask the client to authenticate itself. The routine
* issues a challenge to the client, which is obtained from the
* security object associated with the connection */
-void rxi_ChallengeEvent(event, conn, dummy)
+void rxi_ChallengeEvent(event, conn, atries)
struct rxevent *event;
register struct rx_connection *conn;
- char *dummy;
+ void *atries;
{
+ int tries = (int) atries;
conn->challengeEvent = (struct rxevent *) 0;
if (RXS_CheckAuthentication(conn->securityObject, conn) != 0) {
register struct rx_packet *packet;
struct clock when;
+
+ if (tries <= 0) {
+ /* We've failed to authenticate for too long.
+ * Reset any calls waiting for authentication;
+ * they are all in RX_STATE_PRECALL.
+ */
+ int i;
+
+ MUTEX_ENTER(&conn->conn_call_lock);
+ for (i=0; i<RX_MAXCALLS; i++) {
+ struct rx_call *call = conn->call[i];
+ if (call) {
+ MUTEX_ENTER(&call->lock);
+ if (call->state == RX_STATE_PRECALL) {
+ rxi_CallError(call, RX_CALL_DEAD);
+ rxi_SendCallAbort(call, NULL, 0, 0);
+ }
+ MUTEX_EXIT(&call->lock);
+ }
+ }
+ MUTEX_EXIT(&conn->conn_call_lock);
+ return;
+ }
+
packet = rxi_AllocPacket(RX_PACKET_CLASS_SPECIAL);
if (packet) {
/* If there's no packet available, do this later. */
}
clock_GetTime(&when);
when.sec += RX_CHALLENGE_TIMEOUT;
- conn->challengeEvent = rxevent_Post(&when, rxi_ChallengeEvent, conn, 0);
+ conn->challengeEvent =
+ rxevent_Post(&when, rxi_ChallengeEvent, conn, (void *) (tries-1));
}
}
{
if (!conn->challengeEvent) {
RXS_CreateChallenge(conn->securityObject, conn);
- rxi_ChallengeEvent((struct rxevent *)0, conn, NULL);
+ rxi_ChallengeEvent(NULL, conn, (void *) RX_CHALLENGE_MAXTRIES);
};
}
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/util/dirpath.c,v 1.11 2001/10/14 18:43:30 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/util/dirpath.c,v 1.12 2002/01/22 20:29:45 hartmans Exp $");
#include <stddef.h>
#include <stdlib.h>
"/NoUsrViceEtcThisCellFileOnWindows");
sprintf(dirPathArray[AFSDIR_CLIENT_CELLSERVDB_FILEPATH_ID], "%s/%s",
ntClientConfigDirShort, AFSDIR_CELLSERVDB_FILE_NTCLIENT);
+ strcpy(dirPathArray[AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID],
+ "/NoCellAliasOnWindows");
#else
pathp = dirPathArray[AFSDIR_CLIENT_THISCELL_FILEPATH_ID];
AFSDIR_CLIENT_FILEPATH(pathp, AFSDIR_CLIENT_ETC_DIR, AFSDIR_THISCELL_FILE);
pathp = dirPathArray[AFSDIR_CLIENT_CELLSERVDB_FILEPATH_ID];
AFSDIR_CLIENT_FILEPATH(pathp, AFSDIR_CLIENT_ETC_DIR, AFSDIR_CELLSERVDB_FILE);
+
+ pathp = dirPathArray[AFSDIR_CLIENT_CELLALIAS_FILEPATH_ID];
+ AFSDIR_CLIENT_FILEPATH(pathp, AFSDIR_CLIENT_ETC_DIR, AFSDIR_CELLALIAS_FILE);
#endif /* AFS_NT40_ENV */
pathp = dirPathArray[AFSDIR_CLIENT_NETINFO_FILEPATH_ID];
#include <afsconfig.h>
#include <afs/param.h>
-RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.6 2001/10/14 18:43:31 hartmans Exp $");
+RCSID("$Header: /tmp/cvstemp/openafs/src/viced/afsfileprocs.c,v 1.7 2002/01/22 20:29:45 hartmans Exp $");
#include <stdio.h>
#include <stdlib.h>
struct rx_connection *tcon; /* Rx connection Handle */
struct AFSFid *Fid; /* Fid of taret file */
struct AFSStoreStatus *InStatus; /* Input Status for Fid */
- afs_int32 Pos; /* Not implemented yet */
- afs_int32 Length; /* Length of data to store */
- afs_int32 FileLength; /* Length of file after store */
+ afs_uint32 Pos; /* Not implemented yet */
+ afs_uint32 Length; /* Length of data to store */
+ afs_uint32 FileLength; /* Length of file after store */
struct AFSFetchStatus *OutStatus; /* Returned status for target fid */
{
struct AFSFid *Fid;
struct client *client;
register struct rx_call *Call;
- afs_int32 Pos;
- afs_int32 Length;
- afs_int32 FileLength;
+ afs_uint32 Pos;
+ afs_uint32 Length;
+ afs_uint32 FileLength;
int sync;
#if FS_STATS_DETAILED
afs_int32 *a_bytesToStoreP;