From patchwork Sun May 29 18:20:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 828122 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4TIKJVN030818 for ; Sun, 29 May 2011 18:20:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755296Ab1E2SUS (ORCPT ); Sun, 29 May 2011 14:20:18 -0400 Received: from daytona.panasas.com ([67.152.220.89]:50816 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755246Ab1E2SUR (ORCPT ); Sun, 29 May 2011 14:20:17 -0400 Received: from fs2.bhalevy.com ([172.17.33.72]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 29 May 2011 14:20:16 -0400 From: Boaz Harrosh To: Trond Myklebust , Benny Halevy , NFS list , open-osd Cc: Benny Halevy Subject: [PATCH 10/32] pnfs: align layoutget requests on page boundaries Date: Sun, 29 May 2011 21:20:06 +0300 Message-Id: <1306693206-7983-1-git-send-email-bharrosh@panasas.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <4DE28CFB.4060608@panasas.com> References: <4DE28CFB.4060608@panasas.com> X-OriginalArrivalTime: 29 May 2011 18:20:17.0006 (UTC) FILETIME=[0F8B70E0:01CC1E2D] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 29 May 2011 18:20:20 +0000 (UTC) From: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfs/pnfs.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index c2f09e9..2357ee3 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -850,6 +850,7 @@ pnfs_update_layout(struct inode *ino, .offset = pos, .length = count, }; + unsigned pg_offset; struct nfs_inode *nfsi = NFS_I(ino); struct nfs_client *clp = NFS_SERVER(ino)->nfs_client; struct pnfs_layout_hdr *lo; @@ -899,6 +900,13 @@ pnfs_update_layout(struct inode *ino, spin_unlock(&clp->cl_lock); } + pg_offset = arg.offset & ~PAGE_CACHE_MASK; + if (pg_offset) { + arg.offset -= pg_offset; + arg.length += pg_offset; + } + arg.length = PAGE_CACHE_ALIGN(arg.length); + lseg = send_layoutget(lo, ctx, &arg, gfp_flags); if (!lseg && first) { spin_lock(&clp->cl_lock);