From patchwork Wed Mar 11 22:46:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tadeusz Struk X-Patchwork-Id: 5989121 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 9395E9F2A9 for ; Wed, 11 Mar 2015 22:49:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCFD520379 for ; Wed, 11 Mar 2015 22:48:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 060A220375 for ; Wed, 11 Mar 2015 22:48:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753068AbbCKWsx (ORCPT ); Wed, 11 Mar 2015 18:48:53 -0400 Received: from mga01.intel.com ([192.55.52.88]:1259 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbbCKWsu (ORCPT ); Wed, 11 Mar 2015 18:48:50 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 11 Mar 2015 15:48:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,384,1422950400"; d="scan'208";a="690748542" Received: from tstruk-mobl1.intel.com (HELO [127.0.1.1]) ([134.134.171.125]) by fmsmga002.fm.intel.com with ESMTP; 11 Mar 2015 15:48:49 -0700 Subject: [PATCH RFC 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: Wed, 11 Mar 2015 15:46:18 -0700 Message-ID: <20150311224618.23777.38330.stgit@tstruk-mobl1> In-Reply-To: <20150311224607.23777.2181.stgit@tstruk-mobl1> References: <20150311224607.23777.2181.stgit@tstruk-mobl1> User-Agent: StGit/0.15 MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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-fsdevel" 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)