Skip to contentSkip to conversation

Reiser4: fix typo in lzo1_overrun calculation

PATCH New [email protected] 1 participant 3 messages Jan 26, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Reiser4: fix typo in lzo1_overrun calculation

From: Edward Shishkin <[email protected]>

Fix typo found by BratSinot.

---
 plugin/compress/compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
plugin/compress/compress.c +1 -1
index 5c3df83..a574933 100644
@@ -214,7 +214,7 @@ static int lzo1_init(void)
 
 static int lzo1_overrun(unsigned in_len)
 {
-	return in_len / 64 + 16 + 3;
+	return in_len / 16 + 64 + 3;
 }
 
 static coa_t lzo1_alloc(tfm_action act)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 Reiser4: use __GFP_REPEAT flag for costly memory allocation

From: Edward Shishkin <[email protected]>

---
 tree.c | 6 ++++++
 1 file changed, 6 insertions(+)
tree.c +6 -0
index 08574ca..e4712c4 100644
@@ -1827,6 +1827,12 @@ int reiser4_init_tree(reiser4_tree * tree	/* pointer to structure being
 	assert("nikita-308", height > 0);
 	assert("nikita-309", nplug != NULL);
 	assert("zam-587", tree->super != NULL);
+	assert("edward-171", get_current_context() != NULL);
+	/*
+	 * We'll perform costly memory allocations for znode hash table, etc.
+	 * So, set proper allocation flags
+	 */
+	get_current_context()->gfp_mask |= (__GFP_NOWARN | __GFP_REPEAT);
 
 	tree->root_block = *root_block;
 	tree->height = height;
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/3 Reiser4: use vmalloc instead of kmalloc to alloacte zhash table

In reply to [email protected]

From: Edward Shishkin <[email protected]>

---
 znode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
znode.c +2 -2
index 2581a0a..f7c77ef 100644
@@ -188,8 +188,8 @@ blknrhashfn(z_hash_table * table, const reiser4_block_nr * b)
 }
 
 /* The hash table definition */
-#define KMALLOC(size) kmalloc((size), reiser4_ctx_gfp_mask_get())
-#define KFREE(ptr, size) kfree(ptr)
+#define KMALLOC(size) reiser4_vmalloc(size)
+#define KFREE(ptr, size) vfree(ptr)
 TYPE_SAFE_HASH_DEFINE(z, znode, reiser4_block_nr, zjnode.key.z, zjnode.link.z,
 		      blknrhashfn, blknreq);
 #undef KFREE
Signature · 1 line
2.7.4