Re: How to find (out if) files sharing content?

2012-11-05 Thread David Sterba
On Wed, Oct 31, 2012 at 09:02:15PM +0800, Jeff Liu wrote: I propose this because OCFS2 report shared space in this way combine with du(1). An old patch set to teach du(1) aware of reflinked file: https://oss.oracle.com/pipermail/ocfs2-devel/2010-September/007293.html Patch looks ok, the

Re: How to find (out if) files sharing content?

2012-11-05 Thread Jeff Liu
On 11/06/2012 06:45 AM, David Sterba wrote: On Wed, Oct 31, 2012 at 09:02:15PM +0800, Jeff Liu wrote: I propose this because OCFS2 report shared space in this way combine with du(1). An old patch set to teach du(1) aware of reflinked file:

Re: How to find (out if) files sharing content?

2012-10-31 Thread David Sterba
On Wed, Oct 31, 2012 at 10:30:22AM +0800, Jeff Liu wrote: One idea is to mark those cloned extents as FIEMAP_EXTENT_SHARED so that we can go through a file to figure out how many extents are shared through fiemap(2), and calculate the real storage(fs/subvolume) footprint in the end. This will

Re: How to find (out if) files sharing content?

2012-10-31 Thread Jeff Liu
On 10/31/2012 07:31 PM, David Sterba wrote: On Wed, Oct 31, 2012 at 10:30:22AM +0800, Jeff Liu wrote: One idea is to mark those cloned extents as FIEMAP_EXTENT_SHARED so that we can go through a file to figure out how many extents are shared through fiemap(2), and calculate the real

How to find (out if) files sharing content?

2012-10-30 Thread Gábor Nyers
Hi, How could one find out if 2 files share any extents on a btrfs file system? A more generic variation of the above: How to list files on the same file system/subvolume sharing content? Thanks, Gábor -- To unsubscribe from this list: send the line unsubscribe linux-btrfs in the body of a

Re: How to find (out if) files sharing content?

2012-10-30 Thread Hugo Mills
On Tue, Oct 30, 2012 at 04:20:05PM +0100, Gábor Nyers wrote: Hi, How could one find out if 2 files share any extents on a btrfs file system? A more generic variation of the above: How to list files on the same file system/subvolume sharing content? You have direct (read-only) access to

Re: How to find (out if) files sharing content?

2012-10-30 Thread Jan Schmidt
On Tue, October 30, 2012 at 16:39 (+0100), Hugo Mills wrote: It should be possible to walk through the extents of a given file, and (I think) follow back-refs from the extent back to the other files that share it. You wish :-) Backrefs are not made to walk them while the file system is online.

Re: How to find (out if) files sharing content?

2012-10-30 Thread Liu Bo
On 10/30/2012 11:20 PM, Gábor Nyers wrote: Hi, How could one find out if 2 files share any extents on a btrfs file system? A more generic variation of the above: How to list files on the same file system/subvolume sharing content? Indeed ocfs2 already has the feature where you can get

Re: How to find (out if) files sharing content?

2012-10-30 Thread Jeff Liu
On 10/31/2012 08:40 AM, Liu Bo wrote: On 10/30/2012 11:20 PM, Gábor Nyers wrote: Hi, How could one find out if 2 files share any extents on a btrfs file system? A more generic variation of the above: How to list files on the same file system/subvolume sharing content? One idea is to mark