From fa86aee76a3bf73d20771c24a3448b04cb6db932 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 25 Mar 2011 15:44:57 -0500 Subject: [PATCH] Revert "ihandle: Ensure FDH_REALLYCLOSE really closes" This reverts commit a50f4c8d802c7b1c258a9cbe388dfab50425596b. The only difference between FDH_CLOSE and FDH_REALLYCLOSE has to do with ihandle cache behavior. FDH_REALLYCLOSE just indicates that the reference we are closing is not likely to be used by other code, and should be kicked out of the cache immediately (thus closing the file descriptor). So, if there is another reference to that FdHandle_t, and it issues an FDH_CLOSE, it thinks that the reference is likely to be used again soon, and so the handle should not be kicked out of the cache. Thus, the behavior before a50f4c8d was already correct. Change-Id: I5a5c0c18b459f50e16c1d901ecc5f4eb18e8ef62 Reviewed-on: http://gerrit.openafs.org/4343 Reviewed-by: Jeffrey Altman Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/vol/ihandle.c | 11 +---------- src/vol/ihandle.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index d3b568c65..d109ee333 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -295,7 +295,6 @@ fdHandleAllocateChunk(void) fdP[i].fd_fd = INVALID_FD; fdP[i].fd_ihnext = NULL; fdP[i].fd_ihprev = NULL; - fdP[i].fd_needs_rclose = 0; DLL_INSERT_TAIL(&fdP[i], fdAvailHead, fdAvailTail, fd_next, fd_prev); } } @@ -387,7 +386,6 @@ ih_open_retry: fdP->fd_status = FD_HANDLE_AVAIL; fdP->fd_ih = NULL; fdP->fd_fd = INVALID_FD; - fdP->fd_needs_rclose = 0; IH_UNLOCK; OS_CLOSE(closeFd); goto ih_open_retry; @@ -405,7 +403,6 @@ ih_open_retry: fdP->fd_status = FD_HANDLE_INUSE; fdP->fd_fd = fd; fdP->fd_ih = ihP; - fdP->fd_needs_rclose = 0; fdP->fd_refcnt++; ihP->ih_refcnt++; @@ -448,9 +445,7 @@ fd_close(FdHandle_t * fdP) * failed (this is determined by checking the ihandle for the flag * IH_REALLY_CLOSED) or we have too many open files. */ - if (ihP->ih_flags & IH_REALLY_CLOSED || fdInUseCount > fdCacheSize || - fdP->fd_needs_rclose) { - + if (ihP->ih_flags & IH_REALLY_CLOSED || fdInUseCount > fdCacheSize) { IH_UNLOCK; return fd_reallyclose(fdP); } @@ -506,9 +501,6 @@ fd_reallyclose(FdHandle_t * fdP) fdP->fd_refcnt = 0; fdP->fd_ih = NULL; fdP->fd_fd = INVALID_FD; - fdP->fd_needs_rclose = 0; - } else { - fdP->fd_needs_rclose = 1; } /* All the file descriptor handles have been closed; reset @@ -836,7 +828,6 @@ ih_fdclose(IHandle_t * ihP) fdP->fd_refcnt = 0; fdP->fd_fd = INVALID_FD; fdP->fd_ih = NULL; - fdP->fd_needs_rclose = 0; closeCount++; } diff --git a/src/vol/ihandle.h b/src/vol/ihandle.h index 44b163be4..08e2d8bf5 100644 --- a/src/vol/ihandle.h +++ b/src/vol/ihandle.h @@ -159,7 +159,6 @@ typedef int FD_t; typedef struct FdHandle_s { int fd_status; /* status flags */ int fd_refcnt; /* refcnt */ - int fd_needs_rclose; /* do we need to fd_reallyclose? */ FD_t fd_fd; /* file descriptor */ struct IHandle_s *fd_ih; /* Pointer to Inode handle */ struct FdHandle_s *fd_next; /* LRU/Avail list pointers */ -- 2.39.5