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 <[email protected]>
> Cc: Matt Helsley <[email protected]>

Reviewed-by: Oren Laadan <[email protected]>

(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.

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to