aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2009-06-17nfs41: destroy_session operationAndy Adamson3-0/+91
Implement the destroy_session operation conforming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove extraneous rpc_clnt pointer] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41; NFS_CS_READY required for DESTROY_SESSION] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> [nfs41: fix encode_destroy_session's xdr Xcoding pointer type] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: use session attributes for rsize and wsizeAndy Adamson1-0/+17
Set the mount points rsize and wsize to the negotiated session fore channel maximum response and requeset size. These values will be bound checked in nfs_server_set_fsinfo. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [move nfs4_session_set_rwsize into CONFIG_NFS_V4] Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: verify session channel attribuesAndy Adamson1-2/+48
Invalidate the session if the server returns invalid fore or back channel attributes. Use a KERN_WARNING to report the fatal session estabishment error. Signed-off-by: Andy Adamson <[email protected]> [refactor nfs4_verify_channel_attrs] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: create_session operationAndy Adamson2-0/+357
Implement the create_session operation conforming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 Set the real fore channel max operations to preserve server resources. Note: If the server returns < NFS4_MAX_OPS, the client will very soon get an NFS4ERR_TOO_MANY_OPS. A later patch will handle this. Set the max_rqst_sz and max_resp_sz to PAGE_SIZE - we preallocate the buffers. Set the back channel max_resp_sz_cached to zero to force the client to always set csa_cachethis to FALSE because the current implementation of the back channel DRC only supports caching the CB_SEQUENCE operation. The client back channel server supports one slot, and desires 2 operations per compound. Signed-off-by: Ricardo Labiaga <[email protected]> Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove extraneous rpc_clnt pointer] Use the struct nfs_client cl_rpcclient. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_init_channel_attrs, just use nfs41_create_session_args] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: use rsize and wsize for session channel attributes] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: set channel max operations] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: set back channel attributes] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: obliterate nfs4_adjust_channel_attrs] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: have create_session work on nfs_client] Signed-off-by: Benny Halevy <[email protected]> [nfs41: move CONFIG_NFS_V4_1 endif] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] [moved nfs4_init_slot_table definition here] Signed-off-by: Benny Halevy <[email protected]> [nfs41: use kcalloc to allocate slot table] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> [nfs41: fix Xcode_create_session's xdr Xcoding pointer type] [nfs41: refactor decoding of channel attributes] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41: get_lease_timeAndy Adamson2-0/+145
get_lease_time uses the FSINFO rpc operation to get the lease time attribute. nfs4_get_lease_time() is only called from the state manager on session setup so don't recover from clientid or sequence level errors. We do need to recover from NFS4ERR_DELAY or NFS4ERR_GRACE. Use NFS4_POLL_RETRY_MIN - the Linux server returns NFS4ERR_DELAY when an upcall is needed to resolve an uncached export referenced by a file handle. [nfs41: sequence res use slotid] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove extraneous rpc_clnt pointer] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: have get_lease_time work on nfs_client] Signed-off-by: Benny Halevy <[email protected]> [nfs41: get_lease_time recover from NFS4ERR_DELAY] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] [define nfs4_get_lease_time_{args,res}] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: exchange_id operationBenny Halevy2-0/+200
Implement the exchange_id operation conforming to http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26 Unlike NFSv4.0, NFSv4.1 requires machine credentials. RPC_AUTH_GSS machine credentials will be passed into the kernel at mount time to be available for the exchange_id operation. RPC_AUTH_UNIX root mounts can use the UNIX root credential. Store the root credential in the nfs_client struct. Without a credential, NFSv4.1 state renewal fails. [nfs41: establish clientid via exchange id only if cred != NULL] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfsd41: move nfstime4 from under CONFIG_NFS_V4_1] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: do not wait a lease time in exchange id] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]> [nfs41: Ignoring impid in decode_exchange_id is missing a READ_BUF] Signed-off-by: Benny Halevy <[email protected]> [nfs41: fix Xcode_exchange_id's xdr Xcoding pointer type] [nfs41: get rid of unused struct nfs41_exchange_id_res members] Signed-off-by: Benny Halevy <[email protected]>
2009-06-17nfs41 delegreturn sequence setup done supportAndy Adamson1-1/+23
Separate delegreturn calls from nfs41: sequence setup/done support Implement the delegreturn rpc_call_prepare method for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41 commit sequence setup done supportAndy Adamson3-0/+10
Separate commit calls from nfs41: sequence setup/done support Implement the commit rpc_call_prepare method for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Support sessions with O_DIRECT.] Signed-off-by: Dean Hildebrand <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: separate free slot from sequence done] [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41 write sequence setup done supportAndy Adamson4-0/+32
Separate write calls from nfs41: sequence setup/done support Implement the write rpc_call_prepare method for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [move the nfs4_sequence_free_slot call in nfs_readpage_retry from] [nfs41: separate free slot from sequence done Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Support sessions with O_DIRECT.] Signed-off-by: Dean Hildebrand <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: read sequence setup/done supportAndy Adamson4-2/+39
Implement the read rpc_call_prepare method for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [move the nfs4_sequence_free_slot call in nfs_readpage_retry from] [nfs41: separate free slot from sequence done] [remove nfs_readargs.nfs_server, use calldata->inode instead] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Support sessions with O_DIRECT] Signed-off-by: Dean Hildebrand <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: unlink sequence setup/done supportAndy Adamson2-0/+19
Implement the rpc_call_prepare methods for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: separate free slot from sequence done] [nfs41: sequence res use slotid] [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: locku sequence setup/done supportAndy Adamson1-1/+9
Separate nfs4_locku calls from nfs41: sequence setup/done support Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: lock sequence setup/done supportAndy Adamson1-0/+8
Separate nfs4_lock calls from nfs41: sequence setup/done support Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] [use nfs4_sequence_done_free_slot] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: open sequence setup/done supportAndy Adamson1-0/+8
Separate nfs4_open calls from nfs41: sequence setup/done support Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] [use nfs4_sequence_done_free_slot] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: close sequence setup/done supportAndy Adamson1-1/+7
Separate nfs4_close calls from nfs41: sequence setup/done support Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: separate free slot from sequence done] [nfs41: sequence res use slotid] [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs41_call_sync_doneAndy Adamson1-0/+9
Implement nfs4.1 synchronous rpc_call_done method that essentially just calls nfs4_sequence_done, that turns around and calls nfs41_sequence_done for minorversion1 rpcs. Signed-off-by: Benny Halevy <[email protected]> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [move adding nfs4_sequence_free_slot from nfs41-separate-free-slot-from-sequence-done] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs41_call_sync_data use nfs_client not nfs_server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs41_sequence_doneAndy Adamson1-0/+58
Handle session level errors, update slot sequence id and sessions bookeeping, free slot. [nfs41: sequence res use slotid] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <[email protected]> [nfs41: bail out early out of nfs41_sequence_done if !res->sr_session] Signed-off-by: Benny Halevy <[email protected]> [move nfs4_sequence_done from nfs41: nfs41_call_sync_done] Signed-off-by: Andy Adamson <[email protected]> [move nfs4_sequence_free_slot from nfs41: separate free slot from sequence done] Don't free the slot until after all rpc_restart_calls have completed. Session reset will require more work. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [moved reset sr_slotid to nfs41_sequence_free_slot] [free slot also on unexpectecd error] [remove seq_res.sr_session member, use nfs_client's instead] [ditch seq_res.sr_flags until used] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [look at sr_slotid for bailing out early from nfs41_sequence_done] [nfs41: rpc_wake_up_next if sessions slot was not consumed.] Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove unused error checking in nfs41_sequence_done] Signed-off-by: Andy Adamson <[email protected]> [nfs41: remove nfs4_has_session check in nfs41_sequence_done] Signed-off-by: Andy Adamson <[email protected]> [nfs41: remove nfs_client pointer check] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs41_sequence_free_slotAndy Adamson2-0/+35
[from nfs41: separate free slot from sequence done] Don't free the slot until after all rpc_restart_calls have completed. Session reset will require more work. As noted by Trond, since we're using rpc_wake_up_next rather than rpc_wake_up() we must always wake up the next task in the queue either by going through nfs4_free_slot, or just calling rpc_wake_up_next if no slot is to be freed. [nfs41: sequence res use slotid] [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] [got rid of nfs4_sequence_res.sr_session, use nfs_client.cl_session instead] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: rpc_wake_up_next if sessions slot was not consumed.] Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_sequence_free_slot use nfs_client for data server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: free slotAndy Adamson1-0/+36
Free a slot in the slot table. Mark the slot as free in the bitmap-based allocation table by clearing a bit corresponding to the slotid. Update lowest_free_slotid if freed slotid is lower than that. Update highest_used_slotid. In the case the freed slotid equals the highest_used_slotid, scan downwards for the next highest used slotid using the optimized fls* functions. Finally, wake up thread waiting on slot_tbl_waitq for a free slot to become available. Signed-off-by: Benny Halevy <[email protected]> [nfs41: free slot use slotid] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: use find_first_zero_bit for nfs4_find_slot] While at it, obliterate lowest_free_slotid and fix-up related comments. As per review comment 21/85. Signed-off-by: Benny Halevy <[email protected]> [nfs41: use __clear_bit for nfs4_free_slot] While at it, fix-up function comment. Part of review comment 22/85. Signed-off-by: Benny Halevy <[email protected]> [nfs41: use find_last_bit in nfs4_free_slot to determine highest used slot.] Signed-off-by: Benny Halevy <[email protected]> [nfs41: rpc_sleep_on slot_tbl_waitq must be called under slot_tbl_lock] Otherwise there's a race (we've hit) with nfs4_free_slot where nfs41_setup_sequence sees a full slot table, unlocks slot_tbl_lock, nfs4_free_slots happen concurrently and call rpc_wake_up_next where there's nobody to wake up yet, context goes back to nfs41_setup_sequence which goes to sleep when the slot table is actually empty now and there's no-one to wake it up anymore. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: setup_sequence methodAndy Adamson2-2/+42
Allocate a slot in the session slot table and set the sequence op arguments. Called at the rpc prepare stage. Add a status to nfs41_sequence_res, initialize it to one so that we catch rpc level failures which do not go through decode_sequence which sets the new status field. Note that upon an rpc level failure, we don't know if the server processed the sequence operation or not. Proceed as if the server did process the sequence operation. Signed-off-by: Rahul Iyer <[email protected]> [nfs41: sequence args use slotid] [nfs41: find slot return slotid] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove SEQ4_STATUS_USE_TK_STATUS] As per 11-14-08 review [move extern declaration from nfs41: sequence setup/done support] [removed sa_session definition, changed sa_cache_this into a u8 to reduce footprint] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: rpc_sleep_on slot_tbl_waitq must be called under slot_tbl_lock] Otherwise there's a race (we've hit) with nfs4_free_slot where nfs41_setup_sequence sees a full slot table, unlocks slot_tbl_lock, nfs4_free_slots happen concurrently and call rpc_wake_up_next where there's nobody to wake up yet, context goes back to nfs41_setup_sequence which goes to sleep when the slot table is actually empty now and there's no-one to wake it up anymore. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: find slotBenny Halevy1-0/+33
Find a free slot using bitmap-based allocation. Use the optimized ffz function to find a zero bit in the bitmap that indicates a free slot, starting the search from the 'lowest_free_slotid' position. If found, mark the slot as used in the bitmap, get the slot's slotid and seqid, and update max_slotid to be used by the SEQUENCE operation. Also, update lowest_free_slotid for next search. If no free slot was found the caller has to wait for a free slot (outside the scope of this function) Signed-off-by: Benny Halevy <[email protected]> [nfs41: find slot return slotid] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [use find_first_zero_bit for nfs4_find_slot as per review comment 21/85.] [use NFS4_MAX_SLOT_TABLE rather than NFS4_NO_SLOT] [nfs41: rpc_sleep_on slot_tbl_waitq must be called under slot_tbl_lock] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs4_setup_sequenceAndy Adamson1-2/+98
Perform the nfs4_setup_sequence in the rpc_call_prepare state. If a session slot is not available, we will rpc_sleep_on the slot wait queue leaving the tk_action as rpc_call_prepare. Once we have a session slot, hang on to it even through rpc_restart_calls. Ensure the nfs41_sequence_res sr_slot pointer is NULL before rpc_run_task is called as nfs41_setup_sequence will only find a new slot if it is NULL. A future patch will call free slot after any rpc_restart_calls, and handle the rpc restart that result from a sequence operation error. Signed-off-by: Rahul Iyer <[email protected]> [nfs41: sequence res use slotid] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: simplify nfs4_call_sync] Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_call_sync] [nfs41: check for session not minorversion] [nfs41: remove rpc_message from nfs41_call_sync_args] [moved NFS4_MAX_SLOT_TABLE logic into nfs41_setup_sequence] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs41_call_sync_data use nfs_client not nfs_server] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: expose nfs4_call_sync_session for lease renewal] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: remove unnecessary return check] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: xdr {encode,decode}_sequenceAndy Adamson1-10/+232
Implement stubs for encode and decode sequence, defined as no-ops when CONFIG_NFS_V4_1 is not defined. Add the nfsv41 encode and decode sizes. Add encode_sequence to all nfs4_enc_* routines and decode_sequence to all nfs4_dec_* routines as required by v41. [was nfs41: minorversion support for xdr] [added nfs_client argument to encode_sequence so not to use sequence_args to pass sa_session] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: encode minorversion in compound headerBenny Halevy1-30/+40
Signed-off-by: Andy Adamdon <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: pass *session in seq_args and seq_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: use dynamically computed compound_hdr.replen for xdr_inline_pages offsetBenny Halevy1-38/+10
As Trond suggested, rather than passing a constant to xdr_inline_pages, keep a running count of the expected reply bytes. In preparation for nfs41, where additional op sequence are expteced when talking to nfs41 servers. [NFS: cb_compoundhdr.replen is in words not bytes] Signed-off-by: Benny Halevy <[email protected]> [nfs41: get fs_locations replen before encoding the GETATTR] Signed-off-by: Benny Halevy <[email protected]> [nfs41: get getacl replen before encoding the GETATTR] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: update hdr->replen for every encode opBenny Halevy1-0/+31
Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: define and initialize compound_hdr.replenBenny Halevy1-34/+43
replen holds the running count of expected reply bytes. repl will then be used by encoding routines for xdr_inline_pages offset after which data bytes are to be received directly into the xdr buffer pages. NOTE: According to the nfsv4 and v4.1 RFCs, the replied tag SHOULD be the same is the one sent, but this is not required as a MUST for the server to do so. The server may screw us if it replies a tag of a different length in the compound result. [NFS: cb_compoundhdr.replen is in words not bytes] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: use decode_change_info_maxsz for xdr maxsz calculationsBenny Halevy1-3/+7
Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: set up seq_res.sr_slotidAndy Adamson4-0/+9
Initialize nfs4_sequence_res sr_slotid to NFS4_MAX_SLOT_TABLE. [was nfs41: sequence res use slotid] Signed-off-by: Andy Adamson <[email protected]> [pulled definition of struct nfs4_sequence_res.sr_slotid to here] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs41: pass *session in seq_args and seq_resBenny Halevy1-0/+1
To be used for getting the rpc's minorversion and for nfs41 xdr {en,de}coding of the sequence operation. Reset the seq session ptrs for minorversion=0 rpc calls. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: introduce nfs4_call_syncAndy Adamson3-19/+65
Use nfs4_call_sync rather than rpc_call_sync to provide for a nfs41 sessions-enabled interface for sessions manipulation. The nfs41 rpc logic uses the rpc_call_prepare method to recover and create the session, as well as selecting a free slot id and the rpc_call_done to free the slot and update slot table related metadata. In the coming patches we'll add rpc prepare and done routines for setting up the sequence op and processing the sequence result. Signed-off-by: Benny Halevy <[email protected]> [nfs41: nfs4_call_sync] As per 11-14-08 review. Squash into "nfs41: introduce nfs4_call_sync" and "nfs41: nfs4_setup_sequence" Define two functions one for v4 and one for v41 add a pointer to struct nfs4_client to the correct one. Signed-off-by: Andy Adamson <[email protected]> [added BUG() in _nfs4_call_sync_session if !CONFIG_NFS_V4_1] Signed-off-by: Benny Halevy <[email protected]> [nfs41: check for session not minorversion] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [group minorversion specific stuff together] Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Andy Adamson <[email protected]> [nfs41: fixup nfs4_clear_client_minor_version] [introduce nfs4_init_client_minor_version() in this patch] Signed-off-by: Benny Halevy <[email protected]> [cleaned-up patch: got rid of nfs_call_sync_t, dprintks, cosmetics, extra server defs] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_fs_locations_resBenny Halevy2-3/+8
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [find nfs4_fs_locations_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_setaclresBenny Halevy2-2/+4
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs_setaclres] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17NFS: get rid of unused xdr decode_setattr(, res) argumentBenny Halevy1-3/+3
Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_getaclresBenny Halevy2-11/+14
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: embed resp_len in nfs_getaclres] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_pathconf_resBenny Halevy2-3/+7
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs4_pathconf_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_fsinfo_resBenny Halevy2-3/+7
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs4_fsinfo_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_statfs_resBenny Halevy2-3/+7
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs4_statfs_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_readlink_resBenny Halevy2-2/+4
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs4_readlink_res] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: use nfs4_server_caps_argBenny Halevy2-3/+7
In preparation for nfs41 sequence processing. Signed-off-by: Andy Admason <[email protected]> [define nfs4_server_caps_arg] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: sessions client infrastructureAndy Adamson4-0/+110
NFSv4.1 Sessions basic data types, initialization, and destruction. The session is always associated with a struct nfs_client that holds the exchange_id results. Signed-off-by: Rahul Iyer <[email protected]> Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [remove extraneous rpc_clnt pointer, use the struct nfs_client cl_rpcclient. remove the rpc_clnt parameter from nfs4 nfs4_init_session] Signed-off-by: Andy Adamson<[email protected]> Signed-off-by: Benny Halevy <[email protected]> [Use the presence of a session to determine behaviour instead of the minorversion number.] Signed-off-by: Andy Adamson <[email protected]> [constified nfs4_has_session's struct nfs_client parameter] Signed-off-by: Benny Halevy <[email protected]> [Rename nfs4_put_session() to nfs4_destroy_session() and call it from nfs4_free_client() not nfs4_free_server(). Also get rid of nfs4_get_session() and the ref_count in nfs4_session struct as keeping track of nfs_client should be sufficient] Signed-off-by: Alexandros Batsakis <[email protected]> [nfs41: pass rsize and wsize into nfs4_init_session] Signed-off-by: Andy Adamson <[email protected]> [separated out removal of rpc_clnt parameter from nfs4_init_session ot a patch of its own] Signed-off-by: Benny Halevy <[email protected]> [Pass the nfs_client pointer into nfs4_alloc_session] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: don't assign to session->clp->cl_session in nfs4_destroy_session] [nfs41: fixup nfs4_clear_client_minor_version] [introduce nfs4_clear_client_minor_version() in this patch] Signed-off-by: Benny Halevy <[email protected]> [Refactor nfs4_init_session] Moved session allocation into nfs4_init_client_minor_version, called from nfs4_init_client. Leave rwise and wsize initialization in nfs4_init_session, called from nfs4_init_server. Reverted moving of nfs_fsid definition to nfs_fs_sb.h Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [nfs41: Move NFS4_MAX_SLOT_TABLE define from under CONFIG_NFS_V4_1] [Fix comile error when CONFIG_NFS_V4_1 is not set.] Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: Benny Halevy <[email protected]> [moved nfs4_init_slot_table definition to "create_session operation"] Signed-off-by: Benny Halevy <[email protected]> [nfs41: alloc session with GFP_KERNEL] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: translate NFS4ERR_MINOR_VERS_MISMATCH to EPROTONOSUPPORTBenny Halevy1-0/+2
To be returned to the mount command when trying to mount a v4 server using minorversion 1. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: Use mount minorversion optionBenny Halevy1-1/+6
Use the mount minorversion option to initialize the nfs_client cl_minorversion and match it in nfs_match_client() when looking up a nfs_client. [nfs41: remove ifdefs around nfs_client_initdata.minorversion] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: nfs_client.cl_minorversionBenny Halevy1-3/+6
This field is set to the nfsv4 minor version for this mount. Signed-off-by: Benny Halevy <[email protected]> Note: This patch sets the referral to the same minorversion as the current mount. Revisit in future patch. Signed-off-by: Andy Adamson <[email protected]> [removed cl_minorversion assignment in nfs_set_client] Signed-off-by: Benny Halevy <[email protected]> [always define nfs_client.cl_minorversion] Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: add mount command option minorversionMike Sager2-0/+11
mount -t nfs4 -o minorversion=[0|1] specifies whether to use 4.0 or 4.1. By default, the minorversion is set to 0. Signed-off-by: Mike Sager <[email protected]> [set default minorversion to 0 as per Trond and SteveD's request] Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17nfs41: Add Kconfig symbols for NFSv4.1Ricardo Labiaga1-0/+9
Added CONFIG_NFS_V4_1 and made it depend upon CONFIG_NFS_V4 and EXPERIMENTAL. Indicate that CONFIG_NFS_V4_1 is for NFS developers at the moment At the moment we're expecting folks trying out nfs41 to actively participate in the development process by helping us debug issues and ideally send patches to fix problems. Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2009-06-17Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds1-6/+0
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: [SCSI] aic79xx: make driver respect nvram for IU and QAS settings [SCSI] don't attach ULD to Dell Universal Xport [SCSI] lpfc 8.3.3 : Update driver version to 8.3.3 [SCSI] lpfc 8.3.3 : Add support for Target Reset handler entrypoint [SCSI] lpfc 8.3.3 : Fix a couple of spin_lock and memory issues and a crash [SCSI] lpfc 8.3.3 : FC/FCOE discovery fixes [SCSI] lpfc 8.3.3 : Fix various SLI-3 vs SLI-4 differences [SCSI] qla2xxx: Resolve a performance issue in interrupt [SCSI] cnic, bnx2i: Fix build failure when CONFIG_PCI is not set. [SCSI] nsp_cs: time_out reaches -1 [SCSI] qla2xxx: fix printk format warnings [SCSI] ncr53c8xx: div reaches -1 [SCSI] compat: don't perform unneeded copy in sg_io code [SCSI] zfcp: Update FC pass-through support [SCSI] zfcp: Add FC pass-through support [SCSI] FC Pass Thru support
2009-06-17Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6Linus Torvalds6-72/+102
* 'linux-next' of git://git.infradead.org/ubifs-2.6: UBIFS: start using hrtimers hrtimer: export ktime_add_safe UBIFS: do not forget to register BDI device UBIFS: allow sync option in rootflags UBIFS: remove dead code UBIFS: use anonymous device UBIFS: return proper error code if the compr is not present UBIFS: return error if link and unlink race UBIFS: reset no_space flag after inode deletion
2009-06-17Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linusLinus Torvalds1-1/+1
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (47 commits) MIPS: Add hibernation support MIPS: Move Cavium CP0 hwrena impl bits to cpu-feature-overrides.h MIPS: Allow CPU specific overriding of CP0 hwrena impl bits. MIPS: Kconfig Add SYS_SUPPORTS_HUGETLBFS and enable it for some systems. Hugetlbfs: Enable hugetlbfs for more systems in Kconfig. MIPS: TLB support for hugetlbfs. MIPS: Add hugetlbfs page defines. MIPS: Add support files for hugetlbfs. MIPS: Remove unused parameters from iPTE_LW. Staging: Add octeon-ethernet driver files. MIPS: Export erratum function needed by octeon-ethernet driver. MIPS: Cavium-Octeon: Add more chip specific feature tests. MIPS: Cavium-Octeon: Add more board type constants. MIPS: Export cvmx_sysinfo_get needed by octeon-ethernet driver. MIPS: Add named alloc functions to OCTEON boot monitor memory allocator. MIPS: Alchemy: devboards: Convert to gpio calls. MIPS: Alchemy: xxs1500: use linux gpio api. MIPS: Alchemy: MTX-1: Use linux gpio api. MIPS: Alchemy: Rewrite GPIO support. MIPS: Alchemy: Remove unused au1000_gpio.h header ...
2009-06-17Merge branch 'for-linus' of ↵Linus Torvalds23-143/+94
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: get rid of BKL in fs/sysv get rid of BKL in fs/minix get rid of BKL in fs/efs befs ->pust_super() doesn't need BKL Cleanup of adfs headers 9P doesn't need BKL in ->umount_begin() fuse doesn't need BKL in ->umount_begin() No instance of ->bmap() needs BKL remove unlock_kernel() left accidentally ext4: avoid unnecessary spinlock in critical POSIX ACL path ext3: avoid unnecessary spinlock in critical POSIX ACL path