Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360412
b: refs/heads/master
c: c018dae
h: refs/heads/master
v: v3
  • Loading branch information
Miao Xie authored and Josef Bacik committed Feb 20, 2013
1 parent 638cdd3 commit d76cde9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c6a3ee6dbd564d05019d396ecb5dc5b35cbc273
refs/heads/master: c018daecead7a46a575e2a1397fea850b83396c8
10 changes: 10 additions & 0 deletions trunk/fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,16 @@ struct btrfs_fs_info {
* so it is also safe.
*/
u64 max_inline;
/*
* Protected by ->chunk_mutex and sb->s_umount.
*
* The reason that we use two lock to protect it is because only
* remount and mount operations can change it and these two operations
* are under sb->s_umount, but the read side (chunk allocation) can not
* acquire sb->s_umount or the deadlock would happen. So we use two
* locks to protect it. On the write side, we must acquire two locks,
* and on the read side, we just need acquire one of them.
*/
u64 alloc_start;
struct btrfs_transaction *running_transaction;
wait_queue_head_t transaction_throttle;
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
case Opt_alloc_start:
num = match_strdup(&args[0]);
if (num) {
mutex_lock(&info->chunk_mutex);
info->alloc_start = memparse(num, NULL);
mutex_unlock(&info->chunk_mutex);
kfree(num);
printk(KERN_INFO
"btrfs: allocations start at %llu\n",
Expand Down Expand Up @@ -1289,7 +1291,9 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
fs_info->mount_opt = old_opts;
fs_info->compress_type = old_compress_type;
fs_info->max_inline = old_max_inline;
mutex_lock(&fs_info->chunk_mutex);
fs_info->alloc_start = old_alloc_start;
mutex_unlock(&fs_info->chunk_mutex);
btrfs_resize_thread_pool(fs_info,
old_thread_pool_size, fs_info->thread_pool_size);
fs_info->metadata_ratio = old_metadata_ratio;
Expand Down

0 comments on commit d76cde9

Please sign in to comment.