lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v2 05/36] fs: add do_readlinkat() helper; remove internal call to sys_readlinkat()
    Date
    Using the do_readlinkat() helper removes an in-kernel call to the
    sys_readlinkat() syscall.

    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
    ---
    fs/stat.c | 12 +++++++++---
    1 file changed, 9 insertions(+), 3 deletions(-)

    diff --git a/fs/stat.c b/fs/stat.c
    index 873785dae022..f8e6fb2c3657 100644
    --- a/fs/stat.c
    +++ b/fs/stat.c
    @@ -379,8 +379,8 @@ SYSCALL_DEFINE2(newfstat, unsigned int, fd, struct stat __user *, statbuf)
    return error;
    }

    -SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
    - char __user *, buf, int, bufsiz)
    +static int do_readlinkat(int dfd, const char __user *pathname,
    + char __user *buf, int bufsiz)
    {
    struct path path;
    int error;
    @@ -415,10 +415,16 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
    return error;
    }

    +SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
    + char __user *, buf, int, bufsiz)
    +{
    + return do_readlinkat(dfd, pathname, buf, bufsiz);
    +}
    +
    SYSCALL_DEFINE3(readlink, const char __user *, path, char __user *, buf,
    int, bufsiz)
    {
    - return sys_readlinkat(AT_FDCWD, path, buf, bufsiz);
    + return do_readlinkat(AT_FDCWD, path, buf, bufsiz);
    }


    --
    2.16.2
    \
     
     \ /
      Last update: 2018-03-15 20:10    [W:3.320 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site