From dacae61bda0105497e912b3cdac429066cd68fcf Mon Sep 17 00:00:00 2001 From: Jim Rees Date: Thu, 20 Jan 2005 17:33:38 +0000 Subject: [PATCH] re-indent-20040120 re-indent so I can read the file so I can fix a bug --- src/afs/afs_pioctl.c | 159 ++++++++++++++++++++++--------------------- 1 file changed, 80 insertions(+), 79 deletions(-) diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index eb505e30d..84a732986 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -271,9 +271,9 @@ copyin_afs_ioctl(caddr_t cmarg, struct afs_ioctl *dst) if (current->thread.flags & THREAD_IA32) #elif defined(AFS_PPC64_LINUX20_ENV) #ifdef AFS_PPC64_LINUX26_ENV - if (current->thread_info->flags & _TIF_32BIT) -#else /*Linux 2.6*/ - if (current->thread.flags & PPC_FLAG_32BIT) + 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) @@ -1120,61 +1120,61 @@ afs_HandlePioctl(struct vnode *avp, afs_int32 acom, return E2BIG; if (inSize > AFS_LRALLOCSIZ) { - inData = osi_AllocLargeSpace(inSize+1); + inData = osi_AllocLargeSpace(inSize + 1); } else { - inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); + inData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); } if (!inData) - return ENOMEM; + return ENOMEM; if (inSize > 0) { AFS_COPYIN(ablob->in, inData, inSize, code); inData[inSize] = '\0'; } else code = 0; if (code) { - if (inSize > AFS_LRALLOCSIZ) { - osi_Free(inData, inSize+1); - } else { - osi_FreeLargeSpace(inData); - } - afs_PutFakeStat(&fakestate); - return code; + if (inSize > AFS_LRALLOCSIZ) { + osi_Free(inData, inSize + 1); + } else { + osi_FreeLargeSpace(inData); + } + afs_PutFakeStat(&fakestate); + return code; } - if (function == 8 && device == 'V') { /* PGetTokens */ - outSizeMax = MAXPIOCTLTOKENLEN; - outData = osi_Alloc(outSizeMax); + if (function == 8 && device == 'V') { /* PGetTokens */ + outSizeMax = MAXPIOCTLTOKENLEN; + outData = osi_Alloc(outSizeMax); } else { - outSizeMax = AFS_LRALLOCSIZ; - outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); + outSizeMax = AFS_LRALLOCSIZ; + outData = osi_AllocLargeSpace(AFS_LRALLOCSIZ); } if (!outData) { - if (inSize > AFS_LRALLOCSIZ) { - osi_Free(inData, inSize+1); - } else { - osi_FreeLargeSpace(inData); - } - return ENOMEM; + if (inSize > AFS_LRALLOCSIZ) { + osi_Free(inData, inSize + 1); + } else { + osi_FreeLargeSpace(inData); + } + return ENOMEM; } outSize = 0; code = (*pioctlSw[function]) (avc, function, &treq, inData, outData, inSize, &outSize, acred); if (inSize > AFS_LRALLOCSIZ) { - osi_Free(inData, inSize+1); + osi_Free(inData, inSize + 1); } else { - osi_FreeLargeSpace(inData); + osi_FreeLargeSpace(inData); } if (code == 0 && ablob->out_size > 0) { - if (outSize > ablob->out_size) { - code = E2BIG; /* data wont fit in user buffer */ - } else if (outSize) { - AFS_COPYOUT(outData, ablob->out, outSize, code); - } + if (outSize > ablob->out_size) { + code = E2BIG; /* data wont fit in user buffer */ + } else if (outSize) { + AFS_COPYOUT(outData, ablob->out, outSize, code); + } } if (outSizeMax > AFS_LRALLOCSIZ) { - osi_Free(outData, outSizeMax); + osi_Free(outData, outSizeMax); } else { - osi_FreeLargeSpace(outData); + osi_FreeLargeSpace(outData); } afs_PutFakeStat(&fakestate); return afs_CheckCode(code, &treq, 41); @@ -2762,8 +2762,8 @@ DECL_PIOCTL(PSetSysName) return error; } } else { - foundname = num; - strcpy(outname, (*sysnamelist)[0]); + foundname = num; + strcpy(outname, (*sysnamelist)[0]); } afs_PutUser(au, READ_LOCK); } else { @@ -3770,21 +3770,22 @@ DECL_PIOCTL(PCallBackAddr) struct unixuser *tu; struct srvAddr **addrs; - /*AFS_STATCNT(PCallBackAddr);*/ - if ( !afs_resourceinit_flag ) /* afs deamons havn't started yet */ - return EIO; /* Inappropriate ioctl for device */ + /*AFS_STATCNT(PCallBackAddr); */ + if (!afs_resourceinit_flag) /* afs deamons havn't started yet */ + return EIO; /* Inappropriate ioctl for device */ if (!afs_osi_suser(acred)) return EACCES; - if ( ainSize < sizeof(afs_int32) ) + if (ainSize < sizeof(afs_int32)) return EINVAL; memcpy(&addr, ain, sizeof(afs_int32)); ObtainReadLock(&afs_xinterface); - for ( i=0; (unsigned short)i < afs_cb_interface.numberOfInterfaces; i++) { - if (afs_cb_interface.addr_in[i] == addr) break; + for (i = 0; (unsigned short)i < afs_cb_interface.numberOfInterfaces; i++) { + if (afs_cb_interface.addr_in[i] == addr) + break; } ReleaseWriteLock(&afs_xinterface); @@ -3792,65 +3793,65 @@ DECL_PIOCTL(PCallBackAddr) if (afs_cb_interface.addr_in[i] != addr) return EINVAL; - ObtainReadLock(&afs_xserver); /* Necessary? */ + ObtainReadLock(&afs_xserver); /* Necessary? */ ObtainReadLock(&afs_xsrvAddr); srvAddrCount = 0; - for (i=0;inext_bkt) { - srvAddrCount++; - } + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + srvAddrCount++; + } } addrs = afs_osi_Alloc(srvAddrCount * sizeof(*addrs)); j = 0; - for (i=0;inext_bkt) { - if (j >= srvAddrCount) break; - addrs[j++] = sa; - } + for (i = 0; i < NSERVERS; i++) { + for (sa = afs_srvAddrs[i]; sa; sa = sa->next_bkt) { + if (j >= srvAddrCount) + break; + addrs[j++] = sa; + } } ReleaseReadLock(&afs_xsrvAddr); ReleaseReadLock(&afs_xserver); - for (i=0; iserver; - if (!ts) - continue; - - /* vlserver has no callback conn */ - if (sa->sa_portal == AFS_VLPORT) { - continue; - } - - if (!ts->cell) /* not really an active server, anyway, it must */ - continue; /* have just been added by setsprefs */ - - /* get a connection, even if host is down; bumps conn ref count */ - tu = afs_GetUser(areq->uid, ts->cell->cellNum, SHARED_LOCK); - tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cellNum, tu, - 1/*force*/, 1/*create*/, SHARED_LOCK); - afs_PutUser(tu, SHARED_LOCK); - if (!tc) + for (i = 0; i < j; i++) { + sa = addrs[i]; + ts = sa->server; + if (!ts) continue; - if ((sa->sa_flags & SRVADDR_ISDOWN) || afs_HaveCallBacksFrom(ts)) { - if (sa->sa_flags & SRVADDR_ISDOWN) { - rx_SetConnDeadTime(tc->id, 3); - } + /* vlserver has no callback conn */ + if (sa->sa_portal == AFS_VLPORT) { + continue; + } + + if (!ts->cell) /* not really an active server, anyway, it must */ + continue; /* have just been added by setsprefs */ + + /* get a connection, even if host is down; bumps conn ref count */ + tu = afs_GetUser(areq->uid, ts->cell->cellNum, SHARED_LOCK); + tc = afs_ConnBySA(sa, ts->cell->fsport, ts->cell->cellNum, tu, + 1 /*force */ , 1 /*create */ , SHARED_LOCK); + afs_PutUser(tu, SHARED_LOCK); + if (!tc) + continue; + if ((sa->sa_flags & SRVADDR_ISDOWN) || afs_HaveCallBacksFrom(ts)) { + if (sa->sa_flags & SRVADDR_ISDOWN) { + rx_SetConnDeadTime(tc->id, 3); + } #ifdef RX_ENABLE_LOCKS - AFS_GUNLOCK(); + AFS_GUNLOCK(); #endif /* RX_ENABLE_LOCKS */ code = RXAFS_CallBackRxConnAddr(tc->id, &addr); #ifdef RX_ENABLE_LOCKS - AFS_GLOCK(); + AFS_GLOCK(); #endif /* RX_ENABLE_LOCKS */ } - afs_PutConn(tc, SHARED_LOCK); /* done with it now */ - } /* Outer loop over addrs */ + afs_PutConn(tc, SHARED_LOCK); /* done with it now */ + } /* Outer loop over addrs */ #endif /* UKERNEL */ return 0; } -- 2.39.5