mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 19:15:14 +00:00
btrfs: move commit out of sysfs when changing features
Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
d51033d055
commit
0eae2747ec
1 changed files with 5 additions and 8 deletions
|
@ -111,7 +111,6 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info;
|
struct btrfs_fs_info *fs_info;
|
||||||
struct btrfs_feature_attr *fa = to_btrfs_feature_attr(a);
|
struct btrfs_feature_attr *fa = to_btrfs_feature_attr(a);
|
||||||
struct btrfs_trans_handle *trans;
|
|
||||||
u64 features, set, clear;
|
u64 features, set, clear;
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -153,10 +152,6 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
|
||||||
btrfs_info(fs_info, "%s %s feature flag",
|
btrfs_info(fs_info, "%s %s feature flag",
|
||||||
val ? "Setting" : "Clearing", fa->kobj_attr.attr.name);
|
val ? "Setting" : "Clearing", fa->kobj_attr.attr.name);
|
||||||
|
|
||||||
trans = btrfs_start_transaction(fs_info->fs_root, 0);
|
|
||||||
if (IS_ERR(trans))
|
|
||||||
return PTR_ERR(trans);
|
|
||||||
|
|
||||||
spin_lock(&fs_info->super_lock);
|
spin_lock(&fs_info->super_lock);
|
||||||
features = get_features(fs_info, fa->feature_set);
|
features = get_features(fs_info, fa->feature_set);
|
||||||
if (val)
|
if (val)
|
||||||
|
@ -166,9 +161,11 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
|
||||||
set_features(fs_info, fa->feature_set, features);
|
set_features(fs_info, fa->feature_set, features);
|
||||||
spin_unlock(&fs_info->super_lock);
|
spin_unlock(&fs_info->super_lock);
|
||||||
|
|
||||||
ret = btrfs_commit_transaction(trans, fs_info->fs_root);
|
/*
|
||||||
if (ret)
|
* We don't want to do full transaction commit from inside sysfs
|
||||||
return ret;
|
*/
|
||||||
|
btrfs_set_pending(fs_info, COMMIT);
|
||||||
|
wake_up_process(fs_info->transaction_kthread);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue