On Fri, Feb 26, 2010 at 12:48:04PM -0600, Nathan Lynch wrote: > On Fri, 2010-02-26 at 00:45 -0800, Matt Helsley wrote: > > Distributing the ckpt_obj_ops would require sharing these functions when > > we can get by with simple NULL pointers in the grab/drop operations. > > > > Signed-off-by: Matt Helsley <matthltc@xxxxxxxxxx> > > --- > > checkpoint/objhash.c | 36 ++++++++++++++++-------------------- > > 1 files changed, 16 insertions(+), 20 deletions(-) > > > > diff --git a/checkpoint/objhash.c b/checkpoint/objhash.c > > index 832520d..999d731 100644 > > --- a/checkpoint/objhash.c > > +++ b/checkpoint/objhash.c > > @@ -47,16 +47,6 @@ struct ckpt_obj_hash { > > > > /* helper grab/drop/users functions */ > > > > -static void obj_no_drop(void *ptr, int lastref) > > -{ > > - return; > > -} > > - > > -static int obj_no_grab(void *ptr) > > -{ > > - return 0; > > -} > > - > > static int obj_inode_grab(void *ptr) > > { > > return igrab((struct inode *) ptr) ? 0 : -EBADF; > > @@ -346,8 +336,8 @@ static void *restore_lsm_string_wrap(struct ckpt_ctx *ctx) > > static const struct ckpt_obj_ops ckpt_obj_ignored_ops = { > > .obj_name = "IGNORED", > > .obj_type = CKPT_OBJ_IGNORE, > > - .ref_drop = obj_no_drop, > > - .ref_grab = obj_no_grab, > > + .ref_drop = NULL, > > + .ref_grab = NULL, > > }; > > > > /* inode object */ > > @@ -412,8 +402,8 @@ static const struct ckpt_obj_ops ckpt_obj_sighand_ops = { > > static const struct ckpt_obj_ops ckpt_obj_signal_ops = { > > .obj_name = "SIGNAL", > > .obj_type = CKPT_OBJ_SIGNAL, > > - .ref_drop = obj_no_drop, > > - .ref_grab = obj_no_grab, > > + .ref_drop = NULL, > > + .ref_grab = NULL, > > }; > > /* ns object */ > > static const struct ckpt_obj_ops ckpt_obj_nsproxy_ops = { > > @@ -519,8 +509,8 @@ static const struct ckpt_obj_ops ckpt_obj_tty_ops = { > > static const struct ckpt_obj_ops ckpt_obj_security_ptr_ops = { > > .obj_name = "SECURITY PTR", > > .obj_type = CKPT_OBJ_SECURITY_PTR, > > - .ref_drop = obj_no_drop, > > - .ref_grab = obj_no_grab, > > + .ref_drop = NULL, > > + .ref_grab = NULL, > > }; > > ref_drop/grab will be NULL if you just remove the initializers -- do you > think it is preferable to be explicit? Doh! Yes, I should fix that. Thanks! Cheers, -Matt Helsley _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers