lkml.org 
[lkml]   [2009]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 22/23] vfs: Teach fadvice to file_hotplug_lock
    From: Eric W. Biederman <ebiederm@maxwell.aristanetworks.com>

    Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
    ---
    mm/fadvise.c | 7 +++++++
    1 files changed, 7 insertions(+), 0 deletions(-)

    diff --git a/mm/fadvise.c b/mm/fadvise.c
    index 54a0f80..d7f1fba 100644
    --- a/mm/fadvise.c
    +++ b/mm/fadvise.c
    @@ -38,6 +38,11 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
    if (!file)
    return -EBADF;

    + ret = -EIO;
    + if (!file_hotplug_read_trylock(file))
    + goto out_fput;
    +
    + ret = 0;
    if (S_ISFIFO(file->f_path.dentry->d_inode->i_mode)) {
    ret = -ESPIPE;
    goto out;
    @@ -123,6 +128,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
    ret = -EINVAL;
    }
    out:
    + file_hotplug_read_unlock(file);
    +out_fput:
    fput(file);
    return ret;
    }
    --
    1.6.3.1.54.g99dd.dirty


    \
     
     \ /
      Last update: 2009-06-02 00:03    [W:4.156 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site