lkml.org 
[lkml]   [2010]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v21 036/100] c/r: introduce vfs_fcntl()
    Date
    This patch introduces vfs_fcntl() so that it can be called from
    restart (see patch adding restart of files).

    Cc: linux-fsdevel@vger.kernel.org
    Signed-off-by: Oren Laadan <orenl@cs.columbia.edu>
    Acked-by: Serge E. Hallyn <serue@us.ibm.com>
    Tested-by: Serge E. Hallyn <serue@us.ibm.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 452d02f..2079af0 100644
    --- a/fs/fcntl.c
    +++ b/fs/fcntl.c
    @@ -418,6 +418,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;
    @@ -427,14 +439,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 9e8b171..65ffe9c 100644
    --- a/include/linux/fs.h
    +++ b/include/linux/fs.h
    @@ -1096,6 +1096,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.6.3.3


    \
     
     \ /
      Last update: 2010-05-01 16:35    [W:0.032 / U:33.144 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site