return osi_linux_alloc(x, 1);
#else
size = x;
+#ifdef AFS_OBSD_ENV
+ MALLOC(tm, struct osimem *, size, M_AFSGENERIC, M_WAITOK);
+#else
tm = (struct osimem *) AFS_KALLOC(size);
+#endif
#ifdef AFS_SUN_ENV
if (!tm)
osi_Panic("osi_Alloc: Couldn't allocate %d bytes; out of memory!\n",
size);
#endif
- return (char *) tm;
+ return (void *) tm;
#endif
}
size = x;
AFS_STATS(afs_stats_cmperf.OutStandingAllocs++);
AFS_STATS(afs_stats_cmperf.OutStandingMemUsage += x);
+#ifdef AFS_OBSD_ENV
+ MALLOC(tm, struct osimem *, size, M_AFSGENERIC, 0);
+#else
tm = (struct osimem *) AFS_KALLOC_NOSLEEP(size);
- return (char *) tm;
+#endif
+ return (void *) tm;
}
#endif /* SUN || SGI */
AFS_STATS(afs_stats_cmperf.OutStandingAllocs--);
AFS_STATS(afs_stats_cmperf.OutStandingMemUsage -= asize);
-#ifdef AFS_LINUX20_ENV
+#if defined(AFS_LINUX20_ENV)
osi_linux_free(x);
+#elif defined(AFS_OBSD_ENV)
+ FREE(x, M_AFSGENERIC);
#else
AFS_KFREE((struct osimem *)x, asize);
#endif
#endif
#else
fd = getf(uap->fd);
- if (!fd) return;
+ if (!fd) return(EBADF);
#endif
#endif
#endif
DECL_PIOCTL(PGetFID)
{
- register afs_int32 code;
-
AFS_STATCNT(PGetFID);
if (!avc) return EINVAL;
memcpy(aout, (char *)&avc->fid, sizeof(struct VenusFid));
*aoutSize = sizeof(struct VenusFid);
return 0;
- }
+}
DECL_PIOCTL(PSetAcl)
{
i = tcell->cellNum;
afs_PutCell(tcell, READ_LOCK);
if (set_parent_pag) {
- int pag;
-#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+ afs_int32 pag;
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
#if defined(AFS_DARWIN_ENV)
- struct proc *p=current_proc(); /* XXX */
+ struct proc *p = current_proc(); /* XXX */
#else
- struct proc *p=curproc; /* XXX */
+ struct proc *p = curproc; /* XXX */
#endif
uprintf("Process %d (%s) tried to change pags in PSetTokens\n",
p->p_pid, p->p_comm);
DECL_PIOCTL(PRemoveCallBack)
{
register struct conn *tc;
- register afs_int32 code;
+ register afs_int32 code = 0;
struct AFSCallBack CallBacks_Array[1];
struct AFSCBFids theFids;
struct AFSCBs theCBs;
{
/* create a new cell */
afs_int32 cellHosts[MAXCELLHOSTS], *lp, magic=0;
- register struct cell *tcell;
char *newcell=0, *linkedcell=0, *tp= ain;
register afs_int32 code, linkedstate=0, ls;
u_short fsport = 0, vlport = 0;
* l - array of cell ids which have volumes that need to be sorted
* vlonly - sort vl servers or file servers?
*/
-static void *ReSortCells_cb(struct cell *cell, void *arg)
+static void ReSortCells_cb(struct cell *cell, void *arg)
{
afs_int32 *p = (afs_int32 *) arg;
afs_int32 *l = p + 1;
static void ReSortCells(int s, afs_int32 *l, int vlonly)
{
- int i;
- struct volume *j;
- register int k;
-
- if (vlonly) {
- afs_int32 *p;
- p = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * (s+1));
- p[0] = s;
- memcpy(p+1, l, s * sizeof(afs_int32));
- afs_TraverseCells(&ReSortCells_cb, p);
- afs_osi_Free(p, sizeof(afs_int32) * (s+1));
- return;
- }
+ int i;
+ struct volume *j;
+ register int k;
- 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;
- }
- }
- }
- ReleaseReadLock(&afs_xvolume);
+ if (vlonly) {
+ afs_int32 *p;
+ p = (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * (s+1));
+ p[0] = s;
+ memcpy(p+1, l, s * sizeof(afs_int32));
+ afs_TraverseCells(&ReSortCells_cb, p);
+ afs_osi_Free(p, sizeof(afs_int32) * (s+1));
+ 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;
+ }
+ }
+ }
+ ReleaseReadLock(&afs_xvolume);
}
int i,j; /* counters for hash table traversal */
struct server *srvr; /* one of CM's server structs */
struct srvAddr *sa;
- afs_uint32 prevh;
int vlonly; /* just return vlservers ? */
int isfs;
struct VenusFid tfid;
struct AFSFid *Fid;
struct vcache *tvc;
- XSTATS_DECLS;
AFS_STATCNT(PSetAcl);
if (!avc)
extern int afs_CellNumValid(afs_int32 cellnum);
extern afs_int32 afs_NewCellAlias(char *alias, char *cell);
extern struct cell_alias *afs_GetCellAlias(int index);
+extern void afs_PutCellAlias(struct cell_alias *a);
extern int afs_AFSDBHandler(char *acellName, int acellNameLen,
afs_int32 *kernelMsg);
extern void afs_LookupAFSDB(char *acellName);
extern void afs_osi_SetTime(osi_timeval_t *atv);
/* LINUX/osi_misc.c */
-#if AFS_LINUX24_ENV
+#ifdef AFS_LINUX_ENV
+#ifdef AFS_LINUX24_ENV
extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
vnode_t **dirvpp, struct dentry **dpp);
extern int osi_InitCacheInfo(char *aname);
extern void osi_linux_mask(void);
extern void osi_linux_unmask(void);
extern void osi_linux_rxkreg(void);
+extern int setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, int change_parent);
+#endif
+
+/* OBSD/osi_misc.c */
+#ifdef AFS_OBSD_ENV
+extern int setpag(struct proc *proc, struct ucred **cred, afs_uint32 pagvalue,
+ afs_uint32 *newpag, int change_parent);
+#endif
/* ARCH/osi_sleep.c */
extern void afs_osi_InitWaitHandle(struct afs_osi_WaitHandle *achandle);