Commit graph

9 commits

Author SHA1 Message Date
Casey Bodley
8c3da98cde pnfs: update layout state on layoutget/return/recall
on a successful LAYOUTGET, file_layout_fetch() calls layout_update() to copy the first layout segment returned and update the layout stateid
on a successful LAYOUTRETURN, file_layout_return() frees the layout segment and updates/clears the stateid

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-03-22 14:49:24 -04:00
Casey Bodley
248c14b6ae pnfs: struct pnfs_layout_state to manage layout state
moved state data (stateid, flags, locks, and reference counts) out of struct pnfs_layout, which should represent a layout segment returned by LAYOUTGET
struct pnfs_layout_state now holds this state, along with a pointer to a single pnfs_file_layout
struct pnfs_file_layout_list is now a list of pnfs_layout_states, and was renamed to pnfs_layout_list

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-03-22 14:49:22 -04:00
Casey Bodley
d7e438be5e 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>
2011-03-08 11:04:43 -05:00
Casey Bodley
9cd9744567 pnfs: revoke device info on bulk layout recall
20.3. CB_LAYOUTRECALL
"LAYOUTRECALL4_FSID and LAYOUTRECALL4_ALL specify that all the storage device ID to storage device address mappings in the affected file system(s) are also recalled."

pnfs_file_layout_recall() now takes a nfs41_client instead of just the pnfs_file_layout_list, because both the layout list and device list are accessible from nfs41_client.  for bulk recalls, calls new function pnfs_file_device_list_invalidate().  each device with layout_count=0 is removed and freed, and devices in use are flagged as REVOKED and freed when layout_count->0

layout_recall_return() now takes a pnfs_file_layout instead of pnfs_layout for access to pnfs_file_layout.device.  pnfs_layout_io_start() and pnfs_layout_io_finish() do the same, because pnfs_layout_io_finish() calls layout_recall_return().  layout_recall_return() calls pnfs_file_device_put() to release its reference on the device

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-01-04 14:26:26 -05:00
Casey Bodley
e3119c281e pnfs: added status flags and ref count to struct pnfs_device
pnfs_device.status remembers whether a given device has been GRANTED/REVOKED

pnfs_device.layout_count tracks the number of layouts using the device, incremented by pnfs_file_device_get() and decremented by pnfs_file_device_put().  when pnfs_file_device_put() takes layout_count to 0, remove and free the device only if it's flagged as REVOKED

because pnfs_file_device_get() modifies pnfs_device.layout_count, we can no longer use a shared lock; changed pnfs_file_device.lock from SRWLOCK to CRITICAL_SECTION, and moved to pnfs_device.lock to document the fact that it's used for pnfs_device.status and pnfs_device.layout_count

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-01-04 14:26:23 -05:00
Casey Bodley
3ecd38e414 recovery: operations take stateid_arg instead of stateid4
operations that require a stateid now take stateid_arg for recovery information.  these operations include close, setattr, lock/unlock, layoutget, and read/write (including pnfs)

nfs41_open_stateid_arg() locks nfs41_open_state and copies its stateid into a stateid_arg
nfs41_lock_stateid_arg() locks nfs41_open_state.last_lock and copies its stateid into a stateid_arg; if there is no lock state, it falls back to nfs41_open_stateid_arg()

pnfs_read/write() now take nfs41_open_state so they can generate stateid_args

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-12-06 14:21:28 -05:00
Casey Bodley
f8885dbad0 warnings from WDK 6000
fixed a few cases of warning 4242: possible loss of data

wincrypt.h appears to come with windows.h in later versions of the ddk, but nfs41_client.c fails to compile in WDK 6001 without #include <wincrypt.h>

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-19 11:17:29 -04:00
Casey Bodley
e4b1bc6ccc pnfs: set stateid.seqid to 0 for data server io
Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 12:11:27 -04:00
Casey Bodley
0ad4db4fad fresh git tree for public release
we regretfully had to remove our git history for licensing reasons

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:15:48 -04:00