From patchwork Wed Oct 2 14:27:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 2975141 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C2F4EBFF0B for ; Wed, 2 Oct 2013 14:31:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B95F2029B for ; Wed, 2 Oct 2013 14:31:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87EAF201FA for ; Wed, 2 Oct 2013 14:31:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753777Ab3JBOaD (ORCPT ); Wed, 2 Oct 2013 10:30:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49072 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753422Ab3JBO3B (ORCPT ); Wed, 2 Oct 2013 10:29:01 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C0387A543A; Wed, 2 Oct 2013 16:28:57 +0200 (CEST) Received: by quack.suse.cz (Postfix, from userid 1000) id 0633380ECA; Wed, 2 Oct 2013 16:28:55 +0200 (CEST) From: Jan Kara To: LKML Cc: linux-mm@kvack.org, Jan Kara , Trond Myklebust , linux-nfs@vger.kernel.org Subject: [PATCH 14/26] nfs: Convert direct IO to use get_user_pages_fast() Date: Wed, 2 Oct 2013 16:27:55 +0200 Message-Id: <1380724087-13927-15-git-send-email-jack@suse.cz> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1380724087-13927-1-git-send-email-jack@suse.cz> References: <1380724087-13927-1-git-send-email-jack@suse.cz> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 CC: Trond Myklebust CC: linux-nfs@vger.kernel.org Signed-off-by: Jan Kara --- fs/nfs/direct.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 91ff089d3412..1aaf4aa2b3d7 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -337,10 +337,8 @@ static ssize_t nfs_direct_read_schedule_segment(struct nfs_pageio_descriptor *de if (!pagevec) break; if (uio) { - down_read(¤t->mm->mmap_sem); - result = get_user_pages(current, current->mm, user_addr, - npages, 1, 0, pagevec, NULL); - up_read(¤t->mm->mmap_sem); + result = get_user_pages_fast(user_addr, npages, 1, + pagevec); if (result < 0) break; } else { @@ -658,10 +656,8 @@ static ssize_t nfs_direct_write_schedule_segment(struct nfs_pageio_descriptor *d break; if (uio) { - down_read(¤t->mm->mmap_sem); - result = get_user_pages(current, current->mm, user_addr, - npages, 0, 0, pagevec, NULL); - up_read(¤t->mm->mmap_sem); + result = get_user_pages_fast(user_addr, npages, 0, + pagevec); if (result < 0) break; } else {