From: Al Viro Date: Thu, 9 Apr 2015 04:00:30 +0000 (-0400) Subject: Merge branch 'iocb' into for-davem X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=237dae889051ed4ebf438b08ca6c0e7c54b97774;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'iocb' into for-davem trivial conflict in net/socket.c and non-trivial one in crypto - that one had evaded aio_complete() removal. Signed-off-by: Al Viro --- 237dae889051ed4ebf438b08ca6c0e7c54b97774 diff --cc crypto/algif_skcipher.c index 0aa02635ceda,0c8a1e5ccadf..8f903b6df299 --- a/crypto/algif_skcipher.c +++ b/crypto/algif_skcipher.c @@@ -75,40 -52,6 +75,40 @@@ struct skcipher_async_req #define MAX_SGL_ENTS ((4096 - sizeof(struct skcipher_sg_list)) / \ sizeof(struct scatterlist) - 1) +static void skcipher_free_async_sgls(struct skcipher_async_req *sreq) +{ + struct skcipher_async_rsgl *rsgl, *tmp; + struct scatterlist *sgl; + struct scatterlist *sg; + int i, n; + + list_for_each_entry_safe(rsgl, tmp, &sreq->list, list) { + af_alg_free_sg(&rsgl->sgl); + if (rsgl != &sreq->first_sgl) + kfree(rsgl); + } + sgl = sreq->tsg; + n = sg_nents(sgl); + for_each_sg(sgl, sg, n, i) + put_page(sg_page(sg)); + + kfree(sreq->tsg); +} + +static void skcipher_async_cb(struct crypto_async_request *req, int err) +{ + struct sock *sk = req->data; + struct alg_sock *ask = alg_sk(sk); + struct skcipher_ctx *ctx = ask->private; + struct skcipher_async_req *sreq = GET_SREQ(req, ctx); + struct kiocb *iocb = sreq->iocb; + + atomic_dec(&ctx->inflight); + skcipher_free_async_sgls(sreq); + kfree(req); - aio_complete(iocb, err, err); ++ iocb->ki_complete(iocb, err, err); +} + static inline int skcipher_sndbuf(struct sock *sk) { struct alg_sock *ask = alg_sk(sk); diff --cc fs/xfs/xfs_file.c index a2e1cb8a568b,f527618cb42b..f44212fae653 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@@ -36,9 -36,7 +36,8 @@@ #include "xfs_trace.h" #include "xfs_log.h" #include "xfs_icache.h" +#include "xfs_pnfs.h" - #include #include #include #include diff --cc net/socket.c index 073809f4125f,f6c519d7b3ba..989b1ae32afa --- a/net/socket.c +++ b/net/socket.c @@@ -808,10 -855,11 +808,10 @@@ static ssize_t sock_read_iter(struct ki if (iocb->ki_pos != 0) return -ESPIPE; - if (iocb->ki_nbytes == 0) /* Match SYS5 behaviour */ + if (!iov_iter_count(to)) /* Match SYS5 behaviour */ return 0; - res = sock_recvmsg(sock, &msg, iocb->ki_nbytes, msg.msg_flags); - res = __sock_recvmsg(iocb, sock, &msg, - iov_iter_count(to), msg.msg_flags); ++ res = sock_recvmsg(sock, &msg, iov_iter_count(to), msg.msg_flags); *to = msg.msg_iter; return res; } @@@ -833,7 -880,7 +833,7 @@@ static ssize_t sock_write_iter(struct k if (sock->type == SOCK_SEQPACKET) msg.msg_flags |= MSG_EOR; - res = sock_sendmsg(sock, &msg, iocb->ki_nbytes); - res = __sock_sendmsg(iocb, sock, &msg, iov_iter_count(from)); ++ res = sock_sendmsg(sock, &msg, iov_iter_count(from)); *from = msg.msg_iter; return res; }