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

Commit 34e137cc authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust
Browse files

NFS: Remove nfs4_setup_sequence from generic unlink code



This is an NFS v4 specific operation, so it belongs in the NFS v4 code
and not the generic client.

Signed-off-by: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent ea7c3303
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -428,6 +428,11 @@ nfs3_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
	msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
	msg->rpc_proc = &nfs3_procedures[NFS3PROC_REMOVE];
}
}


static void nfs3_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
{
	rpc_call_start(task);
}

static int
static int
nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
nfs3_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
{
@@ -874,6 +879,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
	.create		= nfs3_proc_create,
	.create		= nfs3_proc_create,
	.remove		= nfs3_proc_remove,
	.remove		= nfs3_proc_remove,
	.unlink_setup	= nfs3_proc_unlink_setup,
	.unlink_setup	= nfs3_proc_unlink_setup,
	.unlink_rpc_prepare = nfs3_proc_unlink_rpc_prepare,
	.unlink_done	= nfs3_proc_unlink_done,
	.unlink_done	= nfs3_proc_unlink_done,
	.rename		= nfs3_proc_rename,
	.rename		= nfs3_proc_rename,
	.rename_setup	= nfs3_proc_rename_setup,
	.rename_setup	= nfs3_proc_rename_setup,
+11 −0
Original line number Original line Diff line number Diff line
@@ -2779,6 +2779,16 @@ static void nfs4_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
	nfs41_init_sequence(&args->seq_args, &res->seq_res, 1);
	nfs41_init_sequence(&args->seq_args, &res->seq_res, 1);
}
}


static void nfs4_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
{
	if (nfs4_setup_sequence(NFS_SERVER(data->dir),
				&data->args.seq_args,
				&data->res.seq_res,
				task))
		return;
	rpc_call_start(task);
}

static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
static int nfs4_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
{
	struct nfs_removeres *res = task->tk_msg.rpc_resp;
	struct nfs_removeres *res = task->tk_msg.rpc_resp;
@@ -6451,6 +6461,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
	.create		= nfs4_proc_create,
	.create		= nfs4_proc_create,
	.remove		= nfs4_proc_remove,
	.remove		= nfs4_proc_remove,
	.unlink_setup	= nfs4_proc_unlink_setup,
	.unlink_setup	= nfs4_proc_unlink_setup,
	.unlink_rpc_prepare = nfs4_proc_unlink_rpc_prepare,
	.unlink_done	= nfs4_proc_unlink_done,
	.unlink_done	= nfs4_proc_unlink_done,
	.rename		= nfs4_proc_rename,
	.rename		= nfs4_proc_rename,
	.rename_setup	= nfs4_proc_rename_setup,
	.rename_setup	= nfs4_proc_rename_setup,
+6 −0
Original line number Original line Diff line number Diff line
@@ -358,6 +358,11 @@ nfs_proc_unlink_setup(struct rpc_message *msg, struct inode *dir)
	msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE];
	msg->rpc_proc = &nfs_procedures[NFSPROC_REMOVE];
}
}


static void nfs_proc_unlink_rpc_prepare(struct rpc_task *task, struct nfs_unlinkdata *data)
{
	rpc_call_start(task);
}

static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
static int nfs_proc_unlink_done(struct rpc_task *task, struct inode *dir)
{
{
	if (nfs_async_handle_expired_key(task))
	if (nfs_async_handle_expired_key(task))
@@ -731,6 +736,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
	.create		= nfs_proc_create,
	.create		= nfs_proc_create,
	.remove		= nfs_proc_remove,
	.remove		= nfs_proc_remove,
	.unlink_setup	= nfs_proc_unlink_setup,
	.unlink_setup	= nfs_proc_unlink_setup,
	.unlink_rpc_prepare = nfs_proc_unlink_rpc_prepare,
	.unlink_done	= nfs_proc_unlink_done,
	.unlink_done	= nfs_proc_unlink_done,
	.rename		= nfs_proc_rename,
	.rename		= nfs_proc_rename,
	.rename_setup	= nfs_proc_rename_setup,
	.rename_setup	= nfs_proc_rename_setup,
+1 −19
Original line number Original line Diff line number Diff line
@@ -20,15 +20,6 @@
#include "iostat.h"
#include "iostat.h"
#include "delegation.h"
#include "delegation.h"


struct nfs_unlinkdata {
	struct hlist_node list;
	struct nfs_removeargs args;
	struct nfs_removeres res;
	struct inode *dir;
	struct rpc_cred	*cred;
	struct nfs_fattr dir_attr;
};

/**
/**
 * nfs_free_unlinkdata - release data from a sillydelete operation.
 * nfs_free_unlinkdata - release data from a sillydelete operation.
 * @data: pointer to unlink structure.
 * @data: pointer to unlink structure.
@@ -107,25 +98,16 @@ static void nfs_async_unlink_release(void *calldata)
	nfs_sb_deactive(sb);
	nfs_sb_deactive(sb);
}
}


#if defined(CONFIG_NFS_V4_1)
static void nfs_unlink_prepare(struct rpc_task *task, void *calldata)
static void nfs_unlink_prepare(struct rpc_task *task, void *calldata)
{
{
	struct nfs_unlinkdata *data = calldata;
	struct nfs_unlinkdata *data = calldata;
	struct nfs_server *server = NFS_SERVER(data->dir);
	NFS_PROTO(data->dir)->unlink_rpc_prepare(task, data);

	if (nfs4_setup_sequence(server, &data->args.seq_args,
				&data->res.seq_res, task))
		return;
	rpc_call_start(task);
}
}
#endif /* CONFIG_NFS_V4_1 */


static const struct rpc_call_ops nfs_unlink_ops = {
static const struct rpc_call_ops nfs_unlink_ops = {
	.rpc_call_done = nfs_async_unlink_done,
	.rpc_call_done = nfs_async_unlink_done,
	.rpc_release = nfs_async_unlink_release,
	.rpc_release = nfs_async_unlink_release,
#if defined(CONFIG_NFS_V4_1)
	.rpc_call_prepare = nfs_unlink_prepare,
	.rpc_call_prepare = nfs_unlink_prepare,
#endif /* CONFIG_NFS_V4_1 */
};
};


static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data)
static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data)
+10 −0
Original line number Original line Diff line number Diff line
@@ -1192,6 +1192,15 @@ struct nfs_write_data {
	struct page		*page_array[NFS_PAGEVEC_SIZE];
	struct page		*page_array[NFS_PAGEVEC_SIZE];
};
};


struct nfs_unlinkdata {
	struct hlist_node list;
	struct nfs_removeargs args;
	struct nfs_removeres res;
	struct inode *dir;
	struct rpc_cred	*cred;
	struct nfs_fattr dir_attr;
};

struct nfs_access_entry;
struct nfs_access_entry;
struct nfs_client;
struct nfs_client;
struct rpc_timeout;
struct rpc_timeout;
@@ -1221,6 +1230,7 @@ struct nfs_rpc_ops {
			    struct iattr *, int, struct nfs_open_context *);
			    struct iattr *, int, struct nfs_open_context *);
	int	(*remove)  (struct inode *, struct qstr *);
	int	(*remove)  (struct inode *, struct qstr *);
	void	(*unlink_setup)  (struct rpc_message *, struct inode *dir);
	void	(*unlink_setup)  (struct rpc_message *, struct inode *dir);
	void	(*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
	int	(*unlink_done) (struct rpc_task *, struct inode *);
	int	(*unlink_done) (struct rpc_task *, struct inode *);
	int	(*rename)  (struct inode *, struct qstr *,
	int	(*rename)  (struct inode *, struct qstr *,
			    struct inode *, struct qstr *);
			    struct inode *, struct qstr *);