From 05f3dcdbbfc8abf3eda113b940072d6667d223d3 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 29 Aug 2011 13:07:01 -0500 Subject: [PATCH] ihandle: OPEN fdPs are not counted in ihP refcount Just add a comment explaining that an OPEN FdHandle_t does not count against the ref count for its parent IHandle_t. Recently I've seen some confusion about this when discussing ihandle internals, and this should make this abundantly clear. Reviewed-on: http://gerrit.openafs.org/5317 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 0f4dfaed6b25ae4282298cc2ba4908ce9f36f043) Change-Id: Icd0d5b368ccc679967e14b2460f47c814598c797 Reviewed-on: http://gerrit.openafs.org/6310 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/vol/ihandle.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vol/ihandle.c b/src/vol/ihandle.c index 675abe484..756024b40 100644 --- a/src/vol/ihandle.c +++ b/src/vol/ihandle.c @@ -814,6 +814,10 @@ ih_fdclose(IHandle_t * ihP) || fdP->fd_status == FD_HANDLE_INUSE || fdP->fd_status == FD_HANDLE_CLOSING); if (fdP->fd_status == FD_HANDLE_OPEN) { + /* Note that FdHandle_t's do not count against the parent + * IHandle_t ref count when they are FD_HANDLE_OPEN. So, we don't + * need to dec the parent IHandle_t ref count for each one we pull + * off here. */ DLL_DELETE(fdP, ihP->ih_fdhead, ihP->ih_fdtail, fd_ihnext, fd_ihprev); DLL_DELETE(fdP, fdLruHead, fdLruTail, fd_next, fd_prev); -- 2.39.5