From 73f0f34bd4b5c4335d721238d8072fb8c3eb8fa7 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 2 Mar 2010 06:14:19 -0500 Subject: [PATCH] de-printf the cache manager put most printfs into either afs_warn or comment out entirely move a couple uprintfs to afs_warnuser (and allow them to trigger on macos) Change-Id: If67a09287fcfbe44cc76961dd59d2aad3299e887 Reviewed-on: http://gerrit.openafs.org/1501 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear --- src/afs/VNOPS/afs_vnop_access.c | 2 +- src/afs/VNOPS/afs_vnop_dirops.c | 9 ++++----- src/afs/VNOPS/afs_vnop_open.c | 4 ++-- src/afs/VNOPS/afs_vnop_symlink.c | 2 +- src/afs/VNOPS/afs_vnop_write.c | 6 +++--- src/afs/afs_call.c | 10 +++++----- src/afs/afs_daemons.c | 2 +- src/afs/afs_dcache.c | 8 ++++---- src/afs/afs_disconnected.c | 38 ++++++++++++++++++-------------------- src/afs/afs_init.c | 6 +++--- src/afs/afs_memcache.c | 4 ++-- src/afs/afs_osi_pag.c | 6 +++--- src/afs/afs_pag_cred.c | 11 ++++++----- src/afs/afs_pioctl.c | 19 ++++++++++--------- src/afs/afs_vcache.c | 22 +++++++++++----------- 15 files changed, 74 insertions(+), 75 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_access.c b/src/afs/VNOPS/afs_vnop_access.c index 0a31ac8..1b8d0f8 100644 --- a/src/afs/VNOPS/afs_vnop_access.c +++ b/src/afs/VNOPS/afs_vnop_access.c @@ -251,7 +251,7 @@ afs_access(OSI_VC_DECL(avc), register afs_int32 amode, if ((amode & VWRITE) && (AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW)) { afs_PutFakeStat(&fakestate); AFS_DISCON_UNLOCK(); - printf("Network is down in afs_vnop_access\n"); + /* printf("Network is down in afs_vnop_access\n"); */ return ENETDOWN; } diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index aaeaefd..a3d5ea4 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -210,7 +210,7 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, /* Get a new dcache for it first. */ new_dc = afs_GetDCache(tvc, (afs_size_t) 0, &treq, &offset, &len, 1); if (!new_dc) { - printf("afs_mkdir: can't get new dcache for dir.\n"); + /* printf("afs_mkdir: can't get new dcache for dir.\n"); */ code = ENOENT; goto done; } @@ -220,8 +220,7 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, (afs_int32 *) &newFid.Fid, (afs_int32 *) &adp->f.fid.Fid); ReleaseWriteLock(&afs_xdcache); - if (code) - printf("afs_mkdir: afs_dirMakeDir code = %u\n", code); + /* if (code) printf("afs_mkdir: afs_dirMakeDir code = %u\n", code); */ afs_PutDCache(new_dc); @@ -383,7 +382,7 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) if (!tdc) { ReleaseWriteLock(&adp->lock); - printf("afs_rmdir: No local dcache!\n"); + /* printf("afs_rmdir: No local dcache!\n"); */ code = ENETDOWN; goto done; } @@ -401,7 +400,7 @@ afs_rmdir(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) ReleaseSharedLock(&afs_xvcache); if (!tvc) { - printf("afs_rmdir: Can't find dir's vcache!\n"); + /* printf("afs_rmdir: Can't find dir's vcache!\n"); */ ReleaseSharedLock(&tdc->lock); afs_PutDCache(tdc); /* drop ref count */ ReleaseWriteLock(&adp->lock); diff --git a/src/afs/VNOPS/afs_vnop_open.c b/src/afs/VNOPS/afs_vnop_open.c index 1682f2f..6e8d2d5 100644 --- a/src/afs/VNOPS/afs_vnop_open.c +++ b/src/afs/VNOPS/afs_vnop_open.c @@ -72,7 +72,7 @@ afs_open(struct vcache **avcp, afs_int32 aflags, afs_ucred_t *acred) #ifdef AFS_DISCON_ENV if (AFS_IS_DISCONNECTED && (afs_DCacheMissingChunks(tvc) != 0)) { ReleaseReadLock(&tvc->lock); - printf("Network is down in afs_open: missing chunks\n"); + /* printf("Network is down in afs_open: missing chunks\n"); */ code = ENETDOWN; goto done; } @@ -94,7 +94,7 @@ afs_open(struct vcache **avcp, afs_int32 aflags, afs_ucred_t *acred) (tvc, ((tvc->f.states & CForeign) ? PRSFS_READ : PRSFS_LOOKUP), &treq, CHECK_MODE_BITS)) { code = EACCES; - printf("afs_Open: no access for dir\n"); + /* printf("afs_Open: no access for dir\n"); */ goto done; } } diff --git a/src/afs/VNOPS/afs_vnop_symlink.c b/src/afs/VNOPS/afs_vnop_symlink.c index fdc088c..691b3b5 100644 --- a/src/afs/VNOPS/afs_vnop_symlink.c +++ b/src/afs/VNOPS/afs_vnop_symlink.c @@ -47,7 +47,7 @@ afs_DisconCreateSymlink(struct vcache *avc, char *aname, tdc = afs_GetDCache(avc, 0, areq, &offset, &len, 0); if (!tdc) { - printf("afs_DisconCreateSymlink: can't get new dcache for symlink.\n"); + /* printf("afs_DisconCreateSymlink: can't get new dcache for symlink.\n"); */ return ENOENT; } diff --git a/src/afs/VNOPS/afs_vnop_write.c b/src/afs/VNOPS/afs_vnop_write.c index 3bb53e2..a33e12d 100644 --- a/src/afs/VNOPS/afs_vnop_write.c +++ b/src/afs/VNOPS/afs_vnop_write.c @@ -188,7 +188,7 @@ afs_MemWrite(register struct vcache *avc, struct uio *auio, int aio, * high-level write op. */ if (avc->execsOrWriters <= 0) { - printf("WARNING: afs_ufswr vp=%lx, exOrW=%d\n", (unsigned long)avc, + afs_warn("WARNING: afs_ufswr vp=%lx, exOrW=%d\n", (unsigned long)avc, avc->execsOrWriters); } #else @@ -405,7 +405,7 @@ afs_UFSWrite(register struct vcache *avc, struct uio *auio, int aio, * high-level write op. */ if (avc->execsOrWriters <= 0) { - printf("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc, + afs_warn("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc, avc->execsOrWriters); } #else @@ -771,7 +771,7 @@ afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred) #ifdef AFS_AIX32_ENV osi_ReleaseVM(avc, acred); #endif - printf("avc->vc_error=%d\n", avc->vc_error); + /* printf("avc->vc_error=%d\n", avc->vc_error); */ code = avc->vc_error; avc->vc_error = 0; } diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c index c01c4e3..685acf1 100644 --- a/src/afs/afs_call.c +++ b/src/afs/afs_call.c @@ -115,7 +115,7 @@ afs_InitSetup(int preallocs) rx_extraPackets = AFS_NRXPACKETS; /* smaller # of packets */ code = rx_InitHost(rx_bindhost, htons(7001)); if (code) { - printf("AFS: RX failed to initialize %d).\n", code); + afs_warn("AFS: RX failed to initialize %d).\n", code); return code; } rx_SetRxDeadTime(afs_rx_deadtime); @@ -161,7 +161,7 @@ afsd_thread(int *rock) thread_terminate(current_thread()); break; case AFSOP_START_BKG: - printf("Install matching afsd! Old background daemons not supported.\n"); + afs_warn("Install matching afsd! Old background daemons not supported.\n"); thread_terminate(current_thread()); break; case AFSOP_START_TRUNCDAEMON: @@ -202,7 +202,7 @@ afsd_thread(int *rock) thread_terminate(current_thread()); break; default: - printf("Unknown op %ld in StartDaemon()\n", (long)parm); + afs_warn("Unknown op %ld in StartDaemon()\n", (long)parm); break; } } @@ -376,7 +376,7 @@ afsd_thread(void *rock) complete_and_exit(0, 0); break; default: - printf("Unknown op %ld in StartDaemon()\n", (long)parm); + afs_warn("Unknown op %ld in StartDaemon()\n", (long)parm); break; } return 0; @@ -394,7 +394,7 @@ afsd_launcher(void *rock) #endif if (!kernel_thread(afsd_thread, (void *)rock, CLONE_VFORK | SIGCHLD)) - printf("kernel_thread failed. afs startup will not complete\n"); + afs_warn("kernel_thread failed. afs startup will not complete\n"); } void diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c index 483584f..e542c0a 100644 --- a/src/afs/afs_daemons.c +++ b/src/afs/afs_daemons.c @@ -233,7 +233,7 @@ afs_Daemon(void) /* Do the check here if the correct afsd is not installed. */ if (!cs_warned) { cs_warned = 1; - printf("Please install afsd with check server daemon.\n"); + afs_warn("Please install afsd with check server daemon.\n"); } if (lastNMinCheck + afs_probe_interval < now) { /* only check down servers */ diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index ff18367..024cbc3 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -3054,12 +3054,12 @@ afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags) /* ablocks is reported in 1K blocks */ code = afs_InitMemCache(afiles, AFS_FIRSTCSIZE, aflags); if (code != 0) { - printf("afsd: memory cache too large for available memory.\n"); - printf("afsd: AFS files cannot be accessed.\n\n"); + afs_warn("afsd: memory cache too large for available memory.\n"); + afs_warn("afsd: AFS files cannot be accessed.\n\n"); dcacheDisabled = 1; afiles = ablocks = 0; } else - printf("Memory cache: Allocating %d dcache entries...", + afs_warn("Memory cache: Allocating %d dcache entries...", aDentries); } else { cacheDiskType = AFS_FCACHE_TYPE_UFS; @@ -3356,7 +3356,7 @@ afs_MakeShadowDir(struct vcache *avc, struct dcache *adc) /* Alloc a 4k block. */ data = (char *) afs_osi_Alloc(4096); if (!data) { - printf("afs_MakeShadowDir: could not alloc data\n"); + afs_warn("afs_MakeShadowDir: could not alloc data\n"); ret_code = ENOMEM; goto done; } diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c index e61ea06..65d34af 100644 --- a/src/afs/afs_disconnected.c +++ b/src/afs/afs_disconnected.c @@ -293,7 +293,7 @@ afs_GetVnodeName(struct vcache *avc, struct VenusFid *afid, char *aname, if (tnf.name_len == -1) code = ENOENT; } else { - printf("Directory dcache not found!\n"); + /* printf("Directory dcache not found!\n"); */ code = ENOENT; } @@ -468,7 +468,7 @@ afs_FixChildrenFids(struct VenusFid *old_fid, struct VenusFid *new_fid) static int list_dir_hook(void *hdata, char *aname, afs_int32 vnode, afs_int32 unique) { - printf("list_dir_hook: %s v:%u u:%u\n", aname, vnode, unique); + /* printf("list_dir_hook: %s v:%u u:%u\n", aname, vnode, unique); */ return 0; } @@ -507,13 +507,13 @@ afs_GetParentVCache(struct vcache *avc, int deleted, struct VenusFid *afid, *adp = NULL; if (afs_GetParentDirFid(avc, afid)) { - printf("afs_GetParentVCache: Couldn't find parent dir's FID.\n"); + /* printf("afs_GetParentVCache: Couldn't find parent dir's FID.\n"); */ return ENOENT; } code = afs_GetVnodeName(avc, afid, aname, deleted); if (code) { - printf("afs_GetParentVCache: Couldn't find file name\n"); + /* printf("afs_GetParentVCache: Couldn't find file name\n"); */ goto end; } @@ -521,13 +521,13 @@ afs_GetParentVCache(struct vcache *avc, int deleted, struct VenusFid *afid, *adp = afs_FindVCache(afid, 0, 1); ReleaseSharedLock(&afs_xvcache); if (!*adp) { - printf("afs_GetParentVCache: Couldn't find parent dir's vcache\n"); + /* printf("afs_GetParentVCache: Couldn't find parent dir's vcache\n"); */ code = ENOENT; goto end; } if ((*adp)->f.ddirty_flags & VDisconCreate) { - printf("afs_GetParentVCache: deferring until parent exists\n"); + /* printf("afs_GetParentVCache: deferring until parent exists\n"); */ code = EAGAIN; goto end; } @@ -565,19 +565,19 @@ afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq) /* Get old name. */ old_name = (char *) afs_osi_Alloc(AFSNAMEMAX); if (!old_name) { - printf("afs_ProcessOpRename: Couldn't alloc space for old name.\n"); + /* printf("afs_ProcessOpRename: Couldn't alloc space for old name.\n"); */ return ENOMEM; } code = afs_GetVnodeName(avc, &old_pdir_fid, old_name, 1); if (code) { - printf("afs_ProcessOpRename: Couldn't find old name.\n"); + /* printf("afs_ProcessOpRename: Couldn't find old name.\n"); */ goto done; } /* Alloc data first. */ new_name = (char *) afs_osi_Alloc(AFSNAMEMAX); if (!new_name) { - printf("afs_ProcessOpRename: Couldn't alloc space for new name.\n"); + /* printf("afs_ProcessOpRename: Couldn't alloc space for new name.\n"); */ code = ENOMEM; goto done; } @@ -590,7 +590,7 @@ afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq) } else { /* Get parent dir's FID.*/ if (afs_GetParentDirFid(avc, &new_pdir_fid)) { - printf("afs_ProcessOpRename: Couldn't find new parent dir FID.\n"); + /* printf("afs_ProcessOpRename: Couldn't find new parent dir FID.\n"); */ code = ENOENT; goto done; } @@ -599,7 +599,7 @@ afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq) /* And finally get the new name. */ code = afs_GetVnodeName(avc, &new_pdir_fid, new_name, 0); if (code) { - printf("afs_ProcessOpRename: Couldn't find new name.\n"); + /* printf("afs_ProcessOpRename: Couldn't find new name.\n"); */ goto done; } @@ -630,8 +630,7 @@ afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq) SHARED_LOCK, NULL)); - if (code) - printf("afs_ProcessOpRename: server code=%u\n", code); + /* if (code) printf("afs_ProcessOpRename: server code=%u\n", code); */ done: if (new_name) afs_osi_Free(new_name, AFSNAMEMAX); @@ -772,7 +771,7 @@ afs_ProcessOpCreate(struct vcache *avc, struct vrequest *areq, /* TODO: Handle errors. */ if (code) { - printf("afs_ProcessOpCreate: error while creating vnode on server, code=%d .\n", code); + /* printf("afs_ProcessOpCreate: error while creating vnode on server, code=%d .\n", code); */ goto end; } @@ -918,7 +917,7 @@ afs_ProcessOpRemove(struct vcache *avc, struct vrequest *areq) tname = afs_osi_Alloc(AFSNAMEMAX); if (!tname) { - printf("afs_ProcessOpRemove: Couldn't alloc space for file name\n"); + /* printf("afs_ProcessOpRemove: Couldn't alloc space for file name\n"); */ return ENOMEM; } @@ -985,8 +984,7 @@ afs_ProcessOpRemove(struct vcache *avc, struct vrequest *areq) } /* if (vType(avc) == VREG) */ - if (code) - printf("afs_ProcessOpRemove: server returned code=%u\n", code); + /* if (code) printf("afs_ProcessOpRemove: server returned code=%u\n", code); */ end: afs_osi_Free(tname, AFSNAMEMAX); @@ -1226,7 +1224,7 @@ afs_ResyncDisconFiles(struct vrequest *areq, afs_ucred_t *acred) afs_ResetVCache(tvc, acred); tvc->f.truncPos = AFS_NOTRUNC; } else { - printf("afs_ResyncDisconFiles: no resolution policy selected.\n"); + /* printf("afs_ResyncDisconFiles: no resolution policy selected.\n"); */ } /* if DV match or client wins policy */ unlock_srv_file: @@ -1367,13 +1365,13 @@ afs_DbgDisconFiles(void) struct afs_q *q; int i = 0; - printf("List of dirty files: \n"); + afs_warn("List of dirty files: \n"); ObtainReadLock(&afs_disconDirtyLock); for (q = QPrev(&afs_disconDirty); q != &afs_disconDirty; q = QPrev(q)) { tvc = QEntry(q, struct vcache, dirtyq); - printf("Cell=%u Volume=%u VNode=%u Unique=%u\n", + afs_warn("Cell=%u Volume=%u VNode=%u Unique=%u\n", tvc->f.fid.Cell, tvc->f.fid.Fid.Volume, tvc->f.fid.Fid.Vnode, diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c index 4f1ea72..374be7c 100644 --- a/src/afs/afs_init.c +++ b/src/afs/afs_init.c @@ -118,11 +118,11 @@ afs_CacheInit(afs_int32 astatSize, afs_int32 afiles, afs_int32 ablocks, #ifdef AFS_MAXVCOUNT_ENV afsd_dynamic_vcaches = dynamic_vcaches; - printf("%s dynamically allocated vcaches\n", - ( afsd_dynamic_vcaches ? "enabling" : "disabling" )); + afs_warn("%s dynamically allocated vcaches\n", + ( afsd_dynamic_vcaches ? "enabling" : "disabling" )); #endif - printf("Starting AFS cache scan..."); + afs_warn("Starting AFS cache scan..."); if (afs_cacheinit_flag) return 0; afs_cacheinit_flag = 1; diff --git a/src/afs/afs_memcache.c b/src/afs/afs_memcache.c index dd87a5e..91d2839 100644 --- a/src/afs/afs_memcache.c +++ b/src/afs/afs_memcache.c @@ -56,8 +56,8 @@ afs_InitMemCache(int blkCount, int blkSize, int flags) return 0; nomem: - printf("afsd: memCache allocation failure at %d KB.\n", - (index * memCacheBlkSize) / 1024); + afs_warn("afsd: memCache allocation failure at %d KB.\n", + (index * memCacheBlkSize) / 1024); while (--index >= 0) { afs_osi_Free((memCache + index)->data, memCacheBlkSize); (memCache + index)->data = NULL; diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 074e85f..b1043eb 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -157,7 +157,7 @@ afs_pag_sleep(afs_ucred_t **acred) if (rv && (osi_Time() < pag_epoch)) { if (!afs_pag_timewarn) { afs_pag_timewarn = 1; - printf("clock went backwards, not PAG throttling"); + afs_warn("clock went backwards, not PAG throttling"); } rv = 0; } @@ -171,8 +171,8 @@ afs_pag_wait(afs_ucred_t **acred) { if (afs_pag_sleep(acred)) { if (!afs_pag_sleepcnt) { - printf("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n", - "afs_pag_wait", osi_getpid(), afs_pag_sleepcnt); + afs_warn("%s() PAG throttling triggered, pid %d... sleeping. sleepcnt %d\n", + "afs_pag_wait", osi_getpid(), afs_pag_sleepcnt); } afs_pag_sleepcnt++; diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c index 7e4a835..f1e26e3 100644 --- a/src/afs/afs_pag_cred.c +++ b/src/afs/afs_pag_cred.c @@ -173,14 +173,15 @@ int afspag_PSetTokens(char *ain, afs_int32 ainSize, afs_ucred_t **acred) if (set_parent_pag) { #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) # if defined(AFS_DARWIN_ENV) - afs_proc_t *p = current_proc(); /* XXX */ + afs_proc_t *p = current_proc(); /* XXX */ + char procname[256]; + proc_selfname(procname, 256); # else afs_proc_t *p = curproc; /* XXX */ + char *procname = p->p_comm; # endif -# ifndef AFS_DARWIN80_ENV - uprintf("Process %d (%s) tried to change pags in PSetTokens\n", - p->p_pid, p->p_comm); -# endif + afs_warnuser("Process %d (%s) tried to change pags in PSetTokens\n", + MyPidxx2Pid(MyPidxx), procname); setpag(p, acred, -1, &pag, 1); #else setpag(acred, -1, &pag, 1); diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c index 5b140ef..422b059 100644 --- a/src/afs/afs_pioctl.c +++ b/src/afs/afs_pioctl.c @@ -1834,14 +1834,15 @@ DECL_PIOCTL(PSetTokens) afs_uint32 pag; #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) # if defined(AFS_DARWIN_ENV) - afs_proc_t *p = current_proc(); /* XXX */ + afs_proc_t *p = current_proc(); /* XXX */ + char procname[256]; + proc_selfname(procname, 256); # else afs_proc_t *p = curproc; /* XXX */ + char *procname = p->p_comm; # endif -# ifndef AFS_DARWIN80_ENV - uprintf("Process %d (%s) tried to change pags in PSetTokens\n", - p->p_pid, p->p_comm); -# endif + afs_warnuser("Process %d (%s) tried to change pags in PSetTokens\n", + MyPidxx2Pid(MyPidxx), procname); if (!setpag(p, acred, -1, &pag, 1)) { #else if (!setpag(acred, -1, &pag, 1)) { @@ -3844,7 +3845,7 @@ afs_setsprefs(struct spref *sp, unsigned int num, unsigned int vlonly) touchedSize = 0; for (k = 0; k < num; sp++, k++) { if (debugsetsp) { - printf("sp host=%x, rank=%d\n", sp->host.s_addr, sp->rank); + afs_warn("sp host=%x, rank=%d\n", sp->host.s_addr, sp->rank); } matches = 0; ObtainReadLock(&afs_xserver); @@ -3864,7 +3865,7 @@ afs_setsprefs(struct spref *sp, unsigned int num, unsigned int vlonly) if (sa && matches) { /* found one! */ if (debugsetsp) { - printf("sa ip=%x, ip_rank=%d\n", sa->sa_ip, sa->sa_iprank); + afs_warn("sa ip=%x, ip_rank=%d\n", sa->sa_ip, sa->sa_iprank); } sa->sa_iprank = sp->rank + afs_randomMod15(); afs_SortOneServer(sa->server); @@ -5158,7 +5159,7 @@ DECL_PIOCTL(PDiscon) afs_in_sync = 0; if (code && !force) { - printf("Files not synchronized properly, still in discon state. \n" + afs_warnuser("Files not synchronized properly, still in discon state. \n" "Please retry or use \"force\".\n"); mode = 0; } else { @@ -5168,7 +5169,7 @@ DECL_PIOCTL(PDiscon) afs_ClearAllStatdFlag(); afs_is_disconnected = 0; afs_is_discon_rw = 0; - printf("\nSync succeeded. You are back online.\n"); + afs_warnuser("\nSync succeeded. You are back online.\n"); } ReleaseWriteLock(&afs_discon_lock); diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 81819e1..094564d 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -247,7 +247,7 @@ afs_FlushVCache(struct vcache *avc, int *slept) afs_stats_cmperf.vcacheXAllocs--; } else { if (afs_norefpanic) { - printf("flush vc refcnt < 1"); + afs_warn("flush vc refcnt < 1"); afs_norefpanic++; } else osi_Panic("flush vc refcnt < 1"); @@ -590,7 +590,7 @@ afs_FlushReclaimedVcaches(void) We probably need a way to be smarter about this. */ tvc->nextfree = tmpReclaimedVCList; tmpReclaimedVCList = tvc; - printf("Reclaim list flush %lx failed: %d\n", (unsigned long) tvc, code); + /* printf("Reclaim list flush %lx failed: %d\n", (unsigned long) tvc, code); */ } if (tvc->f.states & (CVInit #ifdef AFS_DARWIN80_ENV @@ -696,7 +696,7 @@ restart: break; } if (!afsd_dynamic_vcaches && anumber == target) { - printf("afs_ShakeLooseVCaches: warning none freed, using %d of %d\n", + afs_warn("afs_ShakeLooseVCaches: warning none freed, using %d of %d\n", afs_vcount, afs_maxvcount); } } /* finished freeing up space */ @@ -822,7 +822,7 @@ afs_NewVCache_int(struct VenusFid *afid, struct server *serverp, int seq) if(!afsd_dynamic_vcaches) { afs_ShakeLooseVCaches(anumber); if (afs_vcount >= afs_maxvcount) { - printf("afs_NewVCache - none freed\n"); + afs_warn("afs_NewVCache - none freed\n"); return NULL; } } @@ -1069,7 +1069,7 @@ afs_NewVCache_int(struct VenusFid *afid, struct server *serverp, int seq) * then there probably needs to be some sort of additional * mutual exclusion (an Embryonic flag would suffice). * -GAW */ - printf("afs_NewVCache: lost the race\n"); + afs_warn("afs_NewVCache: lost the race\n"); return (tvc); } tvc->v = vp; @@ -1636,13 +1636,13 @@ int afs_WriteVCacheDiscon(register struct vcache *avc, } if (astatus->Mask & AFS_SETOWNER) { - printf("Not allowed yet. \n"); - /*avc->f.m.Owner = astatus->Owner;*/ + /* printf("Not allowed yet. \n"); */ + /*avc->f.m.Owner = astatus->Owner;*/ } if (astatus->Mask & AFS_SETGROUP) { - printf("Not allowed yet. \n"); - /*avc->f.m.Group = astatus->Group;*/ + /* printf("Not allowed yet. \n"); */ + /*avc->f.m.Group = astatus->Group;*/ } if (astatus->Mask & AFS_SETMODE) { @@ -2058,7 +2058,7 @@ afs_GetVCache(register struct VenusFid *afid, struct vrequest *areq, if (AFS_IS_DISCONNECTED) { /* Nothing to do otherwise...*/ code = ENETDOWN; - printf("Network is down in afs_GetCache"); + /* printf("Network is down in afs_GetCache"); */ } else code = afs_FetchStatus(tvc, afid, areq, &OutStatus); @@ -2167,7 +2167,7 @@ afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, origCBs = afs_allCBs; /* if anything changes, we don't have a cb */ if (AFS_IS_DISCONNECTED) { - printf("Network is down in afs_LookupVcache\n"); + /* printf("Network is down in afs_LookupVcache\n"); */ code = ENETDOWN; } else code = -- 1.9.4