[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110403185727.GC15044@hallyn.com>
Date: Sun, 3 Apr 2011 13:57:27 -0500
From: "Serge E. Hallyn" <serge@...lyn.com>
To: ntl@...ox.com
Cc: linux-kernel@...r.kernel.org, containers@...ts.linux-foundation.org
Subject: Re: [PATCH 04/10] Introduce vfs_fcntl() helper
Quoting ntl@...ox.com (ntl@...ox.com):
> From: Nathan Lynch <ntl@...ox.com>
>
> When restoring process state from a checkpoint image, it will be
> necessary to restore file status flags; add vfs_fcntl() for this
> purpose.
>
> Based on original code by Oren Laadan.
>
> Signed-off-by: Oren Laadan <orenl@...columbia.edu>
> [ntl: extracted from "c/r: checkpoint and restart open file descriptors"]
> Signed-off-by: Nathan Lynch <ntl@...ox.com>
Acked-by: Serge Hallyn <serge.hallyn@...ntu.com>
> ---
> fs/fcntl.c | 21 +++++++++++++--------
> include/linux/fs.h | 2 ++
> 2 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/fs/fcntl.c b/fs/fcntl.c
> index ecc8b39..8e797b7 100644
> --- a/fs/fcntl.c
> +++ b/fs/fcntl.c
> @@ -426,6 +426,18 @@ static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
> return err;
> }
>
> +int vfs_fcntl(int fd, unsigned int cmd, unsigned long arg, struct file *filp)
> +{
> + int err;
> +
> + err = security_file_fcntl(filp, cmd, arg);
> + if (err)
> + goto out;
> + err = do_fcntl(fd, cmd, arg, filp);
> + out:
> + return err;
> +}
> +
> SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
> {
> struct file *filp;
> @@ -435,14 +447,7 @@ SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg)
> if (!filp)
> goto out;
>
> - err = security_file_fcntl(filp, cmd, arg);
> - if (err) {
> - fput(filp);
> - return err;
> - }
> -
> - err = do_fcntl(fd, cmd, arg, filp);
> -
> + err = vfs_fcntl(fd, cmd, arg, filp);
> fput(filp);
> out:
> return err;
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 315ded4..175bb75 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1112,6 +1112,8 @@ struct file_lock {
>
> #include <linux/fcntl.h>
>
> +extern int vfs_fcntl(int fd, unsigned cmd, unsigned long arg, struct file *fp);
> +
> extern void send_sigio(struct fown_struct *fown, int fd, int band);
>
> #ifdef CONFIG_FILE_LOCKING
> --
> 1.7.4
>
> _______________________________________________
> Containers mailing list
> Containers@...ts.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists