From owner-svn-src-stable-11@freebsd.org Tue Jan 30 00:38:25 2018 Return-Path: Delivered-To: svn-src-stable-11@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 3C296EC49AF; Tue, 30 Jan 2018 00:38:25 +0000 (UTC) (envelope-from jhb@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 E39C46F530; Tue, 30 Jan 2018 00:38:24 +0000 (UTC) (envelope-from jhb@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 DE8537BD8; Tue, 30 Jan 2018 00:38:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w0U0cO2m089942; Tue, 30 Jan 2018 00:38:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w0U0cO6E089941; Tue, 30 Jan 2018 00:38:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201801300038.w0U0cO6E089941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 30 Jan 2018 00:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328580 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 328580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jan 2018 00:38:25 -0000 Author: jhb Date: Tue Jan 30 00:38:24 2018 New Revision: 328580 URL: https://svnweb.freebsd.org/changeset/base/328580 Log: MFC 327753: Simplify some logic by merging an if test with a subsequent switch. Specifically, in aio_queue_file() the code was doing this: if (opcode == LIO_SYNC) { ... } switch (opcode) { ... case LIO_SYNC: ... } This moves the body of the if statement into the LIO_SYNC case of the switch statement. Sponsored by: Chelsio Communications Modified: stable/11/sys/kern/vfs_aio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_aio.c ============================================================================== --- stable/11/sys/kern/vfs_aio.c Tue Jan 30 00:24:03 2018 (r328579) +++ stable/11/sys/kern/vfs_aio.c Tue Jan 30 00:38:24 2018 (r328580) @@ -1738,7 +1738,13 @@ queueit: return (EOPNOTSUPP); } - if (opcode == LIO_SYNC) { + switch (job->uaiocb.aio_lio_opcode) { + case LIO_READ: + case LIO_WRITE: + aio_schedule(job, aio_process_rw); + error = 0; + break; + case LIO_SYNC: AIO_LOCK(ki); TAILQ_FOREACH(job2, &ki->kaio_jobqueue, plist) { if (job2->fd_file == job->fd_file && @@ -1760,15 +1766,6 @@ queueit: return (0); } AIO_UNLOCK(ki); - } - - switch (opcode) { - case LIO_READ: - case LIO_WRITE: - aio_schedule(job, aio_process_rw); - error = 0; - break; - case LIO_SYNC: aio_schedule(job, aio_process_sync); error = 0; break;