mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-19 12:03:56 -04:00
SUNRPC/NFS: make rpc pipe upcall generic
The same function is used by idmap, gss and blocklayout code. Make it generic. Signed-off-by: Peng Tao <peng_tao@emc.com> Signed-off-by: Jim Rees <rees@umich.edu> Cc: stable@kernel.org [3.0] Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
committed by
Trond Myklebust
parent
fdc17abbc4
commit
c1225158a8
@@ -79,28 +79,6 @@ int nfs4_blkdev_put(struct block_device *bdev)
|
||||
return blkdev_put(bdev, FMODE_READ);
|
||||
}
|
||||
|
||||
/*
|
||||
* Shouldn't there be a rpc_generic_upcall() to do this for us?
|
||||
*/
|
||||
ssize_t bl_pipe_upcall(struct file *filp, struct rpc_pipe_msg *msg,
|
||||
char __user *dst, size_t buflen)
|
||||
{
|
||||
char *data = (char *)msg->data + msg->copied;
|
||||
size_t mlen = min(msg->len - msg->copied, buflen);
|
||||
unsigned long left;
|
||||
|
||||
left = copy_to_user(dst, data, mlen);
|
||||
if (left == mlen) {
|
||||
msg->errno = -EFAULT;
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
mlen -= left;
|
||||
msg->copied += mlen;
|
||||
msg->errno = 0;
|
||||
return mlen;
|
||||
}
|
||||
|
||||
static struct bl_dev_msg bl_mount_reply;
|
||||
|
||||
ssize_t bl_pipe_downcall(struct file *filp, const char __user *src,
|
||||
|
||||
Reference in New Issue
Block a user