Prev: [PATCH v21 088/100] powerpc: enable checkpoint support in Kconfig
Next: [PATCH v21 095/100] c/r: Add rtnl_dellink() helper
From: Oren Laadan on 1 May 2010 10:50 This adds new 'proto_ops' function for checkpointing and restoring sockets. This allows the checkpoint/restart code to compile nicely when, e.g., AF_UNIX sockets are selected as a module. It also adds a function 'collecting' a socket for leak-detection during full-container checkpoint. This is useful for those sockets that hold references to other "collectable" objects. Two examples are AF_UNIX buffers which reference the socket of origin, and sockets that have file descriptors in-transit. Cc: netdev(a)vger.kernel.org Signed-off-by: Oren Laadan <orenl(a)cs.columbia.edu> Acked-by: Serge E. Hallyn <serue(a)us.ibm.com> Tested-by: Serge E. Hallyn <serue(a)us.ibm.com> --- include/linux/net.h | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/include/linux/net.h b/include/linux/net.h index 4157b5d..1f32c70 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -153,6 +153,9 @@ struct sockaddr; struct msghdr; struct module; +struct ckpt_ctx; +struct ckpt_hdr_socket; + struct proto_ops { int family; struct module *owner; @@ -201,6 +204,12 @@ struct proto_ops { int offset, size_t size, int flags); ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags); + int (*checkpoint)(struct ckpt_ctx *ctx, + struct socket *sock); + int (*collect)(struct ckpt_ctx *ctx, + struct socket *sock); + int (*restore)(struct ckpt_ctx *ctx, struct socket *sock, + struct ckpt_hdr_socket *h); }; #define DECLARE_SOCKADDR(type, dst, src) \ -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |