[PATCH 2/3] Add post-file deferqueue (v2)

Oren Laadan orenl at librato.com
Wed Sep 9 15:32:51 PDT 2009



Dan Smith wrote:
> This is the deferq bit of Matt's patch, which is needed by the subsequent
> socket patch.
> 
> Changes in v2:
>  - Allocate and destroy the deferqueue at context alloc/free time
> 
> Signed-off-by: Dan Smith <danms at us.ibm.com>
> Cc: Matt Helsley <matthltc at us.ibm.com>

Reviewed-by: Oren Laadan <orenl at cs.columbia.edu>

(but see comment below).

> ---
>  checkpoint/files.c               |   17 +++++++++++++++++
>  checkpoint/sys.c                 |    7 +++++++
>  include/linux/checkpoint_types.h |    1 +
>  3 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/checkpoint/files.c b/checkpoint/files.c
> index 204055b..3d99823 100644
> --- a/checkpoint/files.c
> +++ b/checkpoint/files.c
> @@ -21,6 +21,7 @@
>  #include <linux/syscalls.h>
>  #include <linux/checkpoint.h>
>  #include <linux/checkpoint_hdr.h>
> +#include <linux/deferqueue.h>
>  #include <net/sock.h>
>  
>  
> @@ -294,6 +295,14 @@ static int do_checkpoint_file_table(struct ckpt_ctx *ctx,
>  		if (ret < 0)
>  			break;
>  	}
> +	if (!ret) {
> +		ret = deferqueue_run(ctx->files_deferq);
> +		if (ret > 0) {
> +			pr_warning("c/r: files deferqueue had %d entries\n",
> +				   ret);
> +			ret = 0;

I'm unsure why the warning; perhaps you mean "ckpt_debug()" ?

> +		}
> +	}
>   out:
>  	kfree(fdtable);
>  	return ret;
> @@ -697,6 +706,14 @@ static struct files_struct *do_restore_file_table(struct ckpt_ctx *ctx)
>  		if (ret < 0)
>  			break;
>  	}
> +	if (!ret) {
> +		ret = deferqueue_run(ctx->files_deferq);
> +		if (ret > 0) {
> +			pr_warning("c/r: files deferqueue had %d entries\n",
> +				   ret);
> +			ret = 0;

Ditto.

Oren.



More information about the Containers mailing list