diff options
Diffstat (limited to 'fs/btrfs')
| -rw-r--r-- | fs/btrfs/acl.c | 44 | ||||
| -rw-r--r-- | fs/btrfs/btrfs_inode.h | 4 | ||||
| -rw-r--r-- | fs/btrfs/compression.c | 1 | ||||
| -rw-r--r-- | fs/btrfs/ctree.h | 2 | ||||
| -rw-r--r-- | fs/btrfs/disk-io.c | 26 | ||||
| -rw-r--r-- | fs/btrfs/file.c | 1 | ||||
| -rw-r--r-- | fs/btrfs/inode.c | 47 | ||||
| -rw-r--r-- | fs/btrfs/ioctl.c | 1 | ||||
| -rw-r--r-- | fs/btrfs/super.c | 12 |
9 files changed, 46 insertions, 92 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 603972576f0f..f128427b995b 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -29,51 +29,28 @@ | |||
| 29 | 29 | ||
| 30 | #ifdef CONFIG_FS_POSIX_ACL | 30 | #ifdef CONFIG_FS_POSIX_ACL |
| 31 | 31 | ||
| 32 | static void btrfs_update_cached_acl(struct inode *inode, | ||
| 33 | struct posix_acl **p_acl, | ||
| 34 | struct posix_acl *acl) | ||
| 35 | { | ||
| 36 | spin_lock(&inode->i_lock); | ||
| 37 | if (*p_acl && *p_acl != BTRFS_ACL_NOT_CACHED) | ||
| 38 | posix_acl_release(*p_acl); | ||
| 39 | *p_acl = posix_acl_dup(acl); | ||
| 40 | spin_unlock(&inode->i_lock); | ||
| 41 | } | ||
| 42 | |||
| 43 | static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | 32 | static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) |
| 44 | { | 33 | { |
| 45 | int size; | 34 | int size; |
| 46 | const char *name; | 35 | const char *name; |
| 47 | char *value = NULL; | 36 | char *value = NULL; |
| 48 | struct posix_acl *acl = NULL, **p_acl; | 37 | struct posix_acl *acl; |
| 38 | |||
| 39 | acl = get_cached_acl(inode, type); | ||
| 40 | if (acl != ACL_NOT_CACHED) | ||
| 41 | return acl; | ||
| 49 | 42 | ||
| 50 | switch (type) { | 43 | switch (type) { |
| 51 | case ACL_TYPE_ACCESS: | 44 | case ACL_TYPE_ACCESS: |
| 52 | name = POSIX_ACL_XATTR_ACCESS; | 45 | name = POSIX_ACL_XATTR_ACCESS; |
| 53 | p_acl = &BTRFS_I(inode)->i_acl; | ||
| 54 | break; | 46 | break; |
| 55 | case ACL_TYPE_DEFAULT: | 47 | case ACL_TYPE_DEFAULT: |
| 56 | name = POSIX_ACL_XATTR_DEFAULT; | 48 | name = POSIX_ACL_XATTR_DEFAULT; |
| 57 | p_acl = &BTRFS_I(inode)->i_default_acl; | ||
| 58 | break; | 49 | break; |
| 59 | default: | 50 | default: |
| 60 | return ERR_PTR(-EINVAL); | 51 | BUG(); |
| 61 | } | 52 | } |
| 62 | 53 | ||
| 63 | /* Handle the cached NULL acl case without locking */ | ||
| 64 | acl = ACCESS_ONCE(*p_acl); | ||
| 65 | if (!acl) | ||
| 66 | return acl; | ||
| 67 | |||
| 68 | spin_lock(&inode->i_lock); | ||
| 69 | acl = *p_acl; | ||
| 70 | if (acl != BTRFS_ACL_NOT_CACHED) | ||
| 71 | acl = posix_acl_dup(acl); | ||
| 72 | spin_unlock(&inode->i_lock); | ||
| 73 | |||
| 74 | if (acl != BTRFS_ACL_NOT_CACHED) | ||
| 75 | return acl; | ||
| 76 | |||
| 77 | size = __btrfs_getxattr(inode, name, "", 0); | 54 | size = __btrfs_getxattr(inode, name, "", 0); |
| 78 | if (size > 0) { | 55 | if (size > 0) { |
| 79 | value = kzalloc(size, GFP_NOFS); | 56 | value = kzalloc(size, GFP_NOFS); |
| @@ -82,13 +59,13 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
| 82 | size = __btrfs_getxattr(inode, name, value, size); | 59 | size = __btrfs_getxattr(inode, name, value, size); |
| 83 | if (size > 0) { | 60 | if (size > 0) { |
| 84 | acl = posix_acl_from_xattr(value, size); | 61 | acl = posix_acl_from_xattr(value, size); |
| 85 | btrfs_update_cached_acl(inode, p_acl, acl); | 62 | set_cached_acl(inode, type, acl); |
| 86 | } | 63 | } |
| 87 | kfree(value); | 64 | kfree(value); |
| 88 | } else if (size == -ENOENT || size == -ENODATA || size == 0) { | 65 | } else if (size == -ENOENT || size == -ENODATA || size == 0) { |
| 89 | /* FIXME, who returns -ENOENT? I think nobody */ | 66 | /* FIXME, who returns -ENOENT? I think nobody */ |
| 90 | acl = NULL; | 67 | acl = NULL; |
| 91 | btrfs_update_cached_acl(inode, p_acl, acl); | 68 | set_cached_acl(inode, type, acl); |
| 92 | } else { | 69 | } else { |
| 93 | acl = ERR_PTR(-EIO); | 70 | acl = ERR_PTR(-EIO); |
| 94 | } | 71 | } |
| @@ -121,7 +98,6 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
| 121 | { | 98 | { |
| 122 | int ret, size = 0; | 99 | int ret, size = 0; |
| 123 | const char *name; | 100 | const char *name; |
| 124 | struct posix_acl **p_acl; | ||
| 125 | char *value = NULL; | 101 | char *value = NULL; |
| 126 | mode_t mode; | 102 | mode_t mode; |
| 127 | 103 | ||
| @@ -141,13 +117,11 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type) | |||
| 141 | ret = 0; | 117 | ret = 0; |
| 142 | inode->i_mode = mode; | 118 | inode->i_mode = mode; |
| 143 | name = POSIX_ACL_XATTR_ACCESS; | 119 | name = POSIX_ACL_XATTR_ACCESS; |
| 144 | p_acl = &BTRFS_I(inode)->i_acl; | ||
| 145 | break; | 120 | break; |
| 146 | case ACL_TYPE_DEFAULT: | 121 | case ACL_TYPE_DEFAULT: |
| 147 | if (!S_ISDIR(inode->i_mode)) | 122 | if (!S_ISDIR(inode->i_mode)) |
| 148 | return acl ? -EINVAL : 0; | 123 | return acl ? -EINVAL : 0; |
| 149 | name = POSIX_ACL_XATTR_DEFAULT; | 124 | name = POSIX_ACL_XATTR_DEFAULT; |
| 150 | p_acl = &BTRFS_I(inode)->i_default_acl; | ||
| 151 | break; | 125 | break; |
| 152 | default: | 126 | default: |
| 153 | return -EINVAL; | 127 | return -EINVAL; |
| @@ -172,7 +146,7 @@ out: | |||
| 172 | kfree(value); | 146 | kfree(value); |
| 173 | 147 | ||
| 174 | if (!ret) | 148 | if (!ret) |
| 175 | btrfs_update_cached_acl(inode, p_acl, acl); | 149 | set_cached_acl(inode, type, acl); |
| 176 | 150 | ||
| 177 | return ret; | 151 | return ret; |
| 178 | } | 152 | } |
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index acb4f3517582..ea1ea0af8c0e 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
| @@ -53,10 +53,6 @@ struct btrfs_inode { | |||
| 53 | /* used to order data wrt metadata */ | 53 | /* used to order data wrt metadata */ |
| 54 | struct btrfs_ordered_inode_tree ordered_tree; | 54 | struct btrfs_ordered_inode_tree ordered_tree; |
| 55 | 55 | ||
| 56 | /* standard acl pointers */ | ||
| 57 | struct posix_acl *i_acl; | ||
| 58 | struct posix_acl *i_default_acl; | ||
| 59 | |||
| 60 | /* for keeping track of orphaned inodes */ | 56 | /* for keeping track of orphaned inodes */ |
| 61 | struct list_head i_orphan; | 57 | struct list_head i_orphan; |
| 62 | 58 | ||
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 78451a58f209..a11a32058b50 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/time.h> | 26 | #include <linux/time.h> |
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
| 29 | #include <linux/smp_lock.h> | ||
| 30 | #include <linux/backing-dev.h> | 29 | #include <linux/backing-dev.h> |
| 31 | #include <linux/mpage.h> | 30 | #include <linux/mpage.h> |
| 32 | #include <linux/swap.h> | 31 | #include <linux/swap.h> |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1ceab8b4d6dc..732d5b884aa7 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
| @@ -41,8 +41,6 @@ struct btrfs_ordered_sum; | |||
| 41 | 41 | ||
| 42 | #define BTRFS_MAGIC "_BHRfS_M" | 42 | #define BTRFS_MAGIC "_BHRfS_M" |
| 43 | 43 | ||
| 44 | #define BTRFS_ACL_NOT_CACHED ((void *)-1) | ||
| 45 | |||
| 46 | #define BTRFS_MAX_LEVEL 8 | 44 | #define BTRFS_MAX_LEVEL 8 |
| 47 | 45 | ||
| 48 | #define BTRFS_COMPAT_EXTENT_TREE_V0 | 46 | #define BTRFS_COMPAT_EXTENT_TREE_V0 |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index b6cfdd9164e2..253da7e01ab3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -42,6 +42,8 @@ | |||
| 42 | static struct extent_io_ops btree_extent_io_ops; | 42 | static struct extent_io_ops btree_extent_io_ops; |
| 43 | static void end_workqueue_fn(struct btrfs_work *work); | 43 | static void end_workqueue_fn(struct btrfs_work *work); |
| 44 | 44 | ||
| 45 | static atomic_t btrfs_bdi_num = ATOMIC_INIT(0); | ||
| 46 | |||
| 45 | /* | 47 | /* |
| 46 | * end_io_wq structs are used to do processing in task context when an IO is | 48 | * end_io_wq structs are used to do processing in task context when an IO is |
| 47 | * complete. This is used during reads to verify checksums, and it is used | 49 | * complete. This is used during reads to verify checksums, and it is used |
| @@ -1342,12 +1344,25 @@ static void btrfs_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | |||
| 1342 | free_extent_map(em); | 1344 | free_extent_map(em); |
| 1343 | } | 1345 | } |
| 1344 | 1346 | ||
| 1347 | /* | ||
| 1348 | * If this fails, caller must call bdi_destroy() to get rid of the | ||
| 1349 | * bdi again. | ||
| 1350 | */ | ||
| 1345 | static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) | 1351 | static int setup_bdi(struct btrfs_fs_info *info, struct backing_dev_info *bdi) |
| 1346 | { | 1352 | { |
| 1347 | bdi_init(bdi); | 1353 | int err; |
| 1354 | |||
| 1355 | bdi->capabilities = BDI_CAP_MAP_COPY; | ||
| 1356 | err = bdi_init(bdi); | ||
| 1357 | if (err) | ||
| 1358 | return err; | ||
| 1359 | |||
| 1360 | err = bdi_register(bdi, NULL, "btrfs-%d", | ||
| 1361 | atomic_inc_return(&btrfs_bdi_num)); | ||
| 1362 | if (err) | ||
| 1363 | return err; | ||
| 1364 | |||
| 1348 | bdi->ra_pages = default_backing_dev_info.ra_pages; | 1365 | bdi->ra_pages = default_backing_dev_info.ra_pages; |
| 1349 | bdi->state = 0; | ||
| 1350 | bdi->capabilities = default_backing_dev_info.capabilities; | ||
| 1351 | bdi->unplug_io_fn = btrfs_unplug_io_fn; | 1366 | bdi->unplug_io_fn = btrfs_unplug_io_fn; |
| 1352 | bdi->unplug_io_data = info; | 1367 | bdi->unplug_io_data = info; |
| 1353 | bdi->congested_fn = btrfs_congested_fn; | 1368 | bdi->congested_fn = btrfs_congested_fn; |
| @@ -1569,7 +1584,8 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1569 | fs_info->sb = sb; | 1584 | fs_info->sb = sb; |
| 1570 | fs_info->max_extent = (u64)-1; | 1585 | fs_info->max_extent = (u64)-1; |
| 1571 | fs_info->max_inline = 8192 * 1024; | 1586 | fs_info->max_inline = 8192 * 1024; |
| 1572 | setup_bdi(fs_info, &fs_info->bdi); | 1587 | if (setup_bdi(fs_info, &fs_info->bdi)) |
| 1588 | goto fail_bdi; | ||
| 1573 | fs_info->btree_inode = new_inode(sb); | 1589 | fs_info->btree_inode = new_inode(sb); |
| 1574 | fs_info->btree_inode->i_ino = 1; | 1590 | fs_info->btree_inode->i_ino = 1; |
| 1575 | fs_info->btree_inode->i_nlink = 1; | 1591 | fs_info->btree_inode->i_nlink = 1; |
| @@ -1959,8 +1975,8 @@ fail_iput: | |||
| 1959 | 1975 | ||
| 1960 | btrfs_close_devices(fs_info->fs_devices); | 1976 | btrfs_close_devices(fs_info->fs_devices); |
| 1961 | btrfs_mapping_tree_free(&fs_info->mapping_tree); | 1977 | btrfs_mapping_tree_free(&fs_info->mapping_tree); |
| 1978 | fail_bdi: | ||
| 1962 | bdi_destroy(&fs_info->bdi); | 1979 | bdi_destroy(&fs_info->bdi); |
| 1963 | |||
| 1964 | fail: | 1980 | fail: |
| 1965 | kfree(extent_root); | 1981 | kfree(extent_root); |
| 1966 | kfree(tree_root); | 1982 | kfree(tree_root); |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 4123db9d5141..571ad3c13b47 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/time.h> | 22 | #include <linux/time.h> |
| 23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
| 24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
| 25 | #include <linux/smp_lock.h> | ||
| 26 | #include <linux/backing-dev.h> | 25 | #include <linux/backing-dev.h> |
| 27 | #include <linux/mpage.h> | 26 | #include <linux/mpage.h> |
| 28 | #include <linux/swap.h> | 27 | #include <linux/swap.h> |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 88f9df7bfdae..941f1b71cd22 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/time.h> | 26 | #include <linux/time.h> |
| 27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
| 28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
| 29 | #include <linux/smp_lock.h> | ||
| 30 | #include <linux/backing-dev.h> | 29 | #include <linux/backing-dev.h> |
| 31 | #include <linux/mpage.h> | 30 | #include <linux/mpage.h> |
| 32 | #include <linux/swap.h> | 31 | #include <linux/swap.h> |
| @@ -2135,10 +2134,8 @@ static void btrfs_read_locked_inode(struct inode *inode) | |||
| 2135 | * any xattrs or acls | 2134 | * any xattrs or acls |
| 2136 | */ | 2135 | */ |
| 2137 | maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino); | 2136 | maybe_acls = acls_after_inode_item(leaf, path->slots[0], inode->i_ino); |
| 2138 | if (!maybe_acls) { | 2137 | if (!maybe_acls) |
| 2139 | BTRFS_I(inode)->i_acl = NULL; | 2138 | cache_no_acl(inode); |
| 2140 | BTRFS_I(inode)->i_default_acl = NULL; | ||
| 2141 | } | ||
| 2142 | 2139 | ||
| 2143 | BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0, | 2140 | BTRFS_I(inode)->block_group = btrfs_find_block_group(root, 0, |
| 2144 | alloc_group_block, 0); | 2141 | alloc_group_block, 0); |
| @@ -2335,7 +2332,6 @@ err: | |||
| 2335 | btrfs_update_inode(trans, root, dir); | 2332 | btrfs_update_inode(trans, root, dir); |
| 2336 | btrfs_drop_nlink(inode); | 2333 | btrfs_drop_nlink(inode); |
| 2337 | ret = btrfs_update_inode(trans, root, inode); | 2334 | ret = btrfs_update_inode(trans, root, inode); |
| 2338 | dir->i_sb->s_dirt = 1; | ||
| 2339 | out: | 2335 | out: |
| 2340 | return ret; | 2336 | return ret; |
| 2341 | } | 2337 | } |
| @@ -2819,7 +2815,6 @@ error: | |||
| 2819 | pending_del_nr); | 2815 | pending_del_nr); |
| 2820 | } | 2816 | } |
| 2821 | btrfs_free_path(path); | 2817 | btrfs_free_path(path); |
| 2822 | inode->i_sb->s_dirt = 1; | ||
| 2823 | return ret; | 2818 | return ret; |
| 2824 | } | 2819 | } |
| 2825 | 2820 | ||
| @@ -3117,8 +3112,12 @@ static void inode_tree_add(struct inode *inode) | |||
| 3117 | { | 3112 | { |
| 3118 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3113 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 3119 | struct btrfs_inode *entry; | 3114 | struct btrfs_inode *entry; |
| 3120 | struct rb_node **p = &root->inode_tree.rb_node; | 3115 | struct rb_node **p; |
| 3121 | struct rb_node *parent = NULL; | 3116 | struct rb_node *parent; |
| 3117 | |||
| 3118 | again: | ||
| 3119 | p = &root->inode_tree.rb_node; | ||
| 3120 | parent = NULL; | ||
| 3122 | 3121 | ||
| 3123 | spin_lock(&root->inode_lock); | 3122 | spin_lock(&root->inode_lock); |
| 3124 | while (*p) { | 3123 | while (*p) { |
| @@ -3126,13 +3125,16 @@ static void inode_tree_add(struct inode *inode) | |||
| 3126 | entry = rb_entry(parent, struct btrfs_inode, rb_node); | 3125 | entry = rb_entry(parent, struct btrfs_inode, rb_node); |
| 3127 | 3126 | ||
| 3128 | if (inode->i_ino < entry->vfs_inode.i_ino) | 3127 | if (inode->i_ino < entry->vfs_inode.i_ino) |
| 3129 | p = &(*p)->rb_left; | 3128 | p = &parent->rb_left; |
| 3130 | else if (inode->i_ino > entry->vfs_inode.i_ino) | 3129 | else if (inode->i_ino > entry->vfs_inode.i_ino) |
| 3131 | p = &(*p)->rb_right; | 3130 | p = &parent->rb_right; |
| 3132 | else { | 3131 | else { |
| 3133 | WARN_ON(!(entry->vfs_inode.i_state & | 3132 | WARN_ON(!(entry->vfs_inode.i_state & |
| 3134 | (I_WILL_FREE | I_FREEING | I_CLEAR))); | 3133 | (I_WILL_FREE | I_FREEING | I_CLEAR))); |
| 3135 | break; | 3134 | rb_erase(parent, &root->inode_tree); |
| 3135 | RB_CLEAR_NODE(parent); | ||
| 3136 | spin_unlock(&root->inode_lock); | ||
| 3137 | goto again; | ||
| 3136 | } | 3138 | } |
| 3137 | } | 3139 | } |
| 3138 | rb_link_node(&BTRFS_I(inode)->rb_node, parent, p); | 3140 | rb_link_node(&BTRFS_I(inode)->rb_node, parent, p); |
| @@ -3144,21 +3146,18 @@ static void inode_tree_del(struct inode *inode) | |||
| 3144 | { | 3146 | { |
| 3145 | struct btrfs_root *root = BTRFS_I(inode)->root; | 3147 | struct btrfs_root *root = BTRFS_I(inode)->root; |
| 3146 | 3148 | ||
| 3149 | spin_lock(&root->inode_lock); | ||
| 3147 | if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { | 3150 | if (!RB_EMPTY_NODE(&BTRFS_I(inode)->rb_node)) { |
| 3148 | spin_lock(&root->inode_lock); | ||
| 3149 | rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); | 3151 | rb_erase(&BTRFS_I(inode)->rb_node, &root->inode_tree); |
| 3150 | spin_unlock(&root->inode_lock); | ||
| 3151 | RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); | 3152 | RB_CLEAR_NODE(&BTRFS_I(inode)->rb_node); |
| 3152 | } | 3153 | } |
| 3154 | spin_unlock(&root->inode_lock); | ||
| 3153 | } | 3155 | } |
| 3154 | 3156 | ||
| 3155 | static noinline void init_btrfs_i(struct inode *inode) | 3157 | static noinline void init_btrfs_i(struct inode *inode) |
| 3156 | { | 3158 | { |
| 3157 | struct btrfs_inode *bi = BTRFS_I(inode); | 3159 | struct btrfs_inode *bi = BTRFS_I(inode); |
| 3158 | 3160 | ||
| 3159 | bi->i_acl = BTRFS_ACL_NOT_CACHED; | ||
| 3160 | bi->i_default_acl = BTRFS_ACL_NOT_CACHED; | ||
| 3161 | |||
| 3162 | bi->generation = 0; | 3161 | bi->generation = 0; |
| 3163 | bi->sequence = 0; | 3162 | bi->sequence = 0; |
| 3164 | bi->last_trans = 0; | 3163 | bi->last_trans = 0; |
| @@ -3782,7 +3781,6 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry, | |||
| 3782 | init_special_inode(inode, inode->i_mode, rdev); | 3781 | init_special_inode(inode, inode->i_mode, rdev); |
| 3783 | btrfs_update_inode(trans, root, inode); | 3782 | btrfs_update_inode(trans, root, inode); |
| 3784 | } | 3783 | } |
| 3785 | dir->i_sb->s_dirt = 1; | ||
| 3786 | btrfs_update_inode_block_group(trans, inode); | 3784 | btrfs_update_inode_block_group(trans, inode); |
| 3787 | btrfs_update_inode_block_group(trans, dir); | 3785 | btrfs_update_inode_block_group(trans, dir); |
| 3788 | out_unlock: | 3786 | out_unlock: |
| @@ -3847,7 +3845,6 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry, | |||
| 3847 | inode->i_op = &btrfs_file_inode_operations; | 3845 | inode->i_op = &btrfs_file_inode_operations; |
| 3848 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; | 3846 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; |
| 3849 | } | 3847 | } |
| 3850 | dir->i_sb->s_dirt = 1; | ||
| 3851 | btrfs_update_inode_block_group(trans, inode); | 3848 | btrfs_update_inode_block_group(trans, inode); |
| 3852 | btrfs_update_inode_block_group(trans, dir); | 3849 | btrfs_update_inode_block_group(trans, dir); |
| 3853 | out_unlock: | 3850 | out_unlock: |
| @@ -3894,7 +3891,6 @@ static int btrfs_link(struct dentry *old_dentry, struct inode *dir, | |||
| 3894 | if (err) | 3891 | if (err) |
| 3895 | drop_inode = 1; | 3892 | drop_inode = 1; |
| 3896 | 3893 | ||
| 3897 | dir->i_sb->s_dirt = 1; | ||
| 3898 | btrfs_update_inode_block_group(trans, dir); | 3894 | btrfs_update_inode_block_group(trans, dir); |
| 3899 | err = btrfs_update_inode(trans, root, inode); | 3895 | err = btrfs_update_inode(trans, root, inode); |
| 3900 | 3896 | ||
| @@ -3976,7 +3972,6 @@ static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
| 3976 | 3972 | ||
| 3977 | d_instantiate(dentry, inode); | 3973 | d_instantiate(dentry, inode); |
| 3978 | drop_on_err = 0; | 3974 | drop_on_err = 0; |
| 3979 | dir->i_sb->s_dirt = 1; | ||
| 3980 | btrfs_update_inode_block_group(trans, inode); | 3975 | btrfs_update_inode_block_group(trans, inode); |
| 3981 | btrfs_update_inode_block_group(trans, dir); | 3976 | btrfs_update_inode_block_group(trans, dir); |
| 3982 | 3977 | ||
| @@ -4681,8 +4676,6 @@ struct inode *btrfs_alloc_inode(struct super_block *sb) | |||
| 4681 | ei->last_trans = 0; | 4676 | ei->last_trans = 0; |
| 4682 | ei->logged_trans = 0; | 4677 | ei->logged_trans = 0; |
| 4683 | btrfs_ordered_inode_tree_init(&ei->ordered_tree); | 4678 | btrfs_ordered_inode_tree_init(&ei->ordered_tree); |
| 4684 | ei->i_acl = BTRFS_ACL_NOT_CACHED; | ||
| 4685 | ei->i_default_acl = BTRFS_ACL_NOT_CACHED; | ||
| 4686 | INIT_LIST_HEAD(&ei->i_orphan); | 4679 | INIT_LIST_HEAD(&ei->i_orphan); |
| 4687 | INIT_LIST_HEAD(&ei->ordered_operations); | 4680 | INIT_LIST_HEAD(&ei->ordered_operations); |
| 4688 | return &ei->vfs_inode; | 4681 | return &ei->vfs_inode; |
| @@ -4696,13 +4689,6 @@ void btrfs_destroy_inode(struct inode *inode) | |||
| 4696 | WARN_ON(!list_empty(&inode->i_dentry)); | 4689 | WARN_ON(!list_empty(&inode->i_dentry)); |
| 4697 | WARN_ON(inode->i_data.nrpages); | 4690 | WARN_ON(inode->i_data.nrpages); |
| 4698 | 4691 | ||
| 4699 | if (BTRFS_I(inode)->i_acl && | ||
| 4700 | BTRFS_I(inode)->i_acl != BTRFS_ACL_NOT_CACHED) | ||
| 4701 | posix_acl_release(BTRFS_I(inode)->i_acl); | ||
| 4702 | if (BTRFS_I(inode)->i_default_acl && | ||
| 4703 | BTRFS_I(inode)->i_default_acl != BTRFS_ACL_NOT_CACHED) | ||
| 4704 | posix_acl_release(BTRFS_I(inode)->i_default_acl); | ||
| 4705 | |||
| 4706 | /* | 4692 | /* |
| 4707 | * Make sure we're properly removed from the ordered operation | 4693 | * Make sure we're properly removed from the ordered operation |
| 4708 | * lists. | 4694 | * lists. |
| @@ -5025,7 +5011,6 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry, | |||
| 5025 | inode->i_op = &btrfs_file_inode_operations; | 5011 | inode->i_op = &btrfs_file_inode_operations; |
| 5026 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; | 5012 | BTRFS_I(inode)->io_tree.ops = &btrfs_extent_io_ops; |
| 5027 | } | 5013 | } |
| 5028 | dir->i_sb->s_dirt = 1; | ||
| 5029 | btrfs_update_inode_block_group(trans, inode); | 5014 | btrfs_update_inode_block_group(trans, inode); |
| 5030 | btrfs_update_inode_block_group(trans, dir); | 5015 | btrfs_update_inode_block_group(trans, dir); |
| 5031 | if (drop_inode) | 5016 | if (drop_inode) |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e2d8e90259b0..ef0188fb3cc4 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -27,7 +27,6 @@ | |||
| 27 | #include <linux/time.h> | 27 | #include <linux/time.h> |
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
| 30 | #include <linux/smp_lock.h> | ||
| 31 | #include <linux/backing-dev.h> | 30 | #include <linux/backing-dev.h> |
| 32 | #include <linux/mount.h> | 31 | #include <linux/mount.h> |
| 33 | #include <linux/mpage.h> | 32 | #include <linux/mpage.h> |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 708ac06b953b..6d6d06cb6dfc 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/init.h> | 26 | #include <linux/init.h> |
| 27 | #include <linux/seq_file.h> | 27 | #include <linux/seq_file.h> |
| 28 | #include <linux/string.h> | 28 | #include <linux/string.h> |
| 29 | #include <linux/smp_lock.h> | ||
| 30 | #include <linux/backing-dev.h> | 29 | #include <linux/backing-dev.h> |
| 31 | #include <linux/mount.h> | 30 | #include <linux/mount.h> |
| 32 | #include <linux/mpage.h> | 31 | #include <linux/mpage.h> |
| @@ -394,10 +393,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
| 394 | struct btrfs_root *root = btrfs_sb(sb); | 393 | struct btrfs_root *root = btrfs_sb(sb); |
| 395 | int ret; | 394 | int ret; |
| 396 | 395 | ||
| 397 | if (sb->s_flags & MS_RDONLY) | ||
| 398 | return 0; | ||
| 399 | |||
| 400 | sb->s_dirt = 0; | ||
| 401 | if (!wait) { | 396 | if (!wait) { |
| 402 | filemap_flush(root->fs_info->btree_inode->i_mapping); | 397 | filemap_flush(root->fs_info->btree_inode->i_mapping); |
| 403 | return 0; | 398 | return 0; |
| @@ -408,7 +403,6 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
| 408 | 403 | ||
| 409 | trans = btrfs_start_transaction(root, 1); | 404 | trans = btrfs_start_transaction(root, 1); |
| 410 | ret = btrfs_commit_transaction(trans, root); | 405 | ret = btrfs_commit_transaction(trans, root); |
| 411 | sb->s_dirt = 0; | ||
| 412 | return ret; | 406 | return ret; |
| 413 | } | 407 | } |
| 414 | 408 | ||
| @@ -454,11 +448,6 @@ static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
| 454 | return 0; | 448 | return 0; |
| 455 | } | 449 | } |
| 456 | 450 | ||
| 457 | static void btrfs_write_super(struct super_block *sb) | ||
| 458 | { | ||
| 459 | sb->s_dirt = 0; | ||
| 460 | } | ||
| 461 | |||
| 462 | static int btrfs_test_super(struct super_block *s, void *data) | 451 | static int btrfs_test_super(struct super_block *s, void *data) |
| 463 | { | 452 | { |
| 464 | struct btrfs_fs_devices *test_fs_devices = data; | 453 | struct btrfs_fs_devices *test_fs_devices = data; |
| @@ -689,7 +678,6 @@ static int btrfs_unfreeze(struct super_block *sb) | |||
| 689 | static struct super_operations btrfs_super_ops = { | 678 | static struct super_operations btrfs_super_ops = { |
| 690 | .delete_inode = btrfs_delete_inode, | 679 | .delete_inode = btrfs_delete_inode, |
| 691 | .put_super = btrfs_put_super, | 680 | .put_super = btrfs_put_super, |
| 692 | .write_super = btrfs_write_super, | ||
| 693 | .sync_fs = btrfs_sync_fs, | 681 | .sync_fs = btrfs_sync_fs, |
| 694 | .show_options = btrfs_show_options, | 682 | .show_options = btrfs_show_options, |
| 695 | .write_inode = btrfs_write_inode, | 683 | .write_inode = btrfs_write_inode, |
