From patchwork Tue Jun 14 02:33:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Rees X-Patchwork-Id: 877602 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5E2W3N4029514 for ; Tue, 14 Jun 2011 02:33:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754394Ab1FNCdQ (ORCPT ); Mon, 13 Jun 2011 22:33:16 -0400 Received: from merit-proxy01.merit.edu ([207.75.116.193]:48213 "EHLO merit-proxy01.merit.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754390Ab1FNCdP (ORCPT ); Mon, 13 Jun 2011 22:33:15 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by merit-proxy01.merit.edu (Postfix) with ESMTP id 81C522039D47; Mon, 13 Jun 2011 22:33:15 -0400 (EDT) X-Virus-Scanned: amavisd-new at merit-proxy01.merit.edu Received: from merit-proxy01.merit.edu ([127.0.0.1]) by localhost (merit-proxy01.merit.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cWhInF5dSV3A; Mon, 13 Jun 2011 22:33:15 -0400 (EDT) Received: from merit.edu (74-126-0-171.static.123.net [74.126.0.171]) by merit-proxy01.merit.edu (Postfix) with ESMTPSA id 186AC2039CE1; Mon, 13 Jun 2011 22:33:15 -0400 (EDT) X-Mailbox-Line: From 7abae6a47d5750528e8b91e364ab58eedadda97a Mon Sep 17 00:00:00 2001 Message-Id: <7abae6a47d5750528e8b91e364ab58eedadda97a.1308017749.git.rees@umich.edu> In-Reply-To: References: Subject: [PATCH 29/33] pnfsblock: bl_write_pagelist support functions To: Benny Halevy Cc: linux-nfs@vger.kernel.org, peter honeyman Date: Mon, 13 Jun 2011 22:33:13 -0400 From: Jim Rees 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]); Tue, 14 Jun 2011 02:33:17 +0000 (UTC) From: Fred Isaman [pnfsblock: SQUASHME: adjust to API change] Signed-off-by: Fred Isaman [pnfsblock: fixup blksize alignment in bl_setup_layoutcommit] Signed-off-by: Benny Halevy --- fs/nfs/blocklayout/blocklayout.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index cbf74d8..01fe089 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -70,6 +70,19 @@ static int is_hole(struct pnfs_block_extent *be, sector_t isect) return !is_sector_initialized(be->be_inval, isect); } +/* Given the be associated with isect, determine if page data can be + * written to disk. + */ +static int is_writable(struct pnfs_block_extent *be, sector_t isect) +{ + if (be->be_state == PNFS_BLOCK_READWRITE_DATA) + return 1; + else if (be->be_state != PNFS_BLOCK_INVALID_DATA) + return 0; + else + return is_sector_initialized(be->be_inval, isect); +} + static int dont_like_caller(struct nfs_page *req) {