AC_INIT(src/libafs/Makefile.common.in)
-AM_INIT_AUTOMAKE(openafs-libafs,1.3.72)
+AM_INIT_AUTOMAKE(openafs-libafs,1.3.73)
AC_CONFIG_HEADER(src/config/afsconfig.h)
define(OPENAFS_CONFIGURE_LIBAFS)
AC_INIT(src/config/stds.h)
-AM_INIT_AUTOMAKE(openafs,1.3.72)
+AM_INIT_AUTOMAKE(openafs,1.3.73)
AC_CONFIG_HEADER(src/config/afsconfig.h)
AC_PROG_CC
(pthread_cache_done || pthread_once(&pthread_cache_once, create_once));
if (terminate_thread_handle == INVALID_HANDLE_VALUE) {
- terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
- TRUE, FALSE, (LPCTSTR) 0);
- terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0,
- terminate_thread_routine, (LPVOID) 0, 0,
- &terminate_thread_id);
+ CHAR eventName[MAX_PATH];
+ static eventCount = 0;
+ sprintf(eventName, "terminate_thread_wakeup_event %d::%d", _getpid(), eventCount++);
+ terminate_thread_wakeup_event = CreateEvent((LPSECURITY_ATTRIBUTES) 0,
+ TRUE, FALSE, (LPCTSTR) eventName);
+ terminate_thread_handle = CreateThread((LPSECURITY_ATTRIBUTES) 0, 0,
+ terminate_thread_routine, (LPVOID) 0, 0,
+ &terminate_thread_id);
} else {
SetEvent (terminate_thread_wakeup_event);
}
if (queue_IsEmpty(&waiter_cache)) {
new = (cond_waiters_t *) malloc(sizeof(cond_waiters_t));
if (new != NULL) {
- new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
- FALSE, (LPCTSTR) 0);
+ CHAR eventName[MAX_PATH];
+ static eventCount = 0;
+ sprintf(eventName, "cond_waiters_t %d::%d", _getpid(), eventCount++);
+ new->event = CreateEvent((LPSECURITY_ATTRIBUTES) 0, FALSE,
+ FALSE, (LPCTSTR) eventName);
if (new->event == NULL) {
free(new);
new = NULL;
#define SYSCALL2POINTER (void *)
#endif
-#ifdef AFS_PPC64_LINUX20_ENV
-extern void *set_afs_syscall(void*);
-extern void *set_afs_xsetgroups_syscall(void*);
-extern void *set_afs_xsetgroups_syscall32(void*);
-#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
int __init
#endif /* AFS_AMD64_LINUX20_ENV */
#endif /* AFS_IA64_LINUX20_ENV */
-#ifdef AFS_PPC64_LINUX20_ENV
- afs_ni_syscall = set_afs_syscall(afs_syscall);
- sys_setgroupsp = set_afs_xsetgroups_syscall(afs_xsetgroups);
- sys32_setgroupsp = set_afs_xsetgroups_syscall32(afs32_xsetgroups);
-#endif
}
osi_sysctl_init();
}
#endif
}
-#ifdef AFS_PPC64_LINUX20_ENV
- set_afs_syscall(afs_ni_syscall);
- set_afs_xsetgroups_syscall(sys_setgroupsp);
- set_afs_xsetgroups_syscall32(sys32_setgroupsp);
-#endif
unregister_filesystem(&afs_fs_type);
osi_linux_free_inode_pages(); /* Invalidate all pages using AFS inodes. */
code = 0;
offset = (int) fp->f_pos;
while (1) {
- dirpos = BlobScan(&tdc->f.inode, offset);
+ dirpos = BlobScan(&tdc->f, offset);
if (!dirpos)
break;
- de = afs_dir_GetBlob(&tdc->f.inode, dirpos);
+ de = afs_dir_GetBlob(&tdc->f, dirpos);
if (!de)
break;
int code = 0;
struct vcache *vcp = ITOAFS(FILE_INODE(fp));
cred_t *credp = crref();
-#ifdef AFS_LINUX24_ENV
- struct flock64 flock;
-#else
- struct flock flock;
-#endif
-
+ struct AFS_FLOCK flock;
/* Convert to a lock format afs_lockctl understands. */
memset((char *)&flock, 0, sizeof(flock));
flock.l_type = flp->fl_type;
unsigned offset = PAGE_CACHE_SIZE;
long status;
+#ifdef PageLaunder
+ if (PageLaunder(pp)) {
+ return(fail_writepage(pp));
+ }
+#endif
+
inode = (struct inode *)mapping->host;
end_index = inode->i_size >> PAGE_CACHE_SHIFT;
if (tdc) {
/* see if file already exists. If it does, we only set
* the size attributes (to handle O_TRUNC) */
- code = afs_dir_Lookup(&tdc->f.inode, aname, &newFid.Fid); /* use dnlc first xxx */
+ code = afs_dir_Lookup(&tdc->f, aname, &newFid.Fid); /* use dnlc first xxx */
if (code == 0) {
ReleaseSharedLock(&tdc->lock);
afs_PutDCache(tdc);
UpgradeSToWLock(&tdc->lock, 631);
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+ code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
if (code) {
ZapDCE(tdc);
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
} else {
if (adc) {
ZapDCE(adc);
- DZap(&adc->f.inode);
+ DZap(&adc->f);
}
if (avc->states & CStatd) {
osi_dnlc_purgedp(avc);
ObtainWriteLock(&tdc->lock, 632);
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+ code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
if (code) {
ZapDCE(tdc); /* surprise error -- use invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
struct VenusFid unlinkFid;
unlinkFid.Fid.Vnode = 0;
- code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid);
+ code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid);
if (code == 0) {
afs_int32 cached = 0;
UpgradeSToWLock(&tdc->lock, 634);
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Delete(&tdc->f.inode, aname);
+ code = afs_dir_Delete(&tdc->f, aname);
if (code) {
ZapDCE(tdc); /* surprise error -- invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
ObtainWriteLock(&tdc->lock, 635);
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Create(&tdc->f.inode, aname, &avc->fid.Fid);
+ code = afs_dir_Create(&tdc->f, aname, &avc->fid.Fid);
if (code) {
ZapDCE(tdc); /* surprise error -- invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
/* look for first safe entry to examine in the directory. BlobScan
* looks for a the 1st allocated dir after the dirCookie slot.
*/
- newIndex = BlobScan(&dcp->f.inode, (dirCookie >> 5));
+ newIndex = BlobScan(&dcp->f, (dirCookie >> 5));
if (newIndex == 0)
break;
/* get a ptr to the dir entry */
dirEntryp =
- (struct DirEntry *)afs_dir_GetBlob(&dcp->f.inode, newIndex);
+ (struct DirEntry *)afs_dir_GetBlob(&dcp->f, newIndex);
if (!dirEntryp)
break;
{ /* sub-block just to reduce stack usage */
register struct dcache *tdc;
afs_size_t dirOffset, dirLen;
- ino_t theDir;
+ struct fcache *theDir;
struct VenusFid tfid;
/* now we have to lookup the next fid */
/* lookup the name in the appropriate dir, and return a cache entry
* on the resulting fid */
- theDir = tdc->f.inode;
+ theDir = &tdc->f;
code =
- afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid,
+ afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid,
&dirCookie);
/* If the first lookup doesn't succeed, maybe it's got @sys in the name */
while (code == ENOENT && Next_AtSys(adp, &treq, &sysState))
code =
- afs_dir_LookupOffset(&theDir, sysState.name, &tfid.Fid,
+ afs_dir_LookupOffset(theDir, sysState.name, &tfid.Fid,
&dirCookie);
tname = sysState.name;
BlobScan is used by the Linux port in a separate file, so it should not
become static.
*/
-#if defined(AFS_SGI62_ENV) || defined(AFS_SUN57_64BIT_ENV)
int
-BlobScan(ino64_t * afile, afs_int32 ablob)
-#else
-#if defined(AFS_HPUX1123_ENV)
-/*DEE should use afs_inode_t for all */
-int
-BlobScan(ino_t * afile, afs_int32 ablob)
-#else
-#ifdef AFS_LINUX_64BIT_KERNEL
-int
-BlobScan(long *afile, afs_int32 ablob)
-#else
-int
-BlobScan(afs_int32 * afile, afs_int32 ablob)
-#endif
-#endif
-#endif
+BlobScan(struct fcache * afile, afs_int32 ablob)
{
register afs_int32 relativeBlob;
afs_int32 pageBlob;
origOffset = auio->afsio_offset;
/* scan for the next interesting entry scan for in-use blob otherwise up point at
* this blob note that ode, if non-zero, also represents a held dir page */
- if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)))
- || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) {
+ if (!(us = BlobScan(&tdc->f, (origOffset >> 5)))
+ || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) {
/* failed to setup nde, return what we've got, and release ode */
if (len) {
/* something to hand over. */
/* scan for the next interesting entry scan for in-use blob otherwise up point at
* this blob note that ode, if non-zero, also represents a held dir page */
- if (!(us = BlobScan(&tdc->f.inode, (origOffset >> 5)))
- || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f.inode, us))) {
+ if (!(us = BlobScan(&tdc->f, (origOffset >> 5)))
+ || !(nde = (struct DirEntry *)afs_dir_GetBlob(&tdc->f, us))) {
/* failed to setup nde, return what we've got, and release ode */
if (len) {
/* something to hand over. */
UpgradeSToWLock(&tdc->lock, 637);
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Delete(&tdc->f.inode, aname);
+ code = afs_dir_Delete(&tdc->f, aname);
if (code) {
ZapDCE(tdc); /* surprise error -- invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
* done the work */
if (!tvc)
if (tdc) {
- code = afs_dir_Lookup(&tdc->f.inode, aname, &unlinkFid.Fid);
+ code = afs_dir_Lookup(&tdc->f, aname, &unlinkFid.Fid);
if (code == 0) {
afs_int32 cached = 0;
}
if (code == 0)
- code = afs_dir_Lookup(&tdc1->f.inode, aname1, &fileFid.Fid);
+ code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid);
if (code) {
if (tdc1) {
ReleaseWriteLock(&tdc1->lock);
if (!doLocally) {
if (tdc1) {
ZapDCE(tdc1);
- DZap(&tdc1->f.inode);
+ DZap(&tdc1->f);
}
if (tdc2) {
ZapDCE(tdc2);
- DZap(&tdc2->f.inode);
+ DZap(&tdc2->f);
}
}
}
/* now really do the work */
if (doLocally) {
/* first lookup the fid of the dude we're moving */
- code = afs_dir_Lookup(&tdc1->f.inode, aname1, &fileFid.Fid);
+ code = afs_dir_Lookup(&tdc1->f, aname1, &fileFid.Fid);
if (code == 0) {
/* delete the source */
- code = afs_dir_Delete(&tdc1->f.inode, aname1);
+ code = afs_dir_Delete(&tdc1->f, aname1);
}
/* first see if target is there */
if (code == 0
- && afs_dir_Lookup(&tdc2->f.inode, aname2,
+ && afs_dir_Lookup(&tdc2->f, aname2,
&unlinkFid.Fid) == 0) {
/* target already exists, and will be unlinked by server */
- code = afs_dir_Delete(&tdc2->f.inode, aname2);
+ code = afs_dir_Delete(&tdc2->f, aname2);
}
if (code == 0) {
- code = afs_dir_Create(&tdc2->f.inode, aname2, &fileFid.Fid);
+ code = afs_dir_Create(&tdc2->f, aname2, &fileFid.Fid);
}
if (code != 0) {
ZapDCE(tdc1);
- DZap(&tdc1->f.inode);
+ DZap(&tdc1->f);
if (!oneDir) {
ZapDCE(tdc2);
- DZap(&tdc2->f.inode);
+ DZap(&tdc2->f);
}
}
}
if (tdc1) {
ObtainWriteLock(&tdc1->lock, 648);
ZapDCE(tdc1); /* mark as unknown */
- DZap(&tdc1->f.inode);
+ DZap(&tdc1->f);
ReleaseWriteLock(&tdc1->lock);
afs_PutDCache(tdc1); /* put it back */
}
/* otherwise, we should see if we can make the change to the dir locally */
if (afs_LocalHero(adp, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Create(&tdc->f.inode, aname, &newFid.Fid);
+ code = afs_dir_Create(&tdc->f, aname, &newFid.Fid);
if (code) {
ZapDCE(tdc); /* surprise error -- use invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
if (tdc) {
#if defined(AFS_HPUX102_ENV)
#define AFS_FLOCK k_flock
#else
-#if defined(AFS_SUN56_ENV) || defined(AFS_LINUX24_ENV)
+#if defined(AFS_SUN56_ENV) || (defined(AFS_LINUX24_ENV) && !defined(AFS_PPC64_LINUX26_ENV) && !defined(AFS_AMD64_LINUX26_ENV))
#define AFS_FLOCK flock64
#else
#define AFS_FLOCK flock
extern int afs_fakestat_enable;
struct buffer {
- ino_t fid[1]; /* Unique cache key + i/o addressing */
+ struct fcache *fid;
afs_int32 page;
afs_int32 accesstime;
struct buffer *hashNext;
AFS_STATCNT(afs_glink);
#endif
/* we know this guy's in the LRUQ. We'll move dude into DCQ below */
- DZap(&adc->f.inode);
+ DZap(&adc->f);
/* if this guy is in the hash table, pull him out */
if (adc->f.fid.Fid.Volume != 0) {
/* remove entry from first hash chains */
* Right now, we only have one tool, and it's a hammer. So, we
* fetch the whole file.
*/
- DZap(&tdc->f.inode); /* pages in cache may be old */
+ DZap(&tdc->f); /* pages in cache may be old */
#ifdef IHINT
if (file = tdc->ihint) {
if (tdc->f.inode == file->inum)
afs_CFileClose(file);
ZapDCE(tdc); /* sets DFEntryMod */
if (vType(avc) == VDIR) {
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc);
#elif defined(AFS_AMD64_LINUX20_ENV)
if (current->thread.flags & THREAD_IA32)
#elif defined(AFS_PPC64_LINUX20_ENV)
- if (current->thread.flags & PPC_FLAG_32BIT)
+#ifdef AFS_PPC64_LINUX26_ENV
+ if (current->thread_info->flags & _TIF_32BIT)
+#else /*Linux 2.6*/
+ if (current->thread.flags & PPC_FLAG_32BIT)
+#endif
#elif defined(AFS_S390X_LINUX20_ENV)
if (current->thread.flags & S390_FLAG_31BIT)
#else
unsigned int com;
unsigned long arg;
};
-asmlinkage int
+int
afs_xioctl(struct inode *ip, struct file *fp, unsigned int com,
unsigned long arg)
{
Check_AtSys(avc, ain, &sysState, areq);
ObtainReadLock(&tdc->lock);
do {
- code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+ code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
} while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
ReleaseReadLock(&tdc->lock);
afs_PutDCache(tdc); /* we're done with the data */
Check_AtSys(avc, ain, &sysState, areq);
ObtainReadLock(&tdc->lock);
do {
- code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+ code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
} while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
ReleaseReadLock(&tdc->lock);
bufp = sysState.name;
ObtainWriteLock(&tdc->lock, 661);
if (afs_LocalHero(avc, tdc, &OutDirStatus, 1)) {
/* we can do it locally */
- code = afs_dir_Delete(&tdc->f.inode, bufp);
+ code = afs_dir_Delete(&tdc->f, bufp);
if (code) {
ZapDCE(tdc); /* surprise error -- invalid value */
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
}
}
ReleaseWriteLock(&tdc->lock);
Check_AtSys(avc, ain, &sysState, areq);
ObtainReadLock(&tdc->lock);
do {
- code = afs_dir_Lookup(&tdc->f.inode, sysState.name, &tfid.Fid);
+ code = afs_dir_Lookup(&tdc->f, sysState.name, &tfid.Fid);
} while (code == ENOENT && Next_AtSys(avc, areq, &sysState));
ReleaseReadLock(&tdc->lock);
afs_PutDCache(tdc); /* we're done with the data */
ObtainWriteLock(&tdc->lock, 679);
ZapDCE(tdc);
if (vType(avc) == VDIR)
- DZap(&tdc->f.inode);
+ DZap(&tdc->f);
ReleaseWriteLock(&tdc->lock);
afs_PutDCache(tdc);
}
afs_CFileTruncate(tfile, newSize);
afs_CFileClose(tfile);
afs_AdjustSize(tdc, newSize);
+ if (alen < tdc->validPos) {
+ if (alen < AFS_CHUNKTOBASE(tdc->f.chunk))
+ tdc->validPos = 0;
+ else
+ tdc->validPos = alen;
+ }
ConvertWToSLock(&tdc->lock);
}
ReleaseSharedLock(&tdc->lock);
#elif defined(AFS_LINUX22_ENV)
if (tvc != afs_globalVp && VREFCOUNT(tvc) && tvc->opens == 0) {
#if defined(AFS_LINUX26_ENV)
- AFS_GUNLOCK();
- d_prune_aliases(AFSTOI(tvc));
- AFS_GLOCK();
+ struct dentry *dentry;
+ struct list_head *cur, *head = &(AFSTOI(tvc))->i_dentry;
+ AFS_GUNLOCK();
+ cur=head;
+ while ((cur = cur->next) != head) {
+ dentry = list_entry(cur, struct dentry, d_alias);
+ if (!d_unhashed(dentry) &&
+ !list_empty(&dentry->d_subdirs))
+ shrink_dcache_parent(dentry);
+ }
+ d_prune_aliases(AFSTOI(tvc));
+ AFS_GLOCK();
#else
afs_TryFlushDcacheChildren(tvc);
#endif
code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
if (code == 0) {
/* have tickets, will travel */
- if (ttoken.kvno >= 0 && ttoken.kvno <= 255);
+ if (ttoken.kvno >= 0 && ttoken.kvno <= 256);
else {
fprintf(stderr,
"bos: funny kvno (%d) in ticket, proceeding\n",
#else
PROCESS dbWatcherPid;
#endif
+ time_t t;
debugLevel = 0;
TLog(0, "Starting Tape Coordinator: Port offset %u Debug level %u\n",
portOffset, debugLevel);
- TLog(0, "Token expires: %s\n", cTIME(&ttoken.endTime));
+ t = ttoken.endTime;
+ TLog(0, "Token expires: %s\n", cTIME(&t));
rx_StartServer(1); /* Donate this process to the server process pool */
TLog(0, "Error: StartServer returned");
SHLIB_LINKER="${MT_CC} -shared"
;;
- amd64_linux24)
+ amd64_linux*)
+ CCOBJ="${CC} -fPIC"
KERN_OPTMZ=-O2
LEX="flex -l"
MT_CFLAGS='-DAFS_PTHREAD_ENV -pthread -D_REENTRANT ${XCFLAGS}'
MT_LIBS="-lpthread"
PAM_CFLAGS="-g -O2 -Dlinux -DLINUX_PAM -fPIC"
+ SHLIB_CFLAGS="-fPIC"
SHLIB_LDFLAGS="-shared -Xlinker -x"
TXLIBS="-lncurses"
XCFLAGS="-g -O2 -D_LARGEFILE64_SOURCE"
#define SYS_NAME_ID_amd64_linux2 2700
#define SYS_NAME_ID_amd64_linux22 2701
#define SYS_NAME_ID_amd64_linux24 2702
+#define SYS_NAME_ID_amd64_linux26 2703
#define SYS_NAME_ID_i386_umlinux2 2800
#define SYS_NAME_ID_i386_umlinux22 2801
#define SYS_NAME_ID_ppc64_linux2 2900
#define SYS_NAME_ID_ppc64_linux22 2901
#define SYS_NAME_ID_ppc64_linux24 2902
+#define SYS_NAME_ID_ppc64_linux26 2903
/*
* Placeholder to keep system-wide standard flags since this file is included by all
crypt.o: crypt.c
case ${SYS_NAME} in \
rs_aix*)\
- ${CC} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
+ ${CCOBJ} -c ${COMMON_INCL} -o crypt.o crypt.c ;;\
*)\
- ${CC} -c ${CFLAGS} -o crypt.o crypt.c ;;\
+ ${CCOBJ} -c ${CFLAGS} -o crypt.o crypt.c ;;\
esac
#
# Table/code generation targets
/* encrypt == 0 ==> decrypt, else encrypt */
afs_int32
-des_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+des_ecb_encrypt(void * clear, void * cipher,
register des_key_schedule schedule, int encrypt)
{
/* better pass 8 bytes, length not checked here */
- register afs_uint32 R1 = 0, L1 = 0; /* R1 = r10, L1 = r9 */
+ register afs_uint32 R1 = 0;
+ register afs_uint32 L1 = 0; /* R1 = r10, L1 = r9 */
register afs_uint32 R2 = 0, L2 = 0; /* R2 = r8, L2 = r7 */
afs_int32 i;
/* one more registers left on VAX, see below P_temp_p */
abort();
}
#endif
- if ((afs_int32) clear & 3) {
- memcpy((char *)&L_save, (char *)clear++, sizeof(L_save));
- memcpy((char *)&R_save, (char *)clear, sizeof(R_save));
+ if ((afs_uint32) clear & 3) {
+ memcpy((char *)(&L_save), (char *)clear, sizeof(L_save));
+ clear=((afs_uint32*)clear)+1;
+ memcpy((char *)(&R_save), (char *)clear, sizeof(R_save));
L1 = L_save;
R1 = R_save;
} else
#endif
{
- if (clear)
- L1 = *clear++;
- else
+ if (clear) {
+ L1 = *((afs_uint32 *)clear);
+ clear=((afs_uint32*)clear)+1;
+ } else
L1 = 0;
if (clear)
- R1 = *clear;
+ R1 = *((afs_uint32 *)clear);
else
R1 = 0;
}
if ((afs_int32) cipher & 3) {
L_save = L2; /* cant bcopy a reg */
R_save = R2;
- memcpy((char *)cipher++, (char *)&L_save, sizeof(L_save));
+ memcpy((char *)cipher, (char *)&L_save, sizeof(L_save));
+ cipher=((afs_uint32*)cipher)+1;
memcpy((char *)cipher, (char *)&R_save, sizeof(R_save));
} else
#endif
{
- *cipher++ = L2;
- *cipher = R2;
+ *((afs_uint32*)cipher)= L2;
+ cipher = ((afs_int32 *)cipher)+1;
+ *((afs_uint32 *)cipher) = R2;
}
#ifdef DEBUG
$(RM) -f asm-generic
ln -fs ${LINUX_KERNEL_PATH}/include/asm-generic asm-generic
$(RM) -f asm
-<parisc_linux22 parisc_linux24>
+<parisc_linux22 parisc_linux24 parisc_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-parisc asm
-<alpha_linux_22 alpha_linux_24>
+<alpha_linux_22 alpha_linux_24 alpha_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-alpha asm
-<i386_linux22 i386_linux24>
+<i386_linux22 i386_linux24 i386_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-i386 asm
-<i386_umlinux22 i386_umlinux24>
+<i386_umlinux22 i386_umlinux24 i386_umlinux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-um asm
-<amd64_linux24>
+<amd64_linux24 amd64_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-x86_64 asm
-<s390_linux22 s390_linux24>
+<s390_linux22 s390_linux24 s390_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390 asm
-<s390x_linux22 s390x_linux24>
+<s390x_linux22 s390x_linux24 s390x_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-s390x asm
-<ppc_linux22 ppc_linux24>
+<ppc_linux22 ppc_linux24 ppc_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-ppc asm
-<ppc64_linux24>
+<ppc64_linux24 ppc64_linux26>
ln -s ${LINUX_KERNEL_PATH}/include/asm-ppc64 asm
-<sparc_linux22 sparc_linux24>
+<sparc_linux22 sparc_linux24 sparc_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc asm
-<sparc64_linux22 sparc64_linux24>
+<sparc64_linux22 sparc64_linux24 sparc64_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-sparc64 asm
-<ia64_linux24>
+<ia64_linux24 ia64_linux26>
ln -fs ${LINUX_KERNEL_PATH}/include/asm-ia64 asm
<all>
for m in ${MPS} ; do \
struct socket *sockp;
struct sockaddr_in myaddr;
int code;
+ KERNEL_SPACE_DECL;
+ int pmtu = IP_PMTUDISC_DONT;
/* We need a better test for this. if you need it back, tell us
return NULL;
}
+ TO_USER_SPACE();
+ sockp->ops->setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+ TO_KERNEL_SPACE();
return (struct osi_socket *)sockp;
}
rx_StartServer(int donateMe)
{
register struct rx_service *service;
- register int i, nProcs = 0;
+ register int i;
SPLVAR;
clock_NewTime();
#ifndef AFS_NT40_ENV
#ifndef KERNEL
char name[32];
+ static int nProcs;
#ifdef AFS_PTHREAD_ENV
pid_t pid;
pid = (pid_t) pthread_self();
* idle (refCount == 0) after rx_idlePeerTime (60 seconds) have passed.
*/
MUTEX_ENTER(&rx_peerHashTable_lock);
- if (--conn->peer->refCount <= 0) {
+ if (conn->peer->refCount < 2) {
conn->peer->idleWhen = clock_Sec();
- if (conn->peer->refCount < 0) {
- conn->peer->refCount = 0;
+ if (conn->peer->refCount < 1) {
+ conn->peer->refCount = 1;
MUTEX_ENTER(&rx_stats_mutex);
rxi_lowPeerRefCount++;
MUTEX_EXIT(&rx_stats_mutex);
}
}
+ conn->peer->refCount--;
MUTEX_EXIT(&rx_peerHashTable_lock);
MUTEX_ENTER(&rx_stats_mutex);
USERPRI;
}
+void
+rx_GetConnection(register struct rx_connection *conn)
+{
+ SPLVAR;
+
+ NETPRI;
+ AFS_RXGLOCK();
+ MUTEX_ENTER(&conn->conn_data_lock);
+ conn->refCount++;
+ MUTEX_EXIT(&conn->conn_data_lock);
+ AFS_RXGUNLOCK();
+ USERPRI;
+}
+
/* Start a new rx remote procedure call, on the specified connection.
* If wait is set to 1, wait for a free call channel; otherwise return
* 0. Maxtime gives the maximum number of seconds this call may take,
call->flags |= RX_CALL_WAIT_PROC;
MUTEX_ENTER(&rx_stats_mutex);
rx_nWaiting++;
+ rx_nWaited++;
MUTEX_EXIT(&rx_stats_mutex);
rxi_calltrace(RX_CALL_ARRIVAL, call);
SET_CALL_QUEUE_LOCK(call, &rx_serverPool_lock);
MUTEX_ENTER(&rx_stats_mutex);
rx_stats.nPeerStructs--;
MUTEX_EXIT(&rx_stats_mutex);
- if (prev == *peer_ptr) {
+ if (peer == *peer_ptr) {
*peer_ptr = next;
prev = next;
} else
if (stat->version >= RX_DEBUGI_VERSION_W_GETPEER) {
*supportedValues |= RX_SERVER_DEBUG_ALL_PEER;
}
+ if (stat->version >= RX_DEBUGI_VERSION_W_WAITED) {
+ *supportedValues |= RX_SERVER_DEBUG_WAITED_CNT;
+ }
stat->nFreePackets = ntohl(stat->nFreePackets);
stat->packetReclaims = ntohl(stat->packetReclaims);
* never be cleaned up.
*/
peer = rxi_FindPeer(*host, *port, 0, 0);
- if (peer) {
+ /* Since this may not be associated with a connection,
+ * it may have no refCount, meaning we could race with
+ * ReapConnections
+ */
+ if (peer && (peer->refCount > 0)) {
MUTEX_ENTER(&peer->peer_lock);
hadd32(peer->bytesReceived, p->length);
MUTEX_EXIT(&peer->peer_lock);
tstat.packetReclaims = htonl(rx_packetReclaims);
tstat.usedFDs = CountFDs(64);
tstat.nWaiting = htonl(rx_nWaiting);
+ tstat.nWaited = htonl(rx_nWaited);
queue_Count(&rx_idleServerQueue, np, nqe, rx_serverQueueEntry,
tstat.idleThreads);
MUTEX_EXIT(&rx_serverPool_lock);
osi_socket socketFd = OSI_NULLSOCKET;
struct sockaddr_in taddr;
char *name = "rxi_GetUDPSocket: ";
- int greedy = 0;
+#ifdef AFS_LINUX22_ENV
+ int pmtu=IP_PMTUDISC_DONT;
+#endif
#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV)
if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) {
fcntl(socketFd, F_SETFD, 1);
#endif
+#ifndef AFS_DJGPP_ENV
/* Use one of three different ways of getting a socket buffer expanded to
* a reasonable size.
*/
{
+ int greedy = 0;
int len1, len2;
len1 = 32766;
len2 = rx_UdpBufSize;
-#ifndef AFS_DJGPP_ENV
greedy =
(setsockopt
(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
(setsockopt
(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2,
sizeof(len2)) >= 0);
-#endif /* AFS_DJGPP_ENV */
+ if (!greedy)
+ (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n",
+ name);
+ MUTEX_ENTER(&rx_stats_mutex);
+ rx_stats.socketGreedy = greedy;
+ MUTEX_EXIT(&rx_stats_mutex);
}
-
-#ifndef AFS_DJGPP_ENV
- if (!greedy)
- (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n",
- name);
#endif /* AFS_DJGPP_ENV */
+
+#ifdef AFS_LINUX22_ENV
+ setsockopt(socketFd, SOL_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu));
+#endif
+
if (rxi_Listen(socketFd) < 0) {
goto error;
}
close(socketFd);
#endif
- MUTEX_ENTER(&rx_stats_mutex);
- rx_stats.socketGreedy = greedy;
- MUTEX_EXIT(&rx_stats_mutex);
return OSI_NULLSOCKET;
}
int withRxStats;
int withWaiters;
int withIdleThreads;
+ int withWaited;
int withPeers;
struct rx_debugStats tstats;
char *portName, *hostName;
withRxStats = (supportedDebugValues & RX_SERVER_DEBUG_RX_STATS);
withWaiters = (supportedDebugValues & RX_SERVER_DEBUG_WAITER_CNT);
withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_IDLE_THREADS);
+ withIdleThreads = (supportedDebugValues & RX_SERVER_DEBUG_WAITED_CNT);
withPeers = (supportedDebugValues & RX_SERVER_DEBUG_ALL_PEER);
printf("Free packets: %d, packet reclaims: %d, calls: %d, used FDs: %d\n",
printf("%d calls waiting for a thread\n", tstats.nWaiting);
if (withIdleThreads)
printf("%d threads are idle\n", tstats.idleThreads);
+ if (withWaited)
+ printf("%d calls have waited for a thread\n", tstats.nWaited);
if (rxstats) {
if (!withRxStats) {
/* IN int encrypt; * 0 ==> decrypt, else encrypt */
afs_int32
-fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+fc_ecb_encrypt(void * clear, void * cipher,
fc_KeySchedule schedule, int encrypt)
{
afs_uint32 L, R;
memcpy(&L, clear, sizeof(afs_int32));
memcpy(&R, clear + 1, sizeof(afs_int32));
#else
- L = ntohl(*clear);
- R = ntohl(*(clear + 1));
+ L = ntohl(*((afs_uint32 *)clear));
+ R = ntohl(*((afs_uint32 *)clear + 1));
#endif
if (encrypt) {
memcpy(cipher, &L, sizeof(afs_int32));
memcpy(cipher + 1, &R, sizeof(afs_int32));
#else
- *cipher = htonl(L);
- *(cipher + 1) = htonl(R);
+ *((afs_int32 *)cipher) = htonl(L);
+ *((afs_int32 *)cipher + 1) = htonl(R);
#endif
return 0;
}
afs_uint32 *xor; * 8 bytes of initialization vector *
*/
afs_int32
-fc_cbc_encrypt(char *input, char *output, afs_int32 length,
+fc_cbc_encrypt(void *input, void *output, afs_int32 length,
fc_KeySchedule key, afs_uint32 * xor, int encrypt)
{
afs_uint32 i, j;
for (i = 0; length > 0; i++, length -= 8) {
/* get input */
memcpy(t_input, input, sizeof(t_input));
- input += sizeof(t_input);
+ input=((char *)input) + sizeof(t_input);
/* zero pad */
for (j = length; j <= 7; j++)
/* copy temp output and save it for cbc */
memcpy(output, t_output, sizeof(t_output));
- output += sizeof(t_output);
+ output=(char *)output + sizeof(t_output);
/* calculate xor value for next round from plain & cipher text */
xor[0] = t_input[0] ^ t_output[0];
for (i = 0; length > 0; i++, length -= 8) {
/* get input */
memcpy(t_input, input, sizeof(t_input));
- input += sizeof(t_input);
+ input=((char *)input) + sizeof(t_input);
/* no padding for decrypt */
fc_ecb_encrypt(t_input, t_output, key, encrypt);
/* copy temp output */
memcpy(output, t_output, sizeof(t_output));
- output += sizeof(t_output);
+ output=((char *)output) + sizeof(t_output);
/* calculate xor value for next round from plain & cipher text */
xor[0] = t_input[0] ^ t_output[0];
/* no ticket good for longer than 30 days */
#define MAXKTCTICKETLIFETIME (30*24*3600)
#define MINKTCTICKETLEN 32
-#ifdef AFS_AIX_ENV
-#define MAXKTCTICKETLEN 344 /* XXX why must this be small? */
-#else
#define MAXKTCTICKETLEN 12000 /* was 344 */
-#endif
-
#define MAXKTCNAMELEN 64 /* name & inst should be 256 */
#define MAXKTCREALMLEN 64 /* should be 256 */
#define KTC_TIME_UNCERTAINTY (15*60) /* max skew bet. machines' clocks */
/* domestic/fcrypt.c */
extern int fc_keysched(struct ktc_encryptionKey *key,
fc_KeySchedule schedule);
-extern afs_int32 fc_ecb_encrypt(afs_uint32 * clear, afs_uint32 * cipher,
+extern afs_int32 fc_ecb_encrypt(void * clear, void * cipher,
fc_KeySchedule schedule, int encrypt);
-extern afs_int32 fc_cbc_encrypt(char *input, char *output, afs_int32 length,
+extern afs_int32 fc_cbc_encrypt(void *input, void *output, afs_int32 length,
fc_KeySchedule key, afs_uint32 * xor,
int encrypt);
rp->nbytes = 0;
}
+static BOOL
+IoctlDebug(void)
+{
+ static int init = 0;
+ static BOOL debug = 0;
+
+ if ( !init ) {
+ HKEY hk;
+
+ if (RegOpenKey (HKEY_LOCAL_MACHINE,
+ TEXT("Software\\OpenAFS\\Client"), &hk) == 0)
+ {
+ DWORD dwSize = sizeof(BOOL);
+ DWORD dwType = REG_DWORD;
+ RegQueryValueEx (hk, TEXT("IoctlDebug"), NULL, &dwType, (PBYTE)&debug, &dwSize);
+ RegCloseKey (hk);
+ }
+
+ init = 1;
+ }
+
+ return debug;
+}
+
static long
GetIoctlHandle(char *fileNamep, HANDLE * handlep)
{
char szPath[MAX_PATH] = "";
NETRESOURCE nr;
DWORD res;
- DWORD ioctlDebug = 0;
+ DWORD ioctlDebug = IoctlDebug();
DWORD gle;
- if (RegOpenKey (HKEY_LOCAL_MACHINE,
- TEXT("Software\\OpenAFS\\Client"), &hk) == 0)
- {
- DWORD dwSize = sizeof(DWORD);
- DWORD dwType = REG_DWORD;
- RegQueryValueEx (hk, TEXT("IoctlDebug"), NULL, &dwType, (PBYTE)&ioctlDebug, &dwSize);
- RegCloseKey (hk);
- }
-
gle = GetLastError();
if (gle && ioctlDebug ) {
char buf[4096];
{
long rcount;
long ioCount;
+ DWORD gle;
rcount = reqp->mp - reqp->data;
- if (rcount <= 0)
+ if (rcount <= 0) {
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl Transceive rcount <= 0: %d\r\n",rcount);
return EINVAL; /* not supposed to happen */
+ }
if (!WriteFile(handle, reqp->data, rcount, &ioCount, NULL)) {
/* failed to write */
- return GetLastError();
+ gle = GetLastError();
+
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl Transceive WriteFile failed: 0x%X\r\n",gle);
+ return gle;
}
if (!ReadFile(handle, reqp->data, sizeof(reqp->data), &ioCount, NULL)) {
/* failed to read */
- return GetLastError();
+ gle = GetLastError();
+
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl Transceive ReadFile failed: 0x%X\r\n",gle);
+ return gle;
}
reqp->nbytes = ioCount; /* set # of bytes available */
{
/* not enough data left */
if (reqp->nbytes < 4) {
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl UnmarshallLong reqp->nbytes < 4: %d\r\n",
+ reqp->nbytes);
return -1;
}
count = 1;
/* watch for buffer overflow */
- if ((reqp->mp - reqp->data) + count > sizeof(reqp->data))
+ if ((reqp->mp - reqp->data) + count > sizeof(reqp->data)) {
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl MarshallString buffer overflow\r\n");
return -1;
+ }
if (stringp)
memcpy(reqp->mp, stringp, count);
newPath[2] = 0;
if (!SetCurrentDirectory(newPath)) {
code = GetLastError();
+
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl fs_GetFullPath SetCurrentDirectory(%s) failed: 0x%X\r\n",
+ newPath, code);
return code;
}
}
/* now get the absolute path to the current wdir in this drive */
GetCurrentDirectory(sizeof(tpath), tpath);
- if (tpath[1] == ':')
- strcpy(outPathp, tpath + 2); /* skip drive letter */
- else if ( tpath[0] == '\\' && tpath[1] == '\\') {
+ if (tpath[1] == ':')
+ strcpy(outPathp, tpath + 2); /* skip drive letter */
+ else if ( tpath[0] == '\\' && tpath[1] == '\\') {
/* UNC path - strip off the server and sharename */
int i, count;
for ( i=2,count=2; count < 4 && tpath[i]; i++ ) {
/* if there is a non-null name after the drive, append it */
if (*firstp != 0) {
- int len = strlen(outPathp);
- if (outPathp[len-1] != '\\' && outPathp[len-1] != '/')
- strcat(outPathp, "\\");
- strcat(outPathp, firstp);
+ int len = strlen(outPathp);
+ if (outPathp[len-1] != '\\' && outPathp[len-1] != '/')
+ strcat(outPathp, "\\");
+ strcat(outPathp, firstp);
}
/* finally, if necessary, switch back to our home drive letter */
}
/* now unmarshall the return value */
- UnmarshallLong(&preq, &temp);
+ if (UnmarshallLong(&preq, &temp) != 0) {
+ CloseHandle(reqHandle);
+ return -1;
+ }
+
if (temp != 0) {
CloseHandle(reqHandle);
errno = CMtoUNIXerror(temp);
+ if ( IoctlDebug() )
+ fprintf(stderr, "pioctl temp != 0: %d\r\n",temp);
return -1;
}
for (j = 0, found = 0; j < count; j++) {
for (i = 0; i < totalServers; i++) {
if (info)
- tmpAddr =
- (afs_uint32) info->hostAddr[i].sin_addr.s_addr;
+ tmpAddr = (afs_uint32) info->hostAddr[i].sin_addr.s_addr;
else
tmpAddr = aservers[i];
if (myAddr[j] == tmpAddr) {
afs_int32 transMode, struct ubik_trans **transPtr);
extern int ubik_EndTrans(register struct ubik_trans *transPtr);
+/* uinit.c */
+
+extern afs_int32 ugen_ClientInit(int noAuthFlag, char *confDir, char *cellName,
+ afs_int32 sauth,
+ struct ubik_client **uclientp,
+ int (*secproc) (), char *funcName,
+ afs_int32 gen_rxkad_level,
+ afs_int32 maxservers, afs_int32 serviceid,
+ afs_int32 deadtime, afs_uint32 server,
+ afs_uint32 port, afs_int32 usrvid);
+
#endif /* UBIK_H */
} else {
x = "%u.%u.%u.%u";
}
- sprintf(xbuf, x, (UVAL & 0xff000000) >> 24,
- (UVAL & 0x00ff0000) >> 16, (UVAL & 0x0000ff00) >> 8,
- (UVAL & 0x000000ff));
+ /* typecast to whatever '%u' is! */
+ sprintf(xbuf, x, (unsigned int)((UVAL & 0xff000000) >> 24),
+ (unsigned int)((UVAL & 0x00ff0000) >> 16),
+ (unsigned int)((UVAL & 0x0000ff00) >> 8),
+ (unsigned int)(UVAL & 0x000000ff));
x = xbuf;
len = strlen(xbuf);
}
struct ViceInodeInfo *,
char *, char *), FILE * fp,
int (*judgeFun) (struct ViceInodeInfo *,
- int vid),
- int singleVolumeNumber);
+ int vid, void *),
+ int singleVolumeNumber, void *rock);
/* WriteInodeInfo
*/
int
ListViceInodes(char *devname, char *mountedOn, char *resultFile,
- int (*judgeInode) (struct ViceInodeInfo * info, int vid),
- int singleVolumeNumber, int *forcep, int forceR, char *wpath)
+ int (*judgeInode) (struct ViceInodeInfo * info, int vid, void *rock),
+ int singleVolumeNumber, int *forcep, int forceR, char *wpath,
+ void *rock)
{
FILE *fp = (FILE *) - 1;
int ninodes;
ninodes =
namei_ListAFSFiles(mountedOn, WriteInodeInfo, fp, judgeInode,
- singleVolumeNumber);
+ singleVolumeNumber, rock);
if (!resultFile)
return ninodes;
namei_ListAFSFiles(char *dev,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int),
- int singleVolumeNumber)
+ int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+ int singleVolumeNumber, void *rock)
{
IHandle_t ih;
namei_t name;
namei_HandleToVolDir(&name, &ih);
ninodes =
namei_ListAFSSubDirs(&ih, writeFun, fp, judgeFun,
- singleVolumeNumber);
+ singleVolumeNumber, rock);
if (ninodes < 0)
return ninodes;
} else {
if (!DecodeVolumeName(dp2->d_name, &ih.ih_vid)) {
ninodes +=
namei_ListAFSSubDirs(&ih, writeFun, fp, judgeFun,
- 0);
+ 0, rock);
}
}
closedir(dirp2);
namei_ListAFSSubDirs(IHandle_t * dirIH,
int (*writeFun) (FILE *, struct ViceInodeInfo *, char *,
char *), FILE * fp,
- int (*judgeFun) (struct ViceInodeInfo *, int),
- int singleVolumeNumber)
+ int (*judgeFun) (struct ViceInodeInfo *, int, void *),
+ int singleVolumeNumber, void *rock)
{
IHandle_t myIH = *dirIH;
namei_t name;
info.linkCount =
namei_GetLinkCount(&linkHandle, (Inode) 0, 0);
}
- if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber))
+ if (judgeFun && !(*judgeFun) (&info, singleVolumeNumber, rock))
continue;
if ((*writeFun) (fp, &info, path1, dp1->d_name) < 0) {
continue;
}
if (judgeFun
- && !(*judgeFun) (&info, singleVolumeNumber))
+ && !(*judgeFun) (&info, singleVolumeNumber, rock))
continue;
if ((*writeFun) (fp, &info, path3, dp3->d_name) <
afs_int32 freePtr; /* first free index in this table */
Inode inode[MAXATONCE]; /* inode # */
afs_int32 count[MAXATONCE]; /* link count */
-} *allInodes = 0;
+};
/* called with a structure specifying info about the inode, and our rock (which
* is the volume ID. Returns true if we should keep this inode, otherwise false.
* Note that ainfo->u.param[0] is always the volume ID, for any vice inode.
*/
static int
-NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid)
+NukeProc(struct ViceInodeInfo *ainfo, afs_int32 avolid, struct ilist *allInodes)
{
struct ilist *ti;
register afs_int32 i;
{
/* first process the partition containing this junk */
struct afs_stat tstat;
- struct ilist *ti, *ni;
+ struct ilist *ti, *ni, *li=NULL;
register afs_int32 code;
int i, forceSal;
char devName[64], wpath[100];
#endif
#endif /* AFS_NAMEI_ENV */
IHandle_t *fileH;
+ struct ilist *allInodes = 0;
if (avolid == 0)
return EINVAL;
#ifdef AFS_NAMEI_ENV
code =
ListViceInodes(lastDevComp, aname, NULL, NukeProc, avolid, &forceSal,
- 0, wpath);
+ 0, wpath, allInodes);
#else
code =
ListViceInodes(lastDevComp, aname, "/tmp/vNukeXX", NukeProc, avolid,
- &forceSal, 0, wpath);
+ &forceSal, 0, wpath, allInodes);
unlink("/tmp/vNukeXX"); /* clean it up now */
#endif
if (code == 0) {
#endif /* AFS_NAMEI_ENV */
}
ni = ti->next;
- free(ti);
+ if (li) free(li);
+ li = ti;
}
+ if (li) free(li);
code = 0; /* we really don't care about it except for debugging */
allInodes = NULL;
/* just free things */
for (ti = allInodes; ti; ti = ni) {
ni = ti->next;
- free(ti);
+ if (li) free(li);
+ li = ti;
}
+ if (li) free(li);
allInodes = NULL;
}
ReleaseWriteLock(&localLock);
}
int
-OnlyOneVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber)
+OnlyOneVolume(struct ViceInodeInfo *inodeinfo, VolumeId singleVolumeNumber, void *rock)
{
if (inodeinfo->u.vnode.vnodeNumber == INODESPECIAL)
return (inodeinfo->u.special.parentId == singleVolumeNumber);
if ((err =
ListViceInodes(dev, fileSysPath, path,
singleVolumeNumber ? OnlyOneVolume : 0,
- singleVolumeNumber, &forceSal, forceR, wpath)) < 0) {
+ singleVolumeNumber, &forceSal, forceR, wpath, NULL)) < 0) {
if (err == -2) {
Log("*** I/O error %d when writing a tmp inode file %s; Not salvaged %s ***\nIncrease space on partition or use '-tmpdir'\n", errno, path, dev);
return -1;