From patchwork Fri Mar 2 16:43:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Curt Wohlgemuth X-Patchwork-Id: 144283 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 70C79B6EEC for ; Sat, 3 Mar 2012 03:49:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758862Ab2CBQtF (ORCPT ); Fri, 2 Mar 2012 11:49:05 -0500 Received: from mail-fa0-f74.google.com ([209.85.161.74]:35897 "EHLO mail-fa0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758860Ab2CBQtE (ORCPT ); Fri, 2 Mar 2012 11:49:04 -0500 Received: by faaa19 with SMTP id a19so72217faa.1 for ; Fri, 02 Mar 2012 08:49:02 -0800 (PST) Received-SPF: pass (google.com: domain of curtw@google.com designates 10.14.37.16 as permitted sender) client-ip=10.14.37.16; Authentication-Results: mr.google.com; spf=pass (google.com: domain of curtw@google.com designates 10.14.37.16 as permitted sender) smtp.mail=curtw@google.com; dkim=pass header.i=curtw@google.com Received: from mr.google.com ([10.14.37.16]) by 10.14.37.16 with SMTP id x16mr5091863eea.1.1330706942692 (num_hops = 1); Fri, 02 Mar 2012 08:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:from:to:cc:subject:date:message-id:x-mailer; bh=aTU2qMRHt+NyywdwCF5mjziLhSttu2oo4yxzzyItiiw=; b=PNbefagoeLZOppxEiq5npbCy0LbnngJGKKbbHzs6ZcCmJ4hV2bfzxAfFn8ss04gK+K o9k+8G9m+KV0q9BVEf9DZ0jHkWr/5/mG+BdXf/cQZThUZjBH+HOeXjFM9gIG/TyBfz0O EaNNPmIMgsCpzDcJ5TFt0Ttnn8YEHQQNNcIaPxjOP4pYsktpQpTplUxJezvD9Mx5pK+f IG3yM3gDHu0KoIN3Kyl6hGVRbip6WB3d1fwEK6H4+1iGYlSn9h7FkugJ5sgNt/LhEHbE IYaAunoaWdOPACAa+8FFrOTaJTZbWf98xmqjmTFrt6qUFd1jzNbYX6+CRZnbAWS4FuGk v13A== Received: by 10.14.37.16 with SMTP id x16mr4430243eea.1.1330706628649; Fri, 02 Mar 2012 08:43:48 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.37.16 with SMTP id x16mr4430226eea.1.1330706628393; Fri, 02 Mar 2012 08:43:48 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id f9si4369780eea.2.2012.03.02.08.43.48 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 02 Mar 2012 08:43:48 -0800 (PST) Received: from rostrum.mtv.corp.google.com (rostrum.mtv.corp.google.com [172.18.96.39]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 34D93200057; Fri, 2 Mar 2012 08:43:48 -0800 (PST) Received: by rostrum.mtv.corp.google.com (Postfix, from userid 87825) id 84F65ECB17; Fri, 2 Mar 2012 08:43:47 -0800 (PST) From: Curt Wohlgemuth To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, Curt Wohlgemuth Subject: [PATCH] ext4: Add comments to definition of ext4_io_end_t Date: Fri, 2 Mar 2012 08:43:45 -0800 Message-Id: <1330706625-24701-1-git-send-email-curtw@google.com> X-Mailer: git-send-email 1.7.7.3 X-Gm-Message-State: ALoCoQlHAELaJaqoWMXmy++1sIQGUpD9NsicF8gIa1dVrlOp8NHLaFoJqlkrJ9fJBw2JYMRUoS3Ayar/ri4lhOAzg3w6VbUMwN3b5dyKQlE1JaB5YO/F34KXi+vpHolJ/HGuVBGeLsGIM1loH4qbtIBVuEBcm7uXsbBTdLWdvC02IrOUQ1LSkHw= Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This should make it more clear what this structure is used for, and how some of the (mutually exclusive) fields are used to keep page cache references. Signed-off-by: Curt Wohlgemuth --- fs/ext4/ext4.h | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 513004f..4dc34ed 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -192,18 +192,25 @@ struct ext4_io_page { #define MAX_IO_PAGES 128 +/* + * For converting uninitialized extents on a work queue. + * + * 'page' is only used from the writepage() path; 'pages' is only used for + * buffered writes; they are used to keep page references until conversion + * takes place. For AIO/DIO, neither field is filled in. + */ typedef struct ext4_io_end { struct list_head list; /* per-file finished IO list */ struct inode *inode; /* file being written to */ unsigned int flag; /* unwritten or not */ - struct page *page; /* page struct for buffer write */ + struct page *page; /* for writepage() path */ loff_t offset; /* offset in the file */ ssize_t size; /* size of the extent */ struct work_struct work; /* data work queue */ struct kiocb *iocb; /* iocb struct for AIO */ int result; /* error value for AIO */ - int num_io_pages; - struct ext4_io_page *pages[MAX_IO_PAGES]; + int num_io_pages; /* for writepages() */ + struct ext4_io_page *pages[MAX_IO_PAGES]; /* for writepages() */ } ext4_io_end_t; struct ext4_io_submit {