diff options
author | David Sterba <dsterba@suse.cz> | 2014-02-05 15:26:17 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-11-12 16:53:12 +0100 |
commit | 572d9ab7845ea0e043ec34cd733a75228130ad03 (patch) | |
tree | 0dcf250edd2859e3dd64b0b33f9694c3fd61c29b /fs/btrfs/transaction.c | |
parent | 206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff) | |
download | op-kernel-dev-572d9ab7845ea0e043ec34cd733a75228130ad03.zip op-kernel-dev-572d9ab7845ea0e043ec34cd733a75228130ad03.tar.gz |
btrfs: add support for processing pending changes
There are some actions that modify global filesystem state but cannot be
performed at the time of request, but later at the transaction commit
time when the filesystem is in a known state.
For example enabling new incompat features on-the-fly or issuing
transaction commit from unsafe contexts (sysfs handlers).
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index dcaae36..7a4024a 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1850,6 +1850,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, else btrfs_clear_opt(root->fs_info->mount_opt, INODE_MAP_CACHE); + btrfs_apply_pending_changes(root->fs_info); + /* commit_fs_roots gets rid of all the tree log roots, it is now * safe to free the root of tree log roots */ @@ -2019,3 +2021,17 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) return (ret < 0) ? 0 : 1; } + +void btrfs_apply_pending_changes(struct btrfs_fs_info *fs_info) +{ + unsigned long prev; + unsigned long bit; + + prev = cmpxchg(&fs_info->pending_changes, 0, 0); + if (!prev) + return; + + if (prev) + btrfs_warn(fs_info, + "unknown pending changes left 0x%lx, ignoring", prev); +} |