[PATCH 10/30] cr: core stuff

Dave Hansen dave at linux.vnet.ibm.com
Tue Apr 14 09:48:24 PDT 2009


On Tue, 2009-04-14 at 10:41 -0500, Serge E. Hallyn wrote:
> > Module can legally support C/R for its files.
> > In the end it most certainly will end up with module registering restart
> 
> Which module?  The module defining a filesystem?
> 
> In that case I'm just not clear on how the restart code will know which
> fs's file_operations to use to pick a fops->restart() fn.

There's not an f_op on the restart side -- there can't be.  The problem
is that we get a CR_FD_FOO object and need to call off into the "foo"
code to recreate the 'struct file'.  To me, that screams of a nice list
of function handlers indexed be CR_FD_FOO.

So, we have a list of these sitting around somewhere:

int restore_fd_func(struct cr_ctx *ctx, struct cr_fd_hdr *fd, void *private)

and when we see a CR_FD_HDR object, we look up its type and call the
respective handler.  The handler will get enough data to go and restore
the fd.  The fd number and other things common to all fds should be
present in the cr_fd_hdr.

-- Dave



More information about the Containers mailing list