From patchwork Mon Mar 16 16:15:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 6022791 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 64DBE9F2A9 for ; Mon, 16 Mar 2015 16:18:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB87C202EC for ; Mon, 16 Mar 2015 16:18:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 10537201F4 for ; Mon, 16 Mar 2015 16:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965970AbbCPQR5 (ORCPT ); Mon, 16 Mar 2015 12:17:57 -0400 Received: from mga11.intel.com ([192.55.52.93]:39559 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965272AbbCPQRz (ORCPT ); Mon, 16 Mar 2015 12:17:55 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 16 Mar 2015 09:17:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,410,1422950400"; d="scan'208";a="692857859" Received: from tshultz-mobl.amr.corp.intel.com (HELO [127.0.1.1]) ([10.254.107.94]) by fmsmga002.fm.intel.com with ESMTP; 16 Mar 2015 09:17:55 -0700 Subject: [PATCH v2 net-next 2/4] aio: prefer aio_op op over iter_op To: davem@davemloft.net From: Tadeusz Struk Cc: linux-aio@kvack.org, herbert@gondor.apana.org.au, netdev@vger.kernel.org, ying.xue@windriver.com, bcrl@kvack.org, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, hch@lst.de, linux-crypto@vger.kernel.org Date: Mon, 16 Mar 2015 09:15:19 -0700 Message-ID: <20150316161519.16418.63051.stgit@tstruk-mobl1> In-Reply-To: <20150316161508.16418.23674.stgit@tstruk-mobl1> References: <20150316161508.16418.23674.stgit@tstruk-mobl1> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP AIO interface should prefer AIO operations over iter_op Signed-off-by: Tadeusz Struk --- fs/aio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/aio.c b/fs/aio.c index f8e52a1..389f4dd 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1449,11 +1449,15 @@ rw_common: if (rw == WRITE) file_start_write(file); - if (iter_op) { + if (rw_op) { + ret = rw_op(req, iovec, nr_segs, req->ki_pos); + } else if (iter_op) { iov_iter_init(&iter, rw, iovec, nr_segs, req->ki_nbytes); ret = iter_op(req, &iter); } else { - ret = rw_op(req, iovec, nr_segs, req->ki_pos); + if (iovec != inline_vecs) + kfree(iovec); + return -EINVAL; } if (rw == WRITE)