pnfs: store a list of layout segments

pnfs_layout_state now stores a list instead of a single pnfs_file_layout entry.  when new segments are acquired through LAYOUTGET, they are inserted into the list in order of increasing offset

functions related to pnfs_layout_state_prepare() now operate on the list to find missing layout ranges and segments missing devices

pattern_init() in pnfs_io.c now allocates and initializes io threads for each layout segment in the range

new function pattern_join() will call WaitForMultipleObjects() in a loop, to support io patterns with more than 64 threads.  if pattern_fork() is called with a thread count of 1, the thread function is called directly instead of spawning a new thread

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2012-01-30 13:40:31 -05:00 committed by unknown
parent 62ed5248bf
commit 5cc317e8a5
4 changed files with 290 additions and 170 deletions

View file

@ -84,11 +84,6 @@ enum pnfs_iomode {
};
enum pnfs_layout_status {
/* LAYOUTGET was successful, and the layout has not been returned or
* otherwise revoked by the server */
PNFS_LAYOUT_GRANTED = 0x01,
/* GETDEVICEINFO was successful, and we have a valid 'device' pointer */
PNFS_LAYOUT_HAS_DEVICE = 0x02,
/* CB_LAYOUTRECALL indicated that the server has recalled this layout,
* and it should be returned on completion of any pending io */
PNFS_LAYOUT_RECALLED = 0x04,
@ -162,7 +157,7 @@ typedef struct __pnfs_layout_state {
nfs41_fh meta_fh;
stateid4 stateid;
struct list_entry entry; /* position in nfs41_client.layouts */
struct __pnfs_file_layout *layout;
struct list_entry layouts; /* list of pnfs_file_layouts */
enum pnfs_layout_status status;
bool_t return_on_close;
LONG open_count; /* for return on last close */
@ -245,7 +240,7 @@ enum pnfs_status pnfs_file_layout_recall(
IN const struct cb_layoutrecall_args *recall);
/* expects caller to hold an exclusive lock on pnfs_layout_state */
enum pnfs_status pnfs_layout_io_start(
void pnfs_layout_io_start(
IN pnfs_layout_state *state);
void pnfs_layout_io_finished(