From patchwork Wed Aug 8 02:03:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 1291851 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 98F1BDF280 for ; Wed, 8 Aug 2012 02:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755455Ab2HHCDg (ORCPT ); Tue, 7 Aug 2012 22:03:36 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:65416 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754699Ab2HHCDg (ORCPT ); Tue, 7 Aug 2012 22:03:36 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr13so617318pbb.19 for ; Tue, 07 Aug 2012 19:03:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=+zWDV9lfOHNqb1KRs3Wu++OEcLPiUeIxHxYfWUeygD8=; b=rgXqBLiTV+OR485zLkAOJLOPRD5FleswwSKvOw/od2ObGYlbOiqtdfhzjyDF9lZlXa fzwZhHT5g8l6IHSb4tFHHHZpRyPR4pjs2HsdltTVB+RLe7P5DMeUo/k09zMr3GFpXrY0 wB8F6OtO+o2nvWbet5qgu7wj80sJBHLNGUlGb+glXDgUcaew1vo3v0wkyHXkWRM6p+sV Ddix+9G77WsYI+mIEMA0YU65DKoIkgHMp9M6QISgRLYusPVzefNl6gwZWzhxKSSdBRwB 02iGdWJ+HqI+l9soXwP5ZGKUfJV+WlqUlrnDB2A0iFFgwvK/J5PI4QfxBN2R4c6/VUcA u7gg== Received: by 10.68.189.104 with SMTP id gh8mr32245668pbc.152.1344391416037; Tue, 07 Aug 2012 19:03:36 -0700 (PDT) Received: from debian-sid.localdomain ([123.115.212.137]) by mx.google.com with ESMTPS id pj10sm12281300pbb.46.2012.08.07.19.03.33 (version=SSLv3 cipher=OTHER); Tue, 07 Aug 2012 19:03:35 -0700 (PDT) From: Peng Tao To: bharrosh@panasas.com Cc: linux-nfs@vger.kernel.org, Peng Tao Subject: [PATCH RFC 3/3] NFS41: send real read size in layoutget for DIO Date: Wed, 8 Aug 2012 10:03:12 +0800 Message-Id: <1344391392-1948-4-git-send-email-bergwolf@gmail.com> X-Mailer: git-send-email 1.7.1.262.g5ef3d In-Reply-To: <1344391392-1948-1-git-send-email-bergwolf@gmail.com> References: <1344391392-1948-1-git-send-email-bergwolf@gmail.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Peng Tao We don't have the real IO size information in buffer read, but for direct read, we can get it from dreq->bytes_left. Let's make use of it. Signed-off-by: Peng Tao --- fs/nfs/pnfs.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index e61a373..e4cfd1e 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -1154,16 +1154,22 @@ out_forget_reply: void pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) { + u64 rd_size = req->wb_bytes; + BUG_ON(pgio->pg_lseg != NULL); if (req->wb_offset != req->wb_pgbase) { nfs_pageio_reset_read_mds(pgio); return; } + + if (pgio->pg_dreq != NULL) + rd_size = nfs_dreq_bytes_left(pgio->pg_dreq); + pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, req->wb_context, req_offset(req), - req->wb_bytes, + rd_size, IOMODE_READ, GFP_KERNEL); /* If no lseg, fall back to read through mds */