summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2014-11-12 16:24:35 +0300
committerDavid Sterba <dsterba@suse.cz>2014-11-12 18:53:14 +0300
commitd51033d05547675f898ce4233a7d8d1a0dfe2984 (patch)
treedbdf9ce4507515b1305ee354d6e968ab3aa01b15 /fs/btrfs/transaction.c
parent7e1876aca815029d5c3023a66a91e249eca3e533 (diff)
downloadlinux-d51033d05547675f898ce4233a7d8d1a0dfe2984.tar.xz
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>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 703238ed7337..9d8e2b8d12b4 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2036,6 +2036,11 @@ void btrfs_apply_pending_changes(struct btrfs_fs_info *fs_info)
btrfs_clear_opt(fs_info->mount_opt, INODE_MAP_CACHE);
prev &= ~bit;
+ bit = 1 << BTRFS_PENDING_COMMIT;
+ if (prev & bit)
+ btrfs_debug(fs_info, "pending commit done");
+ prev &= ~bit;
+
if (prev)
btrfs_warn(fs_info,
"unknown pending changes left 0x%lx, ignoring", prev);