afsd: decprecate -mem_alloc_sleep flag (and related code)
authorChas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Thu, 7 Jan 2010 23:07:43 +0000 (18:07 -0500)
committerDerrick Brashear <shadow|account-1000005@unknown>
Thu, 14 Jan 2010 15:13:24 +0000 (07:13 -0800)
On most platforms, afs_osi_Alloc_NoSleep() is already afs_osi_Alloc().
I have tested this on Solaris (the major exception) and haven't seen
any problems.

Change-Id: I0e8bfd76b2bd25889c1491633a3a6d50aceac510
Reviewed-on: http://gerrit.openafs.org/1079
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_memcache.c
src/afsd/afsd.c
src/config/afs_args.h

index 8853fa4..65fc2bd 100644 (file)
@@ -22,7 +22,6 @@
 static struct memCacheEntry *memCache;
 static int memCacheBlkSize = 8192;
 static int memMaxBlkNumber = 0;
-static int memAllocMaySleep = 0;
 
 extern int cacheDiskType;
 
@@ -38,20 +37,13 @@ afs_InitMemCache(int blkCount, int blkSize, int flags)
     memMaxBlkNumber = blkCount;
     memCache = (struct memCacheEntry *)
        afs_osi_Alloc(memMaxBlkNumber * sizeof(struct memCacheEntry));
-    if (flags & AFSCALL_INIT_MEMCACHE_SLEEP) {
-       memAllocMaySleep = 1;
-    }
 
     for (index = 0; index < memMaxBlkNumber; index++) {
        char *blk;
        (memCache + index)->size = 0;
        (memCache + index)->dataSize = memCacheBlkSize;
        LOCK_INIT(&((memCache + index)->afs_memLock), "afs_memLock");
-       if (memAllocMaySleep) {
-           blk = afs_osi_Alloc(memCacheBlkSize);
-       } else {
-           blk = afs_osi_Alloc_NoSleep(memCacheBlkSize);
-       }
+       blk = afs_osi_Alloc(memCacheBlkSize);
        if (blk == NULL)
            goto nomem;
        (memCache + index)->data = blk;
@@ -188,11 +180,7 @@ afs_MemWriteBlk(register struct osi_file *fP, int offset, void *src,
     if (size + offset > mceP->dataSize) {
        char *oldData = mceP->data;
 
-       if (memAllocMaySleep) {
-           mceP->data = afs_osi_Alloc(size + offset);
-       } else {
-           mceP->data = afs_osi_Alloc_NoSleep(size + offset);
-       }
+       mceP->data = afs_osi_Alloc(size + offset);
        if (mceP->data == NULL) {       /* no available memory */
            mceP->data = oldData;       /* revert back change that was made */
            ReleaseWriteLock(&mceP->afs_memLock);
index 268a657..adc6bec 100644 (file)
@@ -1666,7 +1666,7 @@ mainproc(struct cmd_syndesc *as, void *arock)
     }
     if (as->parms[23].items) {
        /* -mem_alloc_sleep */
-       cacheFlags |= AFSCALL_INIT_MEMCACHE_SLEEP;
+       printf("afsd: -mem_alloc_sleep is deprecated -- ignored\n");
     }
     if (as->parms[24].items) {
        /* -afsdb */
index 2bd77ef..9036861 100644 (file)
@@ -99,8 +99,6 @@
 /* these are for initialization flags */
 
 #define AFSCALL_INIT_MEMCACHE 0x1
-#define AFSCALL_INIT_MEMCACHE_SLEEP 0x2        /* Use osi_Alloc to allocate memcache
-                                        * instead of osi_Alloc_NoSleep */
 
 /* flags for rxstats pioctl */