From nobody Fri Jan 05 05:00:48 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T5rrK0Jrpz56Hhg; Fri, 5 Jan 2024 05:00:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T5rrJ5g1Fz4Wht; Fri, 5 Jan 2024 05:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704430848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nIfZYDY/Qf8720jdzAvszydQ7j3qKmxQuMsOSU4S8vA=; b=Mwp73G8n4WA5o5G1kiQO9cykef+bfFZh3eP4yywqK4hlgbFqFDBRhq8a+q5Jczsx4rFEgH fuf84w4mBrrPDYe2tvYkwGGJ3RmhwVgSD68yUEnLTXbucuQCGuC2APWmpe3/Qs/PY3CNRd 9rluLf4UZpfoKoNibXg7/YWSwPavFoJ7WqhCHk3yqQpKo1k5+pxJPjT/Wd7VIBldQyfRpc z402U5R5w7KYv9GSXNL4LuoOQHxE3zrGCxQ/u/2CT1ryMq9q0ama0YakLSK5L2kZV0wW7q YiOjPs6QUiI5F5au9G4jmJxl3H4H/A6yhDqpNvP4jZIBthzMmlNZpVmvm3shYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704430848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nIfZYDY/Qf8720jdzAvszydQ7j3qKmxQuMsOSU4S8vA=; b=yrMN2U4ESsUHl4mL7UlyhOL5QAd/Ao9it/PpjVioF9eHxX9WSDsiZIckdkRPi18QaA5PxJ 3aESPNllga0JYGkuRoniWsH2niU9XRwrTO79JiG4MIyf4cO/+THxakEwYtDkaBQc73tByB ym4VXCjkVjFAglmK70pIQNXn5XdD5QbvDMAKeq41cAfPiDbyc3sYMVfiihKlc+S83ojMjA r7Ex1ehYtKErEqelbeYft4BjelQdk43yzAVr2R3A+RomygYC8/HMnyTT+ypFwqLzsJ1asq EqYjYWaCGzlf7D+rLtO/bWsJIKIRO2eYg8mGkQq2GVBVOSXzSaEQeykT0VQkYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704430848; a=rsa-sha256; cv=none; b=Vy3EXvgCNZs7asHybWtvdPjJZYGixGyAhPLBTGuO3E6eP+EYhf8g8FxGR/AYIDdBb+czv9 F2ZBx4TCmSWuCETmDqXOSCmRFb8hdPpNmzUjdF5y1WVeEQ//7EI2U2+1sHpF0A0VsMtJBC my0iaAfLUDTRsG/A+zAzaUg0vWHTKuPlNEoz0I0x6fKymEemK62gn7KBtQLfeKZOVOoUYe GEpZCP5yjJvn5Ab9StCsD5b95FOCk/Pvm+zAH8lmmMnPaA4lc9SuamA6kxlVPBBVPk5xiV zd4PZs+Wg2dTZej8v32Th628sI+VIxa24Tq+xXhYY2AgdDJoxo1602YAiEIIRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T5rrJ4Yb1zkXG; Fri, 5 Jan 2024 05:00:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40550mp8090229; Fri, 5 Jan 2024 05:00:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40550maL090226; Fri, 5 Jan 2024 05:00:48 GMT (envelope-from git) Date: Fri, 5 Jan 2024 05:00:48 GMT Message-Id: <202401050500.40550maL090226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 656d2e83d9ee - main - nfsclient: eliminate ncl_writebp() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 656d2e83d9eef204c132f879d55782affede2ca9 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=656d2e83d9eef204c132f879d55782affede2ca9 commit 656d2e83d9eef204c132f879d55782affede2ca9 Author: Konstantin Belousov AuthorDate: 2023-12-30 18:46:31 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-05 04:58:18 +0000 nfsclient: eliminate ncl_writebp() Use plain bufwrite() instead. ncl_writebp() evolved to mostly repeat bufwrite() code with some ommisions, most notably runningbufspace accounting. Reviewed by: imp, markj, rmacklem Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43249 --- sys/fs/nfsclient/nfs.h | 1 - sys/fs/nfsclient/nfs_clbio.c | 2 +- sys/fs/nfsclient/nfs_clnode.c | 2 -- sys/fs/nfsclient/nfs_clport.c | 2 -- sys/fs/nfsclient/nfs_clvnops.c | 70 +----------------------------------------- 5 files changed, 2 insertions(+), 75 deletions(-) diff --git a/sys/fs/nfsclient/nfs.h b/sys/fs/nfsclient/nfs.h index b43194a3abeb..aa755a6b5f4d 100644 --- a/sys/fs/nfsclient/nfs.h +++ b/sys/fs/nfsclient/nfs.h @@ -111,7 +111,6 @@ int ncl_readdirrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); int ncl_readdirplusrpc(struct vnode *, struct uio *, struct ucred *, struct thread *); -int ncl_writebp(struct buf *, int, struct thread *); int ncl_commit(struct vnode *, u_quad_t, int, struct ucred *, struct thread *); void ncl_clearcommit(struct mount *); int ncl_fsinfo(struct nfsmount *, struct vnode *, struct ucred *, diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index b97342547968..e6486af55daf 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -1312,7 +1312,7 @@ again: } } else if ((n + on) == biosize || (ioflag & IO_ASYNC) != 0) { bp->b_flags |= B_ASYNC; - (void) ncl_writebp(bp, 0, NULL); + (void) bwrite(bp); } else { bdwrite(bp); } diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index ae69dafede07..fdb94aee9139 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -58,7 +58,6 @@ #include extern struct vop_vector newnfs_vnodeops; -extern struct buf_ops buf_ops_newnfs; MALLOC_DECLARE(M_NEWNFSREQ); uma_zone_t newnfsnode_zone; @@ -130,7 +129,6 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index c0318b692d86..4e3a699fb170 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -77,7 +77,6 @@ extern u_int32_t newnfs_true, newnfs_false, newnfs_xdrneg1; extern struct vop_vector newnfs_vnodeops; extern struct vop_vector newnfs_fifoops; extern uma_zone_t newnfsnode_zone; -extern struct buf_ops buf_ops_newnfs; extern uma_zone_t ncl_pbuf_zone; extern short nfsv4_cbport; extern int nfscl_enablecallb; @@ -235,7 +234,6 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, } vp = nvp; KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); - vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; /* diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 36ab5485d807..3f1ab9741673 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -2925,7 +2925,7 @@ ncl_flush(struct vnode *vp, int waitfor, struct thread *td, * A b_flags == (B_DELWRI | B_NEEDCOMMIT) block has been written to the * server, but has not been committed to stable storage on the server * yet. On the first pass, the byte range is worked out and the commit - * rpc is done. On the second pass, ncl_writebp() is called to do the + * rpc is done. On the second pass, bwrite() is called to do the * job. */ again: @@ -3438,54 +3438,6 @@ nfs_print(struct vop_print_args *ap) return (0); } -/* - * This is the "real" nfs::bwrite(struct buf*). - * We set B_CACHE if this is a VMIO buffer. - */ -int -ncl_writebp(struct buf *bp, int force __unused, struct thread *td) -{ - int oldflags, rtval; - - if (bp->b_flags & B_INVAL) { - brelse(bp); - return (0); - } - - oldflags = bp->b_flags; - bp->b_flags |= B_CACHE; - - /* - * Undirty the bp. We will redirty it later if the I/O fails. - */ - bundirty(bp); - bp->b_flags &= ~B_DONE; - bp->b_ioflags &= ~BIO_ERROR; - bp->b_iocmd = BIO_WRITE; - - bufobj_wref(bp->b_bufobj); - curthread->td_ru.ru_oublock++; - - /* - * Note: to avoid loopback deadlocks, we do not - * assign b_runningbufspace. - */ - vfs_busy_pages(bp, 1); - - BUF_KERNPROC(bp); - bp->b_iooffset = dbtob(bp->b_blkno); - bstrategy(bp); - - if ((oldflags & B_ASYNC) != 0) - return (0); - - rtval = bufwait(bp); - if (oldflags & B_DELWRI) - reassignbuf(bp); - brelse(bp); - return (rtval); -} - /* * nfs special file access vnode op. * Essentially just get vattr and then imitate iaccess() since the device is @@ -3602,26 +3554,6 @@ out: return (fifo_specops.vop_close(ap)); } -/* - * Just call ncl_writebp() with the force argument set to 1. - * - * NOTE: B_DONE may or may not be set in a_bp on call. - */ -static int -nfs_bwrite(struct buf *bp) -{ - - return (ncl_writebp(bp, 1, curthread)); -} - -struct buf_ops buf_ops_newnfs = { - .bop_name = "buf_ops_nfs", - .bop_write = nfs_bwrite, - .bop_strategy = bufstrategy, - .bop_sync = bufsync, - .bop_bdflush = bufbdflush, -}; - static int nfs_getacl(struct vop_getacl_args *ap) {