Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/sysvbfs Simplify control flow



details:   https://anonhg.NetBSD.org/src/rev/27b7c890bd21
branches:  trunk
changeset: 334812:27b7c890bd21
user:      justin <justin%NetBSD.org@localhost>
date:      Sun Dec 07 23:48:04 2014 +0000

description:
Simplify control flow

Removes a variable and compiler warnings in some cases.

diffstat:

 sys/fs/sysvbfs/sysvbfs_vfsops.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (50 lines):

diff -r 5d15d3ac6da7 -r 27b7c890bd21 sys/fs/sysvbfs/sysvbfs_vfsops.c
--- a/sys/fs/sysvbfs/sysvbfs_vfsops.c   Sun Dec 07 22:23:38 2014 +0000
+++ b/sys/fs/sysvbfs/sysvbfs_vfsops.c   Sun Dec 07 23:48:04 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysvbfs_vfsops.c,v 1.43 2014/04/16 18:55:19 maxv Exp $ */
+/*     $NetBSD: sysvbfs_vfsops.c,v 1.44 2014/12/07 23:48:04 justin Exp $       */
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.43 2014/04/16 18:55:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysvbfs_vfsops.c,v 1.44 2014/12/07 23:48:04 justin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -168,7 +168,6 @@
        kauth_cred_t cred = l->l_cred;
        struct sysvbfs_mount *bmp;
        int error, oflags;
-       bool devopen = false;
 
        vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
        error = vinvalbuf(devvp, V_SAVE, cred, l, 0, 0);
@@ -181,13 +180,13 @@
                oflags |= FWRITE;
        if ((error = VOP_OPEN(devvp, oflags, NOCRED)) != 0)
                goto out;
-       devopen = true;
 
        bmp = malloc(sizeof(*bmp), M_SYSVBFS_VFS, M_WAITOK | M_ZERO);
        bmp->devvp = devvp;
        bmp->mountp = mp;
        if ((error = sysvbfs_bfs_init(&bmp->bfs, devvp)) != 0) {
                free(bmp, M_SYSVBFS_VFS);
+               VOP_CLOSE(devvp, oflags, NOCRED);
                goto out;
        }
        LIST_INIT(&bmp->bnode_head);
@@ -202,8 +201,6 @@
        mp->mnt_fs_bshift = BFS_BSHIFT;
 
  out:
-       if (devopen && error)
-               VOP_CLOSE(devvp, oflags, NOCRED);
        VOP_UNLOCK(devvp);
        return error;
 }



Home | Main Index | Thread Index | Old Index