SUNPRC: cleanup RPC PipeFS pipes upcall interface
authorStanislav Kinsbursky <skinsbursky@parallels.com>
Mon, 26 Dec 2011 12:43:49 +0000 (15:43 +0300)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 31 Jan 2012 23:20:25 +0000 (18:20 -0500)
RPC pipe upcall doesn't requires only private pipe data. Thus RPC inode
references in this code can be removed.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/blocklayout/blocklayoutdev.c
fs/nfs/blocklayout/blocklayoutdm.c
fs/nfs/idmap.c
include/linux/sunrpc/rpc_pipe_fs.h
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/rpc_pipe.c

index d08ba9107fde2fa5c608a9b581cc4f7e12e5cb4f..81019190e46d80ccd43d50f659292842225c0909 100644 (file)
@@ -146,7 +146,7 @@ nfs4_blk_decode_device(struct nfs_server *server,
 
        dprintk("%s CALLING USERSPACE DAEMON\n", __func__);
        add_wait_queue(&bl_wq, &wq);
-       rc = rpc_queue_upcall(bl_device_pipe->d_inode, &msg);
+       rc = rpc_queue_upcall(RPC_I(bl_device_pipe->d_inode)->pipe, &msg);
        if (rc < 0) {
                remove_wait_queue(&bl_wq, &wq);
                rv = ERR_PTR(rc);
index d055c75580734853a29ae2b3553d5c0268bf44f9..3c38244a87248e52169de269fed116d25a950c95 100644 (file)
@@ -66,7 +66,7 @@ static void dev_remove(dev_t dev)
        msg.len = sizeof(bl_msg) + bl_msg.totallen;
 
        add_wait_queue(&bl_wq, &wq);
-       if (rpc_queue_upcall(bl_device_pipe->d_inode, &msg) < 0) {
+       if (rpc_queue_upcall(RPC_I(bl_device_pipe->d_inode)->pipe, &msg) < 0) {
                remove_wait_queue(&bl_wq, &wq);
                goto out;
        }
index 2c05f1991e1e1c3664c8ffb9f0159687b53b8449..3c63c47c793d48df0a89788e75d85b53bad7ec80 100644 (file)
@@ -589,7 +589,7 @@ nfs_idmap_id(struct idmap *idmap, struct idmap_hashtable *h,
        msg.len = sizeof(*im);
 
        add_wait_queue(&idmap->idmap_wq, &wq);
-       if (rpc_queue_upcall(idmap->idmap_dentry->d_inode, &msg) < 0) {
+       if (rpc_queue_upcall(RPC_I(idmap->idmap_dentry->d_inode)->pipe, &msg) < 0) {
                remove_wait_queue(&idmap->idmap_wq, &wq);
                goto out;
        }
@@ -650,7 +650,7 @@ nfs_idmap_name(struct idmap *idmap, struct idmap_hashtable *h,
 
        add_wait_queue(&idmap->idmap_wq, &wq);
 
-       if (rpc_queue_upcall(idmap->idmap_dentry->d_inode, &msg) < 0) {
+       if (rpc_queue_upcall(RPC_I(idmap->idmap_dentry->d_inode)->pipe, &msg) < 0) {
                remove_wait_queue(&idmap->idmap_wq, &wq);
                goto out;
        }
index 57512c23d34cb2436b676d6a742124e4b223e4ca..3ebc257e2b43ec48d808f0161f28069dfeef3fb9 100644 (file)
@@ -64,7 +64,7 @@ extern void rpc_put_sb_net(const struct net *net);
 
 extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
                                       char __user *, size_t);
-extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
+extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *);
 
 struct rpc_clnt;
 extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *);
index e933484e55ef09a8d02f5f3796fe4c9bb963592e..4157e3151581a2503dbe61e7f361a8a00ef95192 100644 (file)
@@ -473,8 +473,7 @@ gss_setup_upcall(struct rpc_clnt *clnt, struct gss_auth *gss_auth, struct rpc_cr
                return gss_new;
        gss_msg = gss_add_msg(gss_new);
        if (gss_msg == gss_new) {
-               struct inode *inode = &gss_new->inode->vfs_inode;
-               int res = rpc_queue_upcall(inode, &gss_new->msg);
+               int res = rpc_queue_upcall(gss_new->inode->pipe, &gss_new->msg);
                if (res) {
                        gss_unhash_msg(gss_new);
                        gss_msg = ERR_PTR(res);
index 299b1a3c3e49b84062d5d8348865ec28ed1d4159..4093da79d5123c5e643456f54524759d22fd0496 100644 (file)
@@ -130,9 +130,8 @@ EXPORT_SYMBOL_GPL(rpc_pipe_generic_upcall);
  * initialize the fields of @msg (other than @msg->list) appropriately.
  */
 int
-rpc_queue_upcall(struct inode *inode, struct rpc_pipe_msg *msg)
+rpc_queue_upcall(struct rpc_pipe *pipe, struct rpc_pipe_msg *msg)
 {
-       struct rpc_pipe *pipe = RPC_I(inode)->pipe;
        int res = -EPIPE;
 
        spin_lock(&pipe->lock);