pnfs: only return-on-close for last close

added pnfs_layout.open_count to count open references, and only return the layout when pnfs_open_state_close() takes the open_count to 0

use InterlockedIncrement/Decrement to avoid an exclusive lock on the layout

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-02-21 16:53:08 -08:00 committed by unknown
parent 83ab0b3f86
commit d7e438be5e
2 changed files with 10 additions and 6 deletions

View file

@ -163,6 +163,7 @@ typedef struct __pnfs_layout {
enum pnfs_iomode iomode;
enum pnfs_layout_status status;
bool_t return_on_close;
LONG open_count; /* for return on last close */
uint32_t io_count; /* number of pending io operations */
SRWLOCK lock;
} pnfs_layout;