commit
382905495f
|
@ -4983,10 +4983,14 @@ nfs3_chdir_continue_internal(struct nfs_context *nfs,
|
|||
struct nfs_cb_data *data)
|
||||
{
|
||||
/* steal saved_path */
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_lock(&nfs->rpc->rpc_mutex);
|
||||
#endif
|
||||
free(nfs->nfsi->cwd);
|
||||
nfs->nfsi->cwd = data->saved_path;
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_unlock(&nfs->rpc->rpc_mutex);
|
||||
#endif
|
||||
|
||||
data->saved_path = NULL;
|
||||
|
||||
|
|
10
lib/nfs_v4.c
10
lib/nfs_v4.c
|
@ -643,6 +643,7 @@ nfs4_op_commit(struct nfs_context *nfs, nfs_argop4 *op)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
static int
|
||||
nfs4_op_release_lockowner(struct nfs_context *nfs, nfs_argop4 *op, struct nfsfh *fh)
|
||||
{
|
||||
|
@ -657,6 +658,7 @@ nfs4_op_release_lockowner(struct nfs_context *nfs, nfs_argop4 *op, struct nfsfh
|
|||
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
nfs4_op_close(struct nfs_context *nfs, nfs_argop4 *op, struct nfsfh *fh)
|
||||
|
@ -1687,10 +1689,14 @@ nfs4_chdir_1_cb(struct rpc_context *rpc, int status, void *command_data,
|
|||
}
|
||||
|
||||
/* Ok, all good. Lets steal the path string. */
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_lock(&nfs->rpc->rpc_mutex);
|
||||
#endif
|
||||
free(nfs->nfsi->cwd);
|
||||
nfs->nfsi->cwd = data->path;
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_unlock(&nfs->rpc->rpc_mutex);
|
||||
#endif
|
||||
|
||||
data->path = NULL;
|
||||
|
||||
|
@ -2347,10 +2353,10 @@ nfs4_open_readlink_cb(struct rpc_context *rpc, int status, void *command_data,
|
|||
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_lock(&data->nfs->nfsi->nfs4_open_mutex);
|
||||
#endif
|
||||
data->lock_owner = nfs->nfsi->open_counter++;
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
nfs_mt_mutex_unlock(&data->nfs->nfsi->nfs4_open_mutex);
|
||||
#else
|
||||
data->lock_owner = nfs->nfsi->open_counter++;
|
||||
#endif
|
||||
|
||||
data->filler.func = nfs4_populate_open;
|
||||
|
|
|
@ -165,7 +165,9 @@ int main(int argc, char *argv[])
|
|||
struct client client;
|
||||
struct statvfs stvfs;
|
||||
struct nfs_url *url = NULL;
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
int mt_started = 0;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
if (WSAStartup(MAKEWORD(2,2), &wsaData) != 0) {
|
||||
|
@ -247,6 +249,8 @@ int main(int argc, char *argv[])
|
|||
fprintf(stderr, "Failed to mount nfs share : %s\n", nfs_get_error(nfs));
|
||||
goto finished;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
/*
|
||||
* Before we can use multithreading we must initialize and
|
||||
* start the service thread.
|
||||
|
@ -256,6 +260,7 @@ int main(int argc, char *argv[])
|
|||
exit(10);
|
||||
}
|
||||
mt_started = 1;
|
||||
#endif
|
||||
|
||||
process_dir(nfs, "", 16);
|
||||
|
||||
|
@ -270,10 +275,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
ret = 0;
|
||||
finished:
|
||||
#ifdef HAVE_MULTITHREADING
|
||||
if (mt_started) {
|
||||
printf("closing service thread\n");
|
||||
nfs_mt_service_thread_stop(nfs);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ret > 0) {
|
||||
print_usage();
|
||||
|
|
Loading…
Reference in New Issue