Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 150030b7 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Matthew Wilcox
Browse files

NFS: Switch from intr mount option to TASK_KILLABLE



By using the TASK_KILLABLE infrastructure, we can get rid of the 'intr'
mount option.  We have to use _killable everywhere instead of _interruptible
as we get rid of rpc_clnt_sigmask/sigunmask.

Signed-off-by: default avatarLiam R. Howlett <howlett@gmail.com>
Signed-off-by: default avatarMatthew Wilcox <willy@linux.intel.com>
parent 009e577e
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ found_client:
	if (new)
		nfs_free_client(new);

	error = wait_event_interruptible(nfs_client_active_wq,
	error = wait_event_killable(nfs_client_active_wq,
				clp->cl_cons_state != NFS_CS_INITING);
	if (error < 0) {
		nfs_put_client(clp);
@@ -494,10 +494,6 @@ static int nfs_init_server_rpcclient(struct nfs_server *server, rpc_authflavor_t
	if (server->flags & NFS_MOUNT_SOFT)
		server->client->cl_softrtry = 1;

	server->client->cl_intr = 0;
	if (server->flags & NFS4_MOUNT_INTR)
		server->client->cl_intr = 1;

	return 0;
}

+1 −9
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)
	if (dreq->iocb)
		goto out;

	result = wait_for_completion_interruptible(&dreq->completion);
	result = wait_for_completion_killable(&dreq->completion);

	if (!result)
		result = dreq->error;
@@ -391,9 +391,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
			       unsigned long nr_segs, loff_t pos)
{
	ssize_t result = 0;
	sigset_t oldset;
	struct inode *inode = iocb->ki_filp->f_mapping->host;
	struct rpc_clnt *clnt = NFS_CLIENT(inode);
	struct nfs_direct_req *dreq;

	dreq = nfs_direct_req_alloc();
@@ -405,11 +403,9 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov,
	if (!is_sync_kiocb(iocb))
		dreq->iocb = iocb;

	rpc_clnt_sigmask(clnt, &oldset);
	result = nfs_direct_read_schedule_iovec(dreq, iov, nr_segs, pos);
	if (!result)
		result = nfs_direct_wait(dreq);
	rpc_clnt_sigunmask(clnt, &oldset);
	nfs_direct_req_release(dreq);

	return result;
@@ -767,9 +763,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
				size_t count)
{
	ssize_t result = 0;
	sigset_t oldset;
	struct inode *inode = iocb->ki_filp->f_mapping->host;
	struct rpc_clnt *clnt = NFS_CLIENT(inode);
	struct nfs_direct_req *dreq;
	size_t wsize = NFS_SERVER(inode)->wsize;
	int sync = 0;
@@ -787,11 +781,9 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, const struct iovec *iov,
	if (!is_sync_kiocb(iocb))
		dreq->iocb = iocb;

	rpc_clnt_sigmask(clnt, &oldset);
	result = nfs_direct_write_schedule_iovec(dreq, iov, nr_segs, pos, sync);
	if (!result)
		result = nfs_direct_wait(dreq);
	rpc_clnt_sigunmask(clnt, &oldset);
	nfs_direct_req_release(dreq);

	return result;
+1 −5
Original line number Diff line number Diff line
@@ -433,15 +433,11 @@ static int nfs_wait_schedule(void *word)
 */
static int nfs_wait_on_inode(struct inode *inode)
{
	struct rpc_clnt	*clnt = NFS_CLIENT(inode);
	struct nfs_inode *nfsi = NFS_I(inode);
	sigset_t oldmask;
	int error;

	rpc_clnt_sigmask(clnt, &oldmask);
	error = wait_on_bit_lock(&nfsi->flags, NFS_INO_REVALIDATING,
					nfs_wait_schedule, TASK_INTERRUPTIBLE);
	rpc_clnt_sigunmask(clnt, &oldmask);
					nfs_wait_schedule, TASK_KILLABLE);

	return error;
}
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ int nfs_mount(struct sockaddr *addr, size_t len, char *hostname, char *path,
		.program	= &mnt_program,
		.version	= version,
		.authflavor	= RPC_AUTH_UNIX,
		.flags		= RPC_CLNT_CREATE_INTR,
		.flags		= 0,
	};
	struct rpc_clnt		*mnt_clnt;
	int			status;
+2 −5
Original line number Diff line number Diff line
@@ -27,17 +27,14 @@
static int
nfs3_rpc_wrapper(struct rpc_clnt *clnt, struct rpc_message *msg, int flags)
{
	sigset_t oldset;
	int res;
	rpc_clnt_sigmask(clnt, &oldset);
	do {
		res = rpc_call_sync(clnt, msg, flags);
		if (res != -EJUKEBOX)
			break;
		schedule_timeout_interruptible(NFS_JUKEBOX_RETRY_TIME);
		schedule_timeout_killable(NFS_JUKEBOX_RETRY_TIME);
		res = -ERESTARTSYS;
	} while (!signalled());
	rpc_clnt_sigunmask(clnt, &oldset);
	} while (!fatal_signal_pending(current));
	return res;
}

Loading