linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] copy-on-write extents mapping
@ 2013-02-20  3:59 Jeff Liu
  2013-02-21 15:25 ` Jan Kara
  0 siblings, 1 reply; 8+ messages in thread
From: Jeff Liu @ 2013-02-20  3:59 UTC (permalink / raw)
  To: linux-fsdevel@vger.kernel.org
  Cc: Alexander Viro, Andreas Dilger, Dave Chinner, Mark Fasheh,
	Joel Becker, Jan Kara, Chris Mason, Christoph Hellwig,
	ocfs2-devel

Hello,

We have the user requests to show the real disk usage for OCFS2/Btrfs with
reflinked/cloned files.  AFAICS, integrate the existing fiemap interface to du(1) is
fine to solve this issue because OCFS2 can return an extent in FIEMAP_EXTENT_SHARED
state which is used to indicate the extent is reflinked, and Btrfs can be improved
in the similar approach in the future.

Now another issue is regarding the performance when call fiemap ioctl(2) against a
large file(like virtual disk images).  Assuming we created a 20Gb reflinked file,
the first 19Gb has been written(COWed), and the left 1Gb is still in shared status,
the user space has to call fiemap for multiple times to fetch the ending shared extents,
that is not good if the target disk have many reflinked files in such situations.

I'd like to introduce a new flag FIEMAP_FLAG_COW to the fiemap interface, if this flag is
set, the kernel space will only return the mapped extents in shared state, as a result, we
can reduce the overheads for calling fiemap again an again.

Test program to verify the FIEMAP_FLAG_COW flag:
https://github.com/pibroch/fiemap_cow/blob/master/cow_test.c

Create reflink file on OCFS2:
https://github.com/pibroch/fiemap_cow/blob/master/ocfs2_reflink.c


Any comments are appreciated, thanks!

-Jeff

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

end of thread, other threads:[~2013-03-02 10:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-20  3:59 [RFC PATCH 0/3] copy-on-write extents mapping Jeff Liu
2013-02-21 15:25 ` Jan Kara
2013-02-21 18:00   ` Zach Brown
2013-02-24 13:42     ` Jeff Liu
2013-02-25 13:28       ` Jan Kara
2013-02-25 14:19         ` Jeff Liu
2013-02-25 17:14         ` Zach Brown
2013-03-02 10:46         ` Joel Becker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).