diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 978c3a810893..43c6781af654 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -5498,6 +5498,21 @@ record: | |||
5498 | } | 5498 | } |
5499 | 5499 | ||
5500 | /* | 5500 | /* |
5501 | * Make sure that if someone attempts to fsync the parent directory of a deleted | ||
5502 | * snapshot, it ends up triggering a transaction commit. This is to guarantee | ||
5503 | * that after replaying the log tree of the parent directory's root we will not | ||
5504 | * see the snapshot anymore and at log replay time we will not see any log tree | ||
5505 | * corresponding to the deleted snapshot's root, which could lead to replaying | ||
5506 | * it after replaying the log tree of the parent directory (which would replay | ||
5507 | * the snapshot delete operation). | ||
5508 | */ | ||
5509 | void btrfs_record_snapshot_destroy(struct btrfs_trans_handle *trans, | ||
5510 | struct inode *dir) | ||
5511 | { | ||
5512 | BTRFS_I(dir)->last_unlink_trans = trans->transid; | ||
5513 | } | ||
5514 | |||
5515 | /* | ||
5501 | * Call this after adding a new name for a file and it will properly | 5516 | * Call this after adding a new name for a file and it will properly |
5502 | * update the log to reflect the new name. | 5517 | * update the log to reflect the new name. |
5503 | * | 5518 | * |