linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: allow cross-subvolume BTRFS_IOC_CLONE
@ 2011-03-31  4:00 Larry D'Anna
  2011-03-31  4:00 ` [PATCH 1/2] btrfs: remove unused argument 'root' from btrfs_release_path Larry D'Anna
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Larry D'Anna @ 2011-03-31  4:00 UTC (permalink / raw)
  To: linux-btrfs; +Cc: larry, Yan Zheng

This is a simple patch to allow reflinks to be made crossing subvolume
boundaries.  The only complication I found in implementing this is that
btrfs_ioctl_clone reuses a btrfs_path.  This is a slight problem because once we
allow the source and destination inodes to come from different btrfs_roots, we
need to know what root to pass into the various calls to btrfs_release_path, and
keeping track of this would further complicate the control flow of
btrfs_ioctl_clone.  Fortunately btrfs_release_path does not use it's first
argument, patch number 1 removes it.

Patch number 2 is then just a simple matter of distinguishing between the source
and destination btrfs_roots in btrfs_ioctl_clone.

If removing the first argument from btrfs_release_path is undesirable, then
btrfs_ioctl_clone could simply pass NULL.  There are a few other places in btrfs
that already do this.

I have tested this by cp -a --reflink=always all the files found in the UML
slackware root_fs, and also by cloning a test file with hundreds of
random extents and holes.  

Larry D'Anna (2):
  btrfs: remove unused argument 'root' from btrfs_release_path
  btrfs: allow cross-subvolume BTRFS_IOC_CLONE

 fs/btrfs/ctree.c            |   28 ++++++------
 fs/btrfs/ctree.h            |    2 +-
 fs/btrfs/dir-item.c         |    2 +-
 fs/btrfs/extent-tree.c      |   74 ++++++++++++++++----------------
 fs/btrfs/file-item.c        |   12 +++---
 fs/btrfs/file.c             |   12 +++---
 fs/btrfs/free-space-cache.c |   14 +++---
 fs/btrfs/inode.c            |   42 +++++++++---------
 fs/btrfs/ioctl.c            |   22 +++++----
 fs/btrfs/relocation.c       |   30 +++++++-------
 fs/btrfs/root-tree.c        |   10 ++--
 fs/btrfs/tree-defrag.c      |    2 +-
 fs/btrfs/tree-log.c         |   98 +++++++++++++++++++++---------------------
 fs/btrfs/volumes.c          |   16 ++++----
 fs/btrfs/xattr.c            |    4 +-
 15 files changed, 185 insertions(+), 183 deletions(-)


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Re: [PATCH 0/2] btrfs: allow cross-subvolume BTRFS_IOC_CLONE
@ 2011-03-31 11:12 Tomasz Chmielewski
  0 siblings, 0 replies; 19+ messages in thread
From: Tomasz Chmielewski @ 2011-03-31 11:12 UTC (permalink / raw)
  To: linux-btrfs; +Cc: sensille, larry, hch

Arne Jansen wrote:

>> On Thu, Mar 31, 2011 at 12:00:11AM -0400, Larry D'Anna wrote:
>>> This is a simple patch to allow reflinks to be made crossing subvolume
>>> boundaries.
>>
>> NAK.  subvolumes will have to become vfsmounts sooner or later, and we
>> really must not support any operations spanning mountpoints.
>
> In what way would this interfere? the reflinked file gets its own inum
> in its own mountpoint. The two files only internally share some disk
> space.

Similarly, it would be pity if proposed deduplication couldn't cross 
subvolume boundaries...


-- 
Tomasz Chmielewski
http://wpkg.org


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

end of thread, other threads:[~2012-01-19 16:52 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-31  4:00 [PATCH 0/2] btrfs: allow cross-subvolume BTRFS_IOC_CLONE Larry D'Anna
2011-03-31  4:00 ` [PATCH 1/2] btrfs: remove unused argument 'root' from btrfs_release_path Larry D'Anna
2011-03-31  4:00 ` [PATCH 2/2] btrfs: allow cross-subvolume BTRFS_IOC_CLONE Larry D'Anna
2011-03-31  6:36 ` [PATCH 0/2] " Christoph Hellwig
2011-03-31  6:44   ` Arne Jansen
2011-03-31 12:02   ` Chris Mason
2011-04-01 13:34     ` Christoph Hellwig
2011-04-01 13:40       ` Chris Mason
2011-04-02  1:59         ` Fajar A. Nugraha
2011-12-22 12:24         ` Chris Samuel
2012-01-06 12:04           ` Konstantinos Skarlatos
2012-01-06 17:57             ` David Sterba
2012-01-09  6:58               ` Marios Titas
2012-01-09 13:31                 ` Jérôme Poulin
2012-01-19 16:52                   ` Jérôme Poulin
2011-04-02 15:51       ` Ken Drummond
2011-04-02 16:56         ` Larry D'Anna
2011-04-02 20:01           ` Jérôme Poulin
  -- strict thread matches above, loose matches on Subject: below --
2011-03-31 11:12 Tomasz Chmielewski

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).