Re: Questions regarding COW-related behaviors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, 09 November, 2010, João Eduardo Luís wrote:
> > The old tree is discarded unless the user requested a snapshot of it.
> > 
> > Every time btrfs updates the roots is a new generation. Some data
> > structures have "generation" fields, indicating the generation in which
> > they were most recently changed. This is mostly used to verify the
> > filesystem is correct, but it's also possible to scan the generation
> > fields and find out which files have changed.
> 
> As Goffredo Baroncelli explained in a previous reply to my questions, the 
"find-new" command will search through keys with type BTRFS_EXTENT_DATA_TYPE. 
This command does print several changes to the same files throughout history 
since a given generation. My new question to this is rather simple: does BTRFS 
actually keep the data from this generations to which "find-new" has access, 
or is it only able to access information that records this changes?
> 

Btrfs stores the info in a btree. With the exception of the leaf, every block 
of the tree contains a list of a pair of key, pointer defined by the struct 
btrfs_key_ptr:

struct btrfs_disk_key {
        __le64 objectid;
        u8 type;
        __le64 offset;
} __attribute__ ((__packed__));

struct btrfs_key_ptr {
        struct btrfs_disk_key key;
        __le64 blockptr;
        __le64 generation;
} __attribute__ ((__packed__));

The generation field, contains the info in which you are interested.

So I think that the correct answer of your question is the second one.

Regards
G.Baroncelli

-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack@xxxxxxxxx>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux