mktree: handle CKPT_HDR_LSM_INFO header type
RFC PATCH 1/1 mktree: handle CKPT_HDR_LSM_INFO header type
[ This patch is against the userspace c/r code atgit://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.
Signed-off-by Serge E. Hallyn <serue-r/[email protected]>
--- mktree.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
mktree.c +10 -0
@@ -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