diff options
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 96eb9fef7bd2..e23991574fdf 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include "version.h" | 54 | #include "version.h" |
55 | #include "export.h" | 55 | #include "export.h" |
56 | #include "compression.h" | 56 | #include "compression.h" |
57 | #include "rcu-string.h" | ||
57 | 58 | ||
58 | #define CREATE_TRACE_POINTS | 59 | #define CREATE_TRACE_POINTS |
59 | #include <trace/events/btrfs.h> | 60 | #include <trace/events/btrfs.h> |
@@ -1186,6 +1187,10 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) | |||
1186 | if (ret) | 1187 | if (ret) |
1187 | goto restore; | 1188 | goto restore; |
1188 | 1189 | ||
1190 | ret = btrfs_resume_balance_async(fs_info); | ||
1191 | if (ret) | ||
1192 | goto restore; | ||
1193 | |||
1189 | sb->s_flags &= ~MS_RDONLY; | 1194 | sb->s_flags &= ~MS_RDONLY; |
1190 | } | 1195 | } |
1191 | 1196 | ||
@@ -1482,12 +1487,44 @@ static void btrfs_fs_dirty_inode(struct inode *inode, int flags) | |||
1482 | "error %d\n", btrfs_ino(inode), ret); | 1487 | "error %d\n", btrfs_ino(inode), ret); |
1483 | } | 1488 | } |
1484 | 1489 | ||
1490 | static int btrfs_show_devname(struct seq_file *m, struct dentry *root) | ||
1491 | { | ||
1492 | struct btrfs_fs_info *fs_info = btrfs_sb(root->d_sb); | ||
1493 | struct btrfs_fs_devices *cur_devices; | ||
1494 | struct btrfs_device *dev, *first_dev = NULL; | ||
1495 | struct list_head *head; | ||
1496 | struct rcu_string *name; | ||
1497 | |||
1498 | mutex_lock(&fs_info->fs_devices->device_list_mutex); | ||
1499 | cur_devices = fs_info->fs_devices; | ||
1500 | while (cur_devices) { | ||
1501 | head = &cur_devices->devices; | ||
1502 | list_for_each_entry(dev, head, dev_list) { | ||
1503 | if (!first_dev || dev->devid < first_dev->devid) | ||
1504 | first_dev = dev; | ||
1505 | } | ||
1506 | cur_devices = cur_devices->seed; | ||
1507 | } | ||
1508 | |||
1509 | if (first_dev) { | ||
1510 | rcu_read_lock(); | ||
1511 | name = rcu_dereference(first_dev->name); | ||
1512 | seq_escape(m, name->str, " \t\n\\"); | ||
1513 | rcu_read_unlock(); | ||
1514 | } else { | ||
1515 | WARN_ON(1); | ||
1516 | } | ||
1517 | mutex_unlock(&fs_info->fs_devices->device_list_mutex); | ||
1518 | return 0; | ||
1519 | } | ||
1520 | |||
1485 | static const struct super_operations btrfs_super_ops = { | 1521 | static const struct super_operations btrfs_super_ops = { |
1486 | .drop_inode = btrfs_drop_inode, | 1522 | .drop_inode = btrfs_drop_inode, |
1487 | .evict_inode = btrfs_evict_inode, | 1523 | .evict_inode = btrfs_evict_inode, |
1488 | .put_super = btrfs_put_super, | 1524 | .put_super = btrfs_put_super, |
1489 | .sync_fs = btrfs_sync_fs, | 1525 | .sync_fs = btrfs_sync_fs, |
1490 | .show_options = btrfs_show_options, | 1526 | .show_options = btrfs_show_options, |
1527 | .show_devname = btrfs_show_devname, | ||
1491 | .write_inode = btrfs_write_inode, | 1528 | .write_inode = btrfs_write_inode, |
1492 | .dirty_inode = btrfs_fs_dirty_inode, | 1529 | .dirty_inode = btrfs_fs_dirty_inode, |
1493 | .alloc_inode = btrfs_alloc_inode, | 1530 | .alloc_inode = btrfs_alloc_inode, |