On Mon, 2009-03-16 at 11:28 -0400, jim owens wrote:
> CSights wrote:
> > Hi everyone,
> >     I'm curious what would happen in btrfs if the following commands were 
> > issued:
> > 
> > # cp file1 file2
> > # chown newuser:newgroup file2
> > 
> > Where file1 was owned by olduser:oldgroup.
> > 
> > 
> >     If I understand copy-on-write correctly the "cp" would merely create a 
> > new 
> > pointer (or whatever it is called :( ) containing the files' metadata but 
> > the 
> > file contents would not actually be duplicated.
> 
> NO.  The concept you describe requires "deduplicate".
> 
> What you are forgetting is that "cp" is a user-space program that
> reads data and writes it to a new file.  The kernel does not see
> this as a Copy.
> 

This is true, cp makes a full copy of the file.

The btrfs utilities include a program called bcp that makes a COW copy
of a single file (or directory tree) with a btrfs specific ioctl.

-chris


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to