Skip to contentSkip to conversation

ext4: Add comments to definition of ext4_io_end_t

PATCH Applied Curt Wohlgemuth 2 participants 2 messages Mar 2, 2012 – Mar 5, 2012 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: Add comments to definition of ext4_io_end_t

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.

---
 fs/ext4/ext4.h |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
fs/ext4/ext4.h +10 -3
index 513004f..4dc34ed 100644
@@ -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 {
Signature · 1 line
1.7.7.3
maintainer Applied
#1 lore raw
Quoted 5 lines · Curt Wohlgemuth

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.

Thanks, applied.

- Ted