crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
setuerror(0);
AFS_GUNLOCK();
ip = (struct inode *)igetinode((dev_t) cacheDev.dev, afs_cacheVfsp,
#endif
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
#ifdef AFS_CACHE_VNODE_PATH
if (!ainode->ufs) {
evp = evp->next;
}
if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
AFS_STATCNT(osi_UFSOpen);
if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
osi_Panic("UFSOpen called for non-UFS cache\n");
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
code = VFS_VGET(afs_cacheVfsp, (ino_t) ainode->ufs, LK_EXCLUSIVE, &vp);
AFS_GLOCK();
osi_NewVnode(void) {
struct vcache *tvc;
- tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+ tvc = afs_osi_Alloc(sizeof(struct vcache));
tvc->v = NULL; /* important to clean this, or use memset 0 */
return tvc;
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
setuerror(0);
AFS_GUNLOCK();
ip = (struct inode *)igetinode(afs_cacheVfsp, (dev_t) cacheDev.dev,
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
afile->vnode = afs_XFSIGetVnode(ainode->ufs);
AFS_GLOCK();
evp = evp->next;
}
if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocLargeSpace(sizeof(struct osi_file));
+ afile = osi_AllocLargeSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
if (!afile) {
osi_Panic("osi_UFSOpen: Failed to allocate %d bytes for osi_file.\n",
afs_int32 ngroups, code = 0;
int j;
- gidset = (gid_t *) osi_Alloc(NGROUPS * sizeof(gidset[0]));
+ gidset = osi_Alloc(NGROUPS * sizeof(gidset[0]));
ngroups = afs_getgroups(*cr, gidset);
if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
AFS_STATCNT(osi_UFSOpen);
if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
osi_Panic("UFSOpen called for non-UFS cache\n");
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
code = VFS_VGET(cacheDev.mp, (ino_t) ainode->ufs, &vp);
AFS_GLOCK();
evp = evp->next;
}
if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
{
struct vcache *tvc;
- tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+ tvc = afs_osi_Alloc(sizeof(struct vcache));
tvc->v = NULL; /* important to clean this, or use memset 0 */
return tvc;
AFS_STATCNT(osi_UFSOpen);
if (cacheDiskType != AFS_FCACHE_TYPE_UFS)
osi_Panic("UFSOpen called for non-UFS cache\n");
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
code = VFS_VGET(cacheDev.mp, ainode->ufs, &vp);
AFS_GLOCK();
evp = evp->next;
}
if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
osi_NewVnode(void) {
struct vcache *tvc;
- tvc = (struct vcache *)afs_osi_Alloc(sizeof(struct vcache));
+ tvc = afs_osi_Alloc(sizeof(struct vcache));
tvc->v = NULL; /* important to clean this, or use memset 0 */
return tvc;
struct osi_file *afile = NULL;
afs_int32 code = 0;
int dummy;
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
code = (*vxfs_vx_vp_byino) (afs_cacheVfsp, &vp, (unsigned int)ainode->ufs);
AFS_GLOCK();
struct pathname lookpn;
#endif
struct osi_stat tstat;
- afile = (struct osi_file *)osi_AllocSmallSpace(sizeof(struct osi_file));
+ afile = osi_AllocSmallSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
/*
AFS_STATCNT(setpag);
- gidset = (gid_t *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ gidset = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
mutex_enter(&curproc->p_crlock);
ngroups = afs_getgroups(*cred, gidset);
evp = evp->next;
}
if (!newp) {
- newp = (afs_event_t *) osi_AllocSmallSpace(sizeof(afs_event_t));
+ newp = osi_AllocSmallSpace(sizeof(afs_event_t));
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
{
struct usr_ucred *newcredp;
- newcredp = (struct usr_ucred *)afs_osi_Alloc(sizeof(struct usr_ucred));
+ newcredp = afs_osi_Alloc(sizeof(struct usr_ucred));
*newcredp = *credp;
newcredp->cr_ref = 1;
return newcredp;
{
struct usr_ucred *newcredp;
- newcredp = (struct usr_ucred *)afs_osi_Alloc(sizeof(struct usr_ucred));
+ newcredp = afs_osi_Alloc(sizeof(struct usr_ucred));
newcredp->cr_ref = 1;
return newcredp;
}
* allocate the data block, so pthread_finish can free the buffer
* when this thread terminates.
*/
- uptr =
- (struct usr_user *)malloc(sizeof(struct usr_user) +
- sizeof(struct usr_ucred));
+ uptr = malloc(sizeof(struct usr_user) + sizeof(struct usr_ucred));
usr_assert(uptr != NULL);
uptr->u_error = 0;
uptr->u_prio = 0;
}
index = WAITHASH(x);
if (osi_waithash_avail == NULL) {
- waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t));
+ waitp = afs_osi_Alloc(sizeof(osi_wait_t));
usr_cond_init(&waitp->cond);
} else {
waitp = osi_waithash_avail;
}
index = WAITHASH((caddr_t) handle);
if (osi_waithash_avail == NULL) {
- waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t));
+ waitp = afs_osi_Alloc(sizeof(osi_wait_t));
usr_cond_init(&waitp->cond);
} else {
waitp = osi_waithash_avail;
AFS_ASSERT_GLOCK();
AFS_GUNLOCK();
- fp = (struct osi_file *)afs_osi_Alloc(sizeof(struct osi_file));
+ fp = afs_osi_Alloc(sizeof(struct osi_file));
usr_assert(fp != NULL);
usr_assert(ino->ufs);
/*
* Set up the directory structures
*/
- dirp =
- (usr_DIR *) afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE +
- sizeof(struct usr_dirent));
+ dirp = afs_osi_Alloc(sizeof(usr_DIR) + USR_DIRSIZE +
+ sizeof(struct usr_dirent));
usr_assert(dirp != NULL);
dirp->dd_buf = (char *)(dirp + 1);
dirp->dd_fd = fd;
AFS_STATCNT(setpag);
- gidset = (gid_t *) osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ gidset = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
ngroups = afs_getgroups(*cred, gidset);
if (afs_get_pag_from_groups(gidset[0], gidset[1]) == NOPAG) {
* Don't know why we do this. Would have still found it in above call - jpm.
*/
if (!tvp && (prefetch == 2) && len < AFS_SMALLOCSIZ - 10) {
- buf = (char *)osi_AllocSmallSpace(len + 10);
+ buf = osi_AllocSmallSpace(len + 10);
strcpy(buf, volnamep);
afs_strcat(buf, ".readonly");
auniq = 1;
if (avc->mvid == 0)
- avc->mvid =
- (struct VenusFid *)osi_AllocSmallSpace(sizeof(struct VenusFid));
+ avc->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
avc->mvid->Cell = (*avolpp)->cell;
avc->mvid->Fid.Volume = (*avolpp)->volume;
avc->mvid->Fid.Vnode = avnoid;
if (AFS_EQ_ATSYS(aname)) {
state->offset = 0;
- state->name = (char *)osi_AllocLargeSpace(MAXSYSNAME);
+ state->name = osi_AllocLargeSpace(MAXSYSNAME);
state->allocked = 1;
state->index =
afs_getsysname(areq, avc, state->name, &num, sysnamelist);
if ((tname > state->name + 4) && (AFS_EQ_ATSYS(tname - 4))) {
state->offset = (tname - 4) - state->name;
- tname = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ tname = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
strncpy(tname, state->name, state->offset);
state->name = tname;
state->allocked = 1;
* one for fids and callbacks, and one for stat info. Well set
* up our pointers to the memory from there, too.
*/
- statsp = (AFSFetchStatus *)
- osi_Alloc(AFSCBMAX * sizeof(AFSFetchStatus));
- fidsp = (AFSFid *) osi_AllocLargeSpace(nentries * sizeof(AFSFid));
- cbsp = (AFSCallBack *)
- osi_Alloc(AFSCBMAX * sizeof(AFSCallBack));
+ statsp = osi_Alloc(AFSCBMAX * sizeof(AFSFetchStatus));
+ fidsp = osi_AllocLargeSpace(nentries * sizeof(AFSFid));
+ cbsp = osi_Alloc(AFSCBMAX * sizeof(AFSCallBack));
/* next, we must iterate over the directory, starting from the specified
* cookie offset (dirCookie), and counting out nentries file entries.
/* now copy ".." entry back out of volume structure, if necessary */
if (tvcp->mvstat == 2 && (dotdot.Fid.Volume != 0)) {
if (!tvcp->mvid)
- tvcp->mvid = (struct VenusFid *)
- osi_AllocSmallSpace(sizeof(struct VenusFid));
+ tvcp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid));
*tvcp->mvid = dotdot;
}
if (tvolp) {
ObtainWriteLock(&tvc->lock, 134);
if (tvc->mvid == NULL) {
- tvc->mvid = (struct VenusFid *)
+ tvc->mvid =
osi_AllocSmallSpace(sizeof(struct VenusFid));
}
/* setup backpointer */
}
#else /* AFS_SGI53_ENV */
#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-#if defined(AFS_SUN5_ENV)
- direntp = (struct dirent64 *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#else
- direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#endif
+ direntp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
direntp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
direntp->d_offset = off;
* it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
* translator side XXX
*/
- struct min_direct *sdirEntry =
- (struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
+ struct min_direct *sdirEntry = osi_AllocSmallSpace(sizeof(struct min_direct));
afs_int32 rlen;
#endif
alen = len + 1; /* regular link */
else
alen = len; /* mt point */
- rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ rbuf = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
ObtainReadLock(&tdc->lock);
addr = afs_MemCacheOpen(&tdc->f.inode);
tlen = len;
alen = len + 1; /* regular link */
else
alen = len; /* mt point */
- rbuf = (char *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ rbuf = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
tlen = len;
ObtainReadLock(&tdc->lock);
tfile = osi_UFSOpen(&tdc->f.inode);
iovecp = auio->uio_iov;
#endif
- tcallspec = (struct tlocal1 *) osi_Alloc(sizeof(struct tlocal1));
+ tcallspec = osi_Alloc(sizeof(struct tlocal1));
do {
tc = afs_Conn(&avc->f.fid, areq, SHARED_LOCK /* ignored */, &rxconn);
if (tc) {
ICL_TYPE_POINTER, tdc, ICL_TYPE_INT32,
tdc->dflags);
}
- tsmall =
- (struct afs_FetchOutput *)osi_AllocLargeSpace(sizeof(struct afs_FetchOutput));
+ tsmall = osi_AllocLargeSpace(sizeof(struct afs_FetchOutput));
setVcacheStatus = 0;
#ifndef AFS_NOSTATS
/*
if ( !tc )
return -1;
- v = (struct rxfs_storeVariables *) osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
+ v = osi_AllocSmallSpace(sizeof(struct rxfs_storeVariables));
if (!v)
osi_Panic("rxfs_storeInit: osi_AllocSmallSpace returned NULL\n");
memset(v, 0, sizeof(struct rxfs_storeVariables));
if (!logp)
return ENOENT;
#define BUFFERSIZE AFS_LRALLOCSIZ
- lp = (afs_int32 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ lp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
elts = BUFFERSIZE / sizeof(afs_int32);
if (p3 < elts)
elts = p3;
}
}
- logp = (struct afs_icl_log *)
- osi_AllocSmallSpace(sizeof(struct afs_icl_log));
+ logp = osi_AllocSmallSpace(sizeof(struct afs_icl_log));
memset((caddr_t) logp, 0, sizeof(*logp));
logp->refCount = 1;
if (flags & ICL_CRSET_FLAG_PERSISTENT)
states |= ICL_SETF_PERSISTENT;
- setp = (struct afs_icl_set *)osi_AllocSmallSpace(sizeof(struct afs_icl_set));
+ setp = osi_AllocSmallSpace(sizeof(struct afs_icl_set));
memset((caddr_t) setp, 0, sizeof(*setp));
setp->refCount = 1;
if (states & ICL_SETF_FREED)
#ifdef STRUCT_SOCKADDR_HAS_SA_LEN
taddr.sin_len = sizeof(taddr);
#endif
- tp = buf = (char *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ tp = buf = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
strcpy(tp, astring);
tp += strlen(astring);
if (((uap->com >> 8) & 0xff) == 'V') {
struct afs_ioctl *datap;
AFS_GLOCK();
- datap =
- (struct afs_ioctl *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ datap = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
code=copyin_afs_ioctl((char *)uap->arg, datap);
if (code) {
osi_FreeSmallSpace(datap);
if (((uap->com >> 8) & 0xff) == 'V') {
struct afs_ioctl *datap;
AFS_GLOCK();
- datap =
- (struct afs_ioctl *)osi_AllocSmallSpace(AFS_SMALLOCSIZ);
+ datap = osi_AllocSmallSpace(AFS_SMALLOCSIZ);
code=copyin_afs_ioctl((char *)uap->arg, datap);
if (code) {
osi_FreeSmallSpace(datap);
hset(newDV, avc->f.m.DataVersion);
hash = DVHash(&avc->f.fid);
foreign = (avc->f.states & CForeign);
- dcList = (struct dcache **)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ dcList = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
afs_Trace2(afs_iclSetp, CM_TRACE_STOREALL, ICL_TYPE_POINTER, avc,
ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length));
#if !defined(AFS_AIX32_ENV) && !defined(AFS_SGI65_ENV)