diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-07-30 09:26:11 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | f321e4910398cf7922265d269fb17fd26f312571 (patch) | |
tree | 8430f004991351e48a4b3f9441fe0cbbcf70eddb /fs/btrfs/transaction.h | |
parent | 3bf10418675cb424724b5cb9d7725b234defe1fd (diff) | |
download | kernel-common-f321e4910398cf7922265d269fb17fd26f312571.tar.gz kernel-common-f321e4910398cf7922265d269fb17fd26f312571.tar.bz2 kernel-common-f321e4910398cf7922265d269fb17fd26f312571.zip |
Btrfs: Update and fix mount -o nodatacow
To check whether a given file extent is referenced by multiple snapshots, the
checker walks down the fs tree through dead root and checks all tree blocks in
the path.
We can easily detect whether a given tree block is directly referenced by other
snapshot. We can also detect any indirect reference from other snapshot by
checking reference's generation. The checker can always detect multiple
references, but can't reliably detect cases of single reference. So btrfs may
do file data cow even there is only one reference.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r-- | fs/btrfs/transaction.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index df2ca2aad1c0..f5adb23151fb 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h @@ -52,6 +52,11 @@ struct btrfs_pending_snapshot { struct list_head list; }; +struct btrfs_dirty_root { + struct list_head list; + struct btrfs_root *root; + struct btrfs_root *latest_root; +}; static inline void btrfs_set_trans_block_group(struct btrfs_trans_handle *trans, struct inode *inode) |