[PATCH 3/4] btrfs: lz4: add wrapper for context size estimation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently 16K for 32bit and 64bit.

Signed-off-by: David Sterba <dsterba@xxxxxxx>
---
 fs/btrfs/lz4.c |    9 +++++++++
 fs/btrfs/lz4.h |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/lz4.c b/fs/btrfs/lz4.c
index e41d0cf..105ea9c 100644
--- a/fs/btrfs/lz4.c
+++ b/fs/btrfs/lz4.c
@@ -808,3 +808,12 @@ _output_error:
 	return (int) (-(((char*)ip)-source));
 }
 
+int LZ4_context_size(void)
+{
+	return sizeof(struct refTables);
+}
+int LZ4_context64k_size(void)
+{
+	return sizeof(struct refTables);
+}
+
diff --git a/fs/btrfs/lz4.h b/fs/btrfs/lz4.h
index bbd5e12..b0f8cc7 100644
--- a/fs/btrfs/lz4.h
+++ b/fs/btrfs/lz4.h
@@ -102,6 +102,9 @@ int LZ4_compress64kCtx(void** ctx,
 				 char* dest,
 				 int isize);
 
+int LZ4_context_size(void);
+int LZ4_context64k_size(void);
+
 #if defined (__cplusplus)
 }
 #endif
-- 
1.7.8

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux