From patchwork Mon May 16 16:20:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 788572 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4GGKjC1018574 for ; Mon, 16 May 2011 16:21:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753342Ab1EPQU7 (ORCPT ); Mon, 16 May 2011 12:20:59 -0400 Received: from daytona.panasas.com ([67.152.220.89]:34569 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753110Ab1EPQU7 (ORCPT ); Mon, 16 May 2011 12:20:59 -0400 Received: from lt.bhalevy.com.com ([172.17.142.149]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 16 May 2011 12:20:58 -0400 From: Benny Halevy To: Trond Myklebust Cc: linux-nfs@vger.kernel.org, bharrosh@panasas.com Subject: [PATCH v3 03/29] pnfs: align layoutget requests on page boundaries Date: Mon, 16 May 2011 09:20:56 -0700 Message-Id: <1305562856-7319-1-git-send-email-bhalevy@panasas.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <4DD14D8E.1070701@panasas.com> References: <4DD14D8E.1070701@panasas.com> X-OriginalArrivalTime: 16 May 2011 16:20:58.0924 (UTC) FILETIME=[3DA00EC0:01CC13E5] 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 (demeter1.kernel.org [140.211.167.41]); Mon, 16 May 2011 16:21:00 +0000 (UTC) --- 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 15c8e48..bad146e 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -846,6 +846,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; @@ -895,6 +896,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); if (!lseg && first) { spin_lock(&clp->cl_lock);