From owner-svn-src-all@freebsd.org Wed Feb 21 19:56:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E679F24F94; Wed, 21 Feb 2018 19:56:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5A946F367; Wed, 21 Feb 2018 19:56:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC3831D08B; Wed, 21 Feb 2018 19:56:19 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1LJuJfd067852; Wed, 21 Feb 2018 19:56:19 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1LJuJQ2067851; Wed, 21 Feb 2018 19:56:19 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802211956.w1LJuJQ2067851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 21 Feb 2018 19:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329746 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 329746 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Feb 2018 19:56:20 -0000 Author: mckusick Date: Wed Feb 21 19:56:19 2018 New Revision: 329746 URL: https://svnweb.freebsd.org/changeset/base/329746 Log: Refactor fix in r329600 to do its check once in readsuper() rather than in the two places that call readsuper(). No semantic change intended. Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_subr.c Modified: head/sys/ufs/ffs/ffs_subr.c ============================================================================== --- head/sys/ufs/ffs/ffs_subr.c Wed Feb 21 19:42:54 2018 (r329745) +++ head/sys/ufs/ffs/ffs_subr.c Wed Feb 21 19:56:19 2018 (r329746) @@ -174,17 +174,12 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper *fsp = NULL; if (altsuperblock != -1) { - ret = readsuper(devfd, fsp, altsuperblock, readfunc); - if (*fsp != NULL) - (*fsp)->fs_csp = NULL; - if (ret != 0) + if ((ret = readsuper(devfd, fsp, altsuperblock, readfunc)) != 0) return (ret); } else { for (i = 0; sblock_try[i] != -1; i++) { - ret = readsuper(devfd, fsp, sblock_try[i], readfunc); - if (*fsp != NULL) - (*fsp)->fs_csp = NULL; - if (ret == 0) + if ((ret = readsuper(devfd, fsp, sblock_try[i], + readfunc)) == 0) break; if (ret == ENOENT) continue; @@ -193,13 +188,11 @@ ffs_sbget(void *devfd, struct fs **fsp, off_t altsuper if (sblock_try[i] == -1) return (ENOENT); } - /* - * Not filling in summary information, return. + * If not filling in summary information, return. */ if (filltype == NULL) return (0); - /* * Read in the superblock summary information. */ @@ -252,6 +245,8 @@ readsuper(void *devfd, struct fs **fsp, off_t sblocklo int error; error = (*readfunc)(devfd, sblockloc, (void **)fsp, SBLOCKSIZE); + if (*fsp != NULL) + (*fsp)->fs_csp = NULL; /* Not yet any summary information */ if (error != 0) return (error); fs = *fsp;