Commit 878a876b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
 "Filipe is fixing compile and boot problems with our crc32c rework, and
  Josef has disabled snapshot aware defrag for now.

  As the number of snapshots increases, we're hitting OOM.  For the
  short term we're disabling things until a bigger fix is ready"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
  Btrfs: use late_initcall instead of module_init
  Btrfs: use btrfs_crc32c everywhere instead of libcrc32c
  Btrfs: disable snapshot aware defrag for now
parents d7512f79 60efa5eb
...@@ -92,11 +92,11 @@ ...@@ -92,11 +92,11 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/crc32c.h>
#include <linux/genhd.h> #include <linux/genhd.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include "ctree.h" #include "ctree.h"
#include "disk-io.h" #include "disk-io.h"
#include "hash.h"
#include "transaction.h" #include "transaction.h"
#include "extent_io.h" #include "extent_io.h"
#include "volumes.h" #include "volumes.h"
...@@ -1823,7 +1823,7 @@ static int btrfsic_test_for_metadata(struct btrfsic_state *state, ...@@ -1823,7 +1823,7 @@ static int btrfsic_test_for_metadata(struct btrfsic_state *state,
size_t sublen = i ? PAGE_CACHE_SIZE : size_t sublen = i ? PAGE_CACHE_SIZE :
(PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE); (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE);
crc = crc32c(crc, data, sublen); crc = btrfs_crc32c(crc, data, sublen);
} }
btrfs_csum_final(crc, csum); btrfs_csum_final(crc, csum);
if (memcmp(csum, h->csum, state->csum_size)) if (memcmp(csum, h->csum, state->csum_size))
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/crc32c.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/migrate.h> #include <linux/migrate.h>
#include <linux/ratelimit.h> #include <linux/ratelimit.h>
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include "ctree.h" #include "ctree.h"
#include "disk-io.h" #include "disk-io.h"
#include "hash.h"
#include "transaction.h" #include "transaction.h"
#include "btrfs_inode.h" #include "btrfs_inode.h"
#include "volumes.h" #include "volumes.h"
...@@ -244,7 +244,7 @@ static struct extent_map *btree_get_extent(struct inode *inode, ...@@ -244,7 +244,7 @@ static struct extent_map *btree_get_extent(struct inode *inode,
u32 btrfs_csum_data(char *data, u32 seed, size_t len) u32 btrfs_csum_data(char *data, u32 seed, size_t len)
{ {
return crc32c(seed, data, len); return btrfs_crc32c(seed, data, len);
} }
void btrfs_csum_final(u32 crc, char *result) void btrfs_csum_final(u32 crc, char *result)
......
...@@ -2629,7 +2629,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) ...@@ -2629,7 +2629,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
EXTENT_DEFRAG, 1, cached_state); EXTENT_DEFRAG, 1, cached_state);
if (ret) { if (ret) {
u64 last_snapshot = btrfs_root_last_snapshot(&root->root_item); u64 last_snapshot = btrfs_root_last_snapshot(&root->root_item);
if (last_snapshot >= BTRFS_I(inode)->generation) if (0 && last_snapshot >= BTRFS_I(inode)->generation)
/* the inode is shared */ /* the inode is shared */
new = record_old_file_extents(inode, ordered_extent); new = record_old_file_extents(inode, ordered_extent);
......
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
#include <linux/xattr.h> #include <linux/xattr.h>
#include <linux/posix_acl_xattr.h> #include <linux/posix_acl_xattr.h>
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
#include <linux/crc32c.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/string.h> #include <linux/string.h>
#include "send.h" #include "send.h"
#include "backref.h" #include "backref.h"
#include "hash.h"
#include "locking.h" #include "locking.h"
#include "disk-io.h" #include "disk-io.h"
#include "btrfs_inode.h" #include "btrfs_inode.h"
...@@ -620,7 +620,7 @@ static int send_cmd(struct send_ctx *sctx) ...@@ -620,7 +620,7 @@ static int send_cmd(struct send_ctx *sctx)
hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr)); hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr));
hdr->crc = 0; hdr->crc = 0;
crc = crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); crc = btrfs_crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size);
hdr->crc = cpu_to_le32(crc); hdr->crc = cpu_to_le32(crc);
ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size, ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size,
......
...@@ -1996,7 +1996,7 @@ static void __exit exit_btrfs_fs(void) ...@@ -1996,7 +1996,7 @@ static void __exit exit_btrfs_fs(void)
btrfs_hash_exit(); btrfs_hash_exit();
} }
module_init(init_btrfs_fs) late_initcall(init_btrfs_fs);
module_exit(exit_btrfs_fs) module_exit(exit_btrfs_fs)
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment