adding a lease-based timeout to upcalls

adding -o timeout=value (in sec) mount option to override a default
timeout value for the upcalls for non-io upcalls. Default timeout is
at least the lease_time seconds of an established mount or 20secs.

read/write upcall also take into account number of bytes for the request
and 100MB/s network speed and 100MB/s disk speed
This commit is contained in:
Olga Kornievskaia 2012-03-05 17:49:52 -05:00
parent b2f5d3c7a7
commit f71623bc02
3 changed files with 132 additions and 146 deletions

View file

@ -109,6 +109,7 @@ static int handle_mount(nfs41_upcall *upcall)
upcall->root_ref = root;
nfs41_root_ref(upcall->root_ref);
args->lease_time = client->session->lease_time;
out:
return status;
@ -119,12 +120,15 @@ out_err:
static int marshall_mount(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
{
mount_upcall_args *args = &upcall->args.mount;
int status;
dprintf(2, "NFS41_MOUNT: writing pointer to nfs41_root %p and version %d\n",
upcall->root_ref, NFS41D_VERSION);
dprintf(2, "NFS41_MOUNT: writing pointer to nfs41_root %p, version %d, "
"lease_time %d\n", upcall->root_ref, NFS41D_VERSION, args->lease_time);
status = safe_write(&buffer, length, &upcall->root_ref, sizeof(HANDLE));
if (status) goto out;
status = safe_write(&buffer, length, &NFS41D_VERSION, sizeof(DWORD));
if (status) goto out;
status = safe_write(&buffer, length, &args->lease_time, sizeof(DWORD));
out:
return status;
}