btrfs: introduce pending action: commit

In some contexts, like in sysfs handlers, we don't want to trigger a
transaction commit. It's a heavy operation, we don't know what external
locks may be taken. Instead, make it possible to finish the operation
through sync syscall or SYNC_FS ioctl.

Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
David Sterba
2014-11-12 14:24:35 +01:00
parent 7e1876aca8
commit d51033d055
2 changed files with 6 additions and 0 deletions

View File

@@ -2132,6 +2132,7 @@ struct btrfs_ioctl_defrag_range_args {
#define BTRFS_PENDING_SET_INODE_MAP_CACHE (0)
#define BTRFS_PENDING_CLEAR_INODE_MAP_CACHE (1)
#define BTRFS_PENDING_COMMIT (2)
#define btrfs_test_pending(info, opt) \
test_bit(BTRFS_PENDING_##opt, &(info)->pending_changes)