File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed
Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 1919#ifndef __BTRFS_COMPRESSION_
2020#define __BTRFS_COMPRESSION_
2121
22+ /*
23+ * We want to make sure that amount of RAM required to uncompress an extent is
24+ * reasonable, so we limit the total size in ram of a compressed extent to
25+ * 128k. This is a crucial number because it also controls how easily we can
26+ * spread reads across cpus for decompression.
27+ *
28+ * We also want to make sure the amount of IO required to do a random read is
29+ * reasonably small, so we limit the size of a compressed extent to 128k.
30+ */
31+
32+ /* Maximum length of compressed data stored on disk */
33+ #define BTRFS_MAX_COMPRESSED (SZ_128K)
34+ /* Maximum size of data before compression */
35+ #define BTRFS_MAX_UNCOMPRESSED (SZ_128K)
36+
2237void btrfs_init_compress (void );
2338void btrfs_exit_compress (void );
2439
Original file line number Diff line number Diff line change @@ -471,16 +471,6 @@ static noinline void compress_file_range(struct inode *inode,
471471 (start > 0 || end + 1 < BTRFS_I (inode )-> disk_i_size ))
472472 goto cleanup_and_bail_uncompressed ;
473473
474- /* we want to make sure that amount of ram required to uncompress
475- * an extent is reasonable, so we limit the total size in ram
476- * of a compressed extent to 128k. This is a crucial number
477- * because it also controls how easily we can spread reads across
478- * cpus for decompression.
479- *
480- * We also want to make sure the amount of IO required to do
481- * a random read is reasonably small, so we limit the size of
482- * a compressed extent to 128k.
483- */
484474 total_compressed = min (total_compressed , max_uncompressed );
485475 num_bytes = ALIGN (end - start + 1 , blocksize );
486476 num_bytes = max (blocksize , num_bytes );
You can’t perform that action at this time.
0 commit comments