Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1998069pxb; Sat, 21 Nov 2020 05:31:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdAhwBgQwLAO5zgHz+mdI2iJ5DU46t8+xMGLJQR2HZqZ3BQ3W/G6/L5JNwtdQcEGcWRXkY X-Received: by 2002:a17:906:26c7:: with SMTP id u7mr37483200ejc.96.1605965466448; Sat, 21 Nov 2020 05:31:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605965466; cv=none; d=google.com; s=arc-20160816; b=KG/Yci2YHLE4Ko+3MJoEQT0NnwsWEnnCuNgNvtyhS5Zl9j1lVCxyXRBLv5NhxsF8jW rsM5GHwvifdnlw8jN5d00SlyLHZTunxKErreTPgHVnTlJpWpobTy8OSeQ8Pp6OqnAjW7 il3SQIqqtfJioNtWGOS9G+iEkx4Su/6xQaiWq1fNk9GsGuR0QAxurNNTzodEwAk84bB7 dVAWvGFmvaS2EKgXvISq2bZaV9VcF4kYcy6IqxsIRNx+Q2fyYGZ+fMxdbSNHU/Nt3taa eaxrXncZPhZFylSW3WR8VikHB13CVgo+7wW/zKBodgI8SIvOD7qd2kR5V1l5SeCkvxqX 1NFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=+Om3M0BIxbSuF3ZOTs6rshwBCB7b8mi5Pxx0b5la7A4=; b=ZonLMnHoIskwtMHKb0c6WyfLt0LW+OfRosyewaR0o0vjRX4n+A5xrAZa5sSR05Me4w pKxCZuwCDP2T24vD1nHDt1kBoWbxIyTZiUW+nYICHaXB/Yct+etuQT+6224TuWrjjdgj FidTCtdAsod8k37D3LeIN2/60L5blZHVMCZD/GQr4odKf/T1uAqHWZQdfb9xEM1wJBE+ pSXUTAy7DlYHQbDoPQHXogCQL+K4dqo6nz4eqlw5hy2z6K+3wD/Etme8WSTeDCMdeztX +bPQ53x7HQ7q9iFAiiU4oqTaFfO/9YOk926GoP/N+w1f4kNjAHJauE3jf10+7naZKezY UyXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ikOqzvQ7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si3615564eds.29.2020.11.21.05.30.43; Sat, 21 Nov 2020 05:31:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ikOqzvQ7; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727807AbgKUN30 (ORCPT + 99 others); Sat, 21 Nov 2020 08:29:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22205 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbgKUN30 (ORCPT ); Sat, 21 Nov 2020 08:29:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605965365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=+Om3M0BIxbSuF3ZOTs6rshwBCB7b8mi5Pxx0b5la7A4=; b=ikOqzvQ7cdOtC3N6wKGcv4sH0W5tMU9zDZ2Jvs7K6coMDDRZm4iMAmd3sSIyHU/exG3g49 r689uczevoxD9KCjCwIAEn1mZyNsjtrRjom+UjSWzax4LqObqfCClrjeoQX3+wPG8zoX22 tGJg8tML/BvR90XRhzcQTD+UTjtIypw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-464-puEb43ZsP8aFux_UD7fq3w-1; Sat, 21 Nov 2020 08:29:21 -0500 X-MC-Unique: puEb43ZsP8aFux_UD7fq3w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3ECD780EDAA; Sat, 21 Nov 2020 13:29:20 +0000 (UTC) Received: from dwysocha.rdu.csb (ovpn-112-41.rdu2.redhat.com [10.10.112.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BB9196085D; Sat, 21 Nov 2020 13:29:19 +0000 (UTC) From: Dave Wysochanski To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, dhowells@redhat.com Subject: [PATCH v1 04/13] NFS: Call readpage_async_filler() from nfs_readpage_async() Date: Sat, 21 Nov 2020 08:29:18 -0500 Message-Id: <1605965358-24607-1-git-send-email-dwysocha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Refactor slightly so nfs_readpage_async() calls into readpage_async_filler(). Signed-off-by: Dave Wysochanski --- fs/nfs/read.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 5fda30742a32..1401f1c734c0 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c @@ -119,31 +119,22 @@ struct nfs_readdesc { struct nfs_open_context *ctx; }; +static int readpage_async_filler(void *data, struct page *page); + int nfs_readpage_async(void *data, struct inode *inode, struct page *page) { struct nfs_readdesc *desc = (struct nfs_readdesc *)data; - struct nfs_page *new; - unsigned int len; struct nfs_pgio_mirror *pgm; - - len = nfs_page_length(page); - if (len == 0) - return nfs_return_empty_page(page); - new = nfs_create_request(desc->ctx, page, 0, len); - if (IS_ERR(new)) { - unlock_page(page); - return PTR_ERR(new); - } - if (len < PAGE_SIZE) - zero_user_segment(page, len, PAGE_SIZE); + int error; nfs_pageio_init_read(&desc->pgio, inode, false, &nfs_async_read_completion_ops); - if (!nfs_pageio_add_request(&desc->pgio, new)) { - nfs_list_remove_request(new); - nfs_readpage_release(new, desc->pgio.pg_error); - } + + error = readpage_async_filler(desc, page); + if (error) + goto out; + nfs_pageio_complete(&desc->pgio); /* It doesn't make sense to do mirrored reads! */ @@ -153,6 +144,9 @@ int nfs_readpage_async(void *data, struct inode *inode, NFS_I(inode)->read_io += pgm->pg_bytes_written; return desc->pgio.pg_error < 0 ? desc->pgio.pg_error : 0; + +out: + return error; } static void nfs_page_group_set_uptodate(struct nfs_page *req) -- 1.8.3.1