diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-12-03 02:27:26 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-12-03 02:27:26 +0000 |
commit | ec04bcd39d758acbc7e7de9b331c847bfbe6b8c5 (patch) | |
tree | 290697be20f4ccdfbfcdddbdc5806b87bf4a7a5a /sys/fs/nfs/nfsclstate.h | |
parent | c1dda66820c6e6eccf0746ee8557255b2cf4ab80 (diff) | |
download | FreeBSD-src-ec04bcd39d758acbc7e7de9b331c847bfbe6b8c5.zip FreeBSD-src-ec04bcd39d758acbc7e7de9b331c847bfbe6b8c5.tar.gz |
Post r223774, the NFSv4 client no longer has multiple instances
of the same lock_owner4 string. As such, the handling of cleanup
of lock_owners could be simplified. This simplification permitted
the client to do a ReleaseLockOwner operation when the process that
the lock_owner4 string represents, has exited. This permits the
server to release any storage related to the lock_owner4 string
before the associated open is closed. Without this change, it
is possible to exhaust a server's storage when a long running
process opens a file and then many child processes do locking
on the file, because the open doesn't get closed. A similar patch
was applied to the Linux NFSv4 client recently so that it wouldn't
exhaust a server's storage.
Reviewed by: zack
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfs/nfsclstate.h')
-rw-r--r-- | sys/fs/nfs/nfsclstate.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/fs/nfs/nfsclstate.h b/sys/fs/nfs/nfsclstate.h index 006ef3f..868e7cf 100644 --- a/sys/fs/nfs/nfsclstate.h +++ b/sys/fs/nfs/nfsclstate.h @@ -34,6 +34,7 @@ */ LIST_HEAD(nfsclopenhead, nfsclopen); LIST_HEAD(nfscllockownerhead, nfscllockowner); +SLIST_HEAD(nfscllockownerfhhead, nfscllockownerfh); LIST_HEAD(nfscllockhead, nfscllock); LIST_HEAD(nfsclhead, nfsclclient); LIST_HEAD(nfsclownerhead, nfsclowner); @@ -149,8 +150,8 @@ struct nfscllockowner { struct nfsclopen *nfsl_open; NFSPROC_T *nfsl_inprog; nfsv4stateid_t nfsl_stateid; + int nfsl_lockflags; u_int32_t nfsl_seqid; - u_int32_t nfsl_defunct; struct nfsv4lock nfsl_rwlock; u_int8_t nfsl_owner[NFSV4CL_LOCKNAMELEN]; u_int8_t nfsl_openowner[NFSV4CL_LOCKNAMELEN]; @@ -166,6 +167,14 @@ struct nfscllock { short nfslo_type; }; +/* This structure is used to collect a list of lockowners to free up. */ +struct nfscllockownerfh { + SLIST_ENTRY(nfscllockownerfh) nfslfh_list; + struct nfscllockownerhead nfslfh_lock; + int nfslfh_len; + uint8_t nfslfh_fh[NFSX_V4FHMAX]; +}; + /* * Macro for incrementing the seqid#. */ |