Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1450279 > unrolled thread

[PATCHv1, RFC 29/33] ext4: handle huge pages in ext4_da_write_end()

Started by"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
First post2016-07-26 02:50 +0200
Last post2016-07-26 02:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCHv1, RFC 29/33] ext4: handle huge pages in ext4_da_write_end() "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2016-07-26 02:50 +0200

#1450279 — [PATCHv1, RFC 29/33] ext4: handle huge pages in ext4_da_write_end()

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2016-07-26 02:50 +0200
Subject[PATCHv1, RFC 29/33] ext4: handle huge pages in ext4_da_write_end()
Message-ID<rYYJj-3t1-7@gated-at.bofh.it>
Call ext4_da_should_update_i_disksize() for head page with offset
relative to head page.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 fs/ext4/inode.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 3df2cea763ce..744bba046268 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2998,7 +2998,6 @@ static int ext4_da_write_end(struct file *file,
 	int ret = 0, ret2;
 	handle_t *handle = ext4_journal_current_handle();
 	loff_t new_i_size;
-	unsigned long start, end;
 	int write_mode = (int)(unsigned long)fsdata;
 
 	if (write_mode == FALL_BACK_TO_NONDELALLOC)
@@ -3006,8 +3005,6 @@ static int ext4_da_write_end(struct file *file,
 				      len, copied, page, fsdata);
 
 	trace_ext4_da_write_end(inode, pos, len, copied);
-	start = pos & (PAGE_SIZE - 1);
-	end = start + copied - 1;
 
 	/*
 	 * generic_write_end() will run mark_inode_dirty() if i_size
@@ -3016,8 +3013,10 @@ static int ext4_da_write_end(struct file *file,
 	 */
 	new_i_size = pos + copied;
 	if (copied && new_i_size > EXT4_I(inode)->i_disksize) {
+		struct page *head = compound_head(page);
+		unsigned long end = (pos & ~hpage_mask(head)) + copied - 1;
 		if (ext4_has_inline_data(inode) ||
-		    ext4_da_should_update_i_disksize(page, end)) {
+		    ext4_da_should_update_i_disksize(head, end)) {
 			ext4_update_i_disksize(inode, new_i_size);
 			/* We need to mark inode dirty even if
 			 * new_i_size is less that inode->i_size
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web