All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] f2fs: support finding extents after isize
@ 2015-12-30  9:17 Fan Li
  2015-12-30 13:27 ` Chao Yu
  0 siblings, 1 reply; 18+ messages in thread
From: Fan Li @ 2015-12-30  9:17 UTC (permalink / raw)
  To: 'Jaegeuk Kim'; +Cc: linux-f2fs-devel

f2fs allows preallocation beyond isize, but f2fs_fiemap only look up
extents within isize. Therefore add this support.

Note: It's possible that there are holes after isize, for example,
fallocate  multiple discontinuous extents after isize with 
FALLOC_FL_KEEP_SIZE set. Since I can tell no differences between 
EOF and holes from return of get_data_block, I'm afaid this patch
can't support such scenarios. 


Signed-off-by: Fan li <fanofcode.li@samsung.com>
---
 fs/f2fs/data.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index a9a4d89..f89cf07 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -798,12 +798,6 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 	isize = i_size_read(inode);
 
 	mutex_lock(&inode->i_mutex);
-	if (start >= isize)
-		goto out;
-
-	if (start + len > isize)
-		len = isize - start;
-
 	if (logical_to_blk(inode, len) == 0)
 		len = blk_to_logical(inode, 1);
 
@@ -829,6 +823,7 @@ next:
 		 * punch holes beyond isize and keep size unchanged.
 		 */
 		flags |= FIEMAP_EXTENT_LAST;
+		last_blk = start_blk - 1;
 	}
 
 	if (size)
-- 
1.7.9.5


------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2016-01-05 18:11 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-30  9:17 [PATCH 2/3] f2fs: support finding extents after isize Fan Li
2015-12-30 13:27 ` Chao Yu
2015-12-31  3:37   ` Fan Li
2015-12-31  6:34     ` Chao Yu
2016-01-04  5:57       ` Fan Li
2016-01-04  6:55         ` Jaegeuk Kim
2016-01-04 11:13           ` Fan Li
2016-01-04 23:14             ` Jaegeuk Kim
2016-01-05  2:37               ` Fan Li
2016-01-05  3:08                 ` Jaegeuk Kim
2016-01-05  7:22                   ` Fan Li
2016-01-05 18:11                     ` Jaegeuk Kim
2016-01-05  3:19           ` Chao Yu
2016-01-05  3:29             ` Jaegeuk Kim
2016-01-05  9:36               ` Chao Yu
2016-01-04 10:00         ` Chao Yu
2016-01-04 10:55           ` Fan Li
2016-01-05  3:48             ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.