Skip to contentSkip to conversation

mktree: handle CKPT_HDR_LSM_INFO header type

RFC PATCH New Serge E. Hallyn 1 participant 1 message Sep 3, 2009

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 mktree: handle CKPT_HDR_LSM_INFO header type

[ This patch is against the userspace c/r code at
git://git.ncl.cs.columbia.edu/pub/git/user-cr.git ]

This is a variable length buffer type intended to contain LSM-specific version information, for instance a policy version number of sha1sum of the policy.

---
 mktree.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
mktree.c +10 -0
index a9fb9c4..3785ebc 100644
@@ -1751,6 +1751,11 @@ static int ckpt_read_header(struct ckpt_ctx *ctx)
 	if (ret < 0)
 		return ret;
 
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_read_obj_type(ctx, ptr, 200, CKPT_HDR_LSM_INFO);
+	if (ret < 0)
+		return ret;
+
 	/* FIXME: skip version validation for now */
 
 	return 0;
@@ -1833,6 +1838,11 @@ static int ckpt_write_header(struct ckpt_ctx *ctx)
 		return ret;
 	ptr += ((struct ckpt_hdr *) ptr)->len;
 	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
+	if (ret < 0)
+		return ret;
+
+	ptr += ((struct ckpt_hdr *) ptr)->len;
+	ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) ptr);
 
 	return ret;
 }
Signature · 1 line
1.6.1.1