lkml.org 
[lkml]   [2014]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 7/8] fs/9p: One function call less in v9fs_vfs_symlink_dotl() after error detection
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sun, 28 Dec 2014 13:00:54 +0100

    The p9_client_clunk() function was called in two cases by the
    v9fs_vfs_symlink_dotl() function during error handling even if the passed
    variable "fid" contained a null pointer.

    * This implementation detail could be improved by the introduction of another
    jump label.

    * Let us delete also an unnecessary variable assignment there.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    fs/9p/vfs_inode_dotl.c | 7 +++----
    1 file changed, 3 insertions(+), 4 deletions(-)

    diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
    index 672d84f..3b38dda 100644
    --- a/fs/9p/vfs_inode_dotl.c
    +++ b/fs/9p/vfs_inode_dotl.c
    @@ -701,7 +701,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,

    if (err < 0) {
    p9_debug(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err);
    - goto error;
    + goto exit;
    }

    v9fs_invalidate_inode_attr(dir);
    @@ -712,8 +712,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
    err = PTR_ERR(fid);
    p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
    err);
    - fid = NULL;
    - goto error;
    + goto exit;
    }

    /* instantiate inode and assign the unopened fid to dentry */
    @@ -740,7 +739,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,

    error:
    p9_client_clunk(fid);
    -
    +exit:
    return err;
    }

    --
    2.2.1


    \
     
     \ /
      Last update: 2014-12-28 22:01    [W:4.021 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site