Commit graph

13 commits

Author SHA1 Message Date
Olga Kornievskaia
e7c540464b simplifying argument management in io path 2011-08-25 14:08:45 -04:00
Olga Kornievskaia
32422a9d7f [cosmetic] formatting changes to readwrite.c 2011-08-24 18:14:02 -04:00
Olga Kornievskaia
04ab888492 [cosmetic] minor license changes
added 2011 year to the copyright line
added authors info to the license
added UofM license to libtirpc files that we modified
(but i probably missed some)
2011-08-12 13:20:12 -04:00
Casey Bodley
ee71a62af2 deleg: make use of delegation stateids
combined nfs41_lock_stateid_arg() into nfs41_open_stateid_arg().  if a delegation is present, use the delegation stateid before looking at lock/open stateids.  if a delegation recall is in progress, wait on its condition variable before falling back to the open stateid

made nfs41_lock_stateid_arg() static to lock.c because of its special semantics; open_to_lock_owner4 for LOCK won't accept a delegation stateid, so nfs41_delegation_to_open() is called to convert it

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-07-18 15:24:22 -04:00
Olga Kornievskaia
529d7ce6db moving session and open_state in upcall header
every upcall (except few) pass session and open_state pointer, so
add that to marshal_nfs41_header() in the driver. remove passing
of session and open_state elsewhere in marshal functions.

in the deamon, upcall.c now reads and stores pointers to session
and open_state in nfs41_upcall datastructure instead of having
each individual upcall store their own pointers. setattrl
and readdir args keeping pointer because the rest of the code
uses them a lot.

in upcall_parse() up refcounts on session and open_state if
valid handles were passed in. down refcounts upcall_cleanup() as
before. but need to be careful with count value for mount and open
upcalls. we need to take an extra ref because upcall_cleanup() now
will always decrement it.
2011-04-13 20:07:37 -04:00
Casey Bodley
c9585d937f pnfs: readwrite uses pnfs_layout_state
nfs41_lock_stateid_arg() is now called only once in handle_read()/handle_write(), and pnfs_read()/pnfs_write() no longer depend on nfs41_open_state

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2011-03-22 14:49:24 -04: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
bcc707d3b8 ref counting for nfs41_root
very similar to the issue with nfs41_open_state, an abandoned upcall could outlive its mount. to prevent their nfs41_root from being freed, upcalls need to hold a reference until they're finished. this also keeps all of its clients/sessions/rpc connections alive

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 16:18:23 -04:00
Olga Kornievskaia
006bdfa47a ref counting for nfs41_open_state 2010-10-27 16:18:12 -04:00
Casey Bodley
ae4c67c21e upcall: added upcall_cleanup() to interface
added call to upcall_cleanup() after both upcall_marshall() and upcall_cancel()
individual upcall operations define their nfs41_upcall_op structs locally, instead of putting tons of function prototypes in upcall.c
made the upcall_marshall() function optional; most marshall functions are noops

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-27 16:16:17 -04:00
Casey Bodley
95361423f3 upcall: set upcall.status on parse failure
when open parsing fails, we were still returning upcall.status==NO_ERROR, so the driver assumed the open succeeded.  other operations then sent up an open_state==NULL, and crashed the daemon.  when upcall_parse() returns an error, set upcall.status to notify the driver

upcall_parse() prints a 'parsing of upcall <name> failed with <error>.' message on failure, so i removed redundant messages from the individual upcall parsing functions

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
2010-10-12 10:36:08 -04:00
Casey Bodley
04047a9b53 handling NFS4ERR_OPENMODE on read
if read fails with NFS4ERR_OPENMODE, retry th read with a special stateid.
2010-10-12 10:36:01 -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