diff options
| author | Trond Myklebust <trond.myklebust@fys.uio.no> | 2004-08-23 00:13:51 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-23 00:13:51 -0700 |
| commit | ab77ca160c7b1f87c30cf54a2cbcbb7dc5da8eea (patch) | |
| tree | a2ab20e2421ef6b3192d8ec482fab0a8c0b55dbb /include/linux/lockd | |
| parent | 7a25aba8f51266c4c8dbacb533530ea90a3a5d12 (diff) | |
[PATCH] Fix posix file locking (5/9)
NLM: file_lock->fl_owner may live for longer than the pid of the
original process that created it. Fix NFSv2/v3 client locking code
to map file_lock->fl_owner into a unique 32-bit number or
"pseudo-pid".
Signed-off-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/lockd')
| -rw-r--r-- | include/linux/lockd/lockd.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index dde5d0c10426..5a173a673fc9 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -52,10 +52,25 @@ struct nlm_host { wait_queue_head_t h_gracewait; /* wait while reclaiming */ u32 h_state; /* pseudo-state counter */ u32 h_nsmstate; /* true remote NSM state */ - unsigned int h_count; /* reference count */ + u32 h_pidcount; /* Pseudopids */ + atomic_t h_count; /* reference count */ struct semaphore h_sema; /* mutex for pmap binding */ unsigned long h_nextrebind; /* next portmap call */ unsigned long h_expires; /* eligible for GC */ + struct list_head h_lockowners; /* Lockowners for the client */ + spinlock_t h_lock; +}; + +/* + * Map an fl_owner_t into a unique 32-bit "pid" + */ +struct nlm_lockowner { + struct list_head list; + atomic_t count; + + struct nlm_host *host; + fl_owner_t owner; + uint32_t pid; }; /* |
