ihandle: OPEN fdPs are not counted in ihP refcount
authorAndrew Deason <adeason@sinenomine.net>
Mon, 29 Aug 2011 18:07:01 +0000 (13:07 -0500)
committerDerrick Brashear <shadow@dementix.org>
Mon, 5 Sep 2011 13:06:16 +0000 (06:06 -0700)
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.

Change-Id: I73210e0d05869827ba99d09f504052d1a6797669
Reviewed-on: http://gerrit.openafs.org/5317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/vol/ihandle.c

index 8c0e83b..f2e928d 100644 (file)
@@ -794,6 +794,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);