From nobody Thu Feb 10 03:40:16 2022 X-Original-To: dev-commits-src-all@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 6B3F919B3B54; Thu, 10 Feb 2022 03:40:16 +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 4JvMvh2Z1bz53ld; Thu, 10 Feb 2022 03:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644464416; 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=JxtAjnr3q25S4PJ0clfrtwPLKlDt+pCsoEISNcOT+OA=; b=LvMB0ShDCnfq2mwtPomn2uzyNa7s9FCUrgMPpCGHO/QDMXgYEdk0ek0CmBg3ckx6NKI+fz PtmZFqL2pO3TPYq/UW1d1WvwJM24PPgHFWXrCah/y+T2iJWOGYwQYI0eIqzCGadGYpJJel 2U5lrR6NoCRXYnCuSYYlEeOQ//YPbE3p3a5bRwW6/foWp9GJP0M5Yf1R8de1xCKMUjZFGO YE3drviyQ6x2S05hl4u72UCizAoLx8uxBqGr8jyWK2qXNRo2OJrBNjlkDDtsqd+tYICHrz JyXk645tYX0AKyrZlxYXfpigk1QgR/gBhTOpYycOmUFXJDd6AhVm1ORawnrv5A== 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 382F519800; Thu, 10 Feb 2022 03:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21A3eGZZ041751; Thu, 10 Feb 2022 03:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21A3eGov041745; Thu, 10 Feb 2022 03:40:16 GMT (envelope-from git) Date: Thu, 10 Feb 2022 03:40:16 GMT Message-Id: <202202100340.21A3eGov041745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: be1776da76c7 - stable/13 - nfsclient: Delete unused function nfscl_getcookie() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: be1776da76c77f9e5015a3f3ef46dbef723c83bb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644464416; 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=JxtAjnr3q25S4PJ0clfrtwPLKlDt+pCsoEISNcOT+OA=; b=MuvrKgeMS/1tlkz3tYzcs9eRUDok/kNSZfg4CA5S720o7QBF2N+AT5hxb7Vtt8fPe3e+vA unFQ/b64fWV4YrjyCWTLXRzmGQ6ao95a45U4Ee79gA6PDYahRG6RZhlN/hRPG7tykU5yZf fvxz1C0jvRum6+a2vu6SrqHqBdbBtZIAbIDcU9EZG6b+Jy0z/uzwtChBt3R+rrdqkYU7te qH2A6/PAi92zNqbnv2q+cd6uDErVakA6Irz0fx6Re+8NxyiSpfBbitQkneijJhn83roe38 zDIN7CzQAiIHnK3SEz2QVQhGiT3ngdGSp7qfcdqeGV8vA28zrwOeZVYVP7xAxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644464416; a=rsa-sha256; cv=none; b=NMp0d9PzgZQsBBbN/dVyzxsASP5Ylu8ipXmUjDpQHFUOPo54y7//kVr61cBhib/yuy6X8W qM10fV5iAb7MeClxiifZePKi8BBfSxZM+cvsMJn4b+ZFVGvfQZyR/pk8w5MOZPnQm+O9VS vSx4WK3zTfS7mtwEZFqNSBOnpJdCeGaP9eT/EQKVecdrLQ2HQxYfli4D2ipOh7m+Qa2UAB 4Yi6x+4B6ks2mJrxrSSxLWER5yvZN/B5tkV3xp7tKn6n+VWclTvC6qINCA8gdOwBAwkE4I Tq7S6UKSirtiA3EEvNELdOgses89sVbJ5JH/vT528U4cfrNXKaJ/zKqNdMGJtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=be1776da76c77f9e5015a3f3ef46dbef723c83bb commit be1776da76c77f9e5015a3f3ef46dbef723c83bb Author: Rick Macklem AuthorDate: 2022-01-27 23:30:26 +0000 Commit: Rick Macklem CommitDate: 2022-02-10 03:39:00 +0000 nfsclient: Delete unused function nfscl_getcookie() The function nfscl_getcookie(), which is essentially the same as ncl_getcookie(), is never called, so delete it. This is probably cruft left over from the port of the NFSv4 code to FreeBSD several years ago. Found while modifying the code to better use the directory offset cookies. (cherry picked from commit 98c788737f71be0a54a23456082453ec674987fe) --- sys/fs/nfs/nfs_var.h | 1 - sys/fs/nfsclient/nfs_clcomsubs.c | 53 ---------------------------------------- 2 files changed, 54 deletions(-) diff --git a/sys/fs/nfs/nfs_var.h b/sys/fs/nfs/nfs_var.h index b5bc5178187e..c565a8ab579a 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -367,7 +367,6 @@ struct mbuf *nfsm_add_ext_pgs(struct mbuf *, int, int *); /* nfs_clcomsubs.c */ void nfsm_uiombuf(struct nfsrv_descript *, struct uio *, int); struct mbuf *nfsm_uiombuflist(struct uio *, int, u_int); -nfsuint64 *nfscl_getcookie(struct nfsnode *, off_t off, int); u_int8_t *nfscl_getmyip(struct nfsmount *, struct in6_addr *, int *); int nfsm_getfh(struct nfsrv_descript *, struct nfsfh **); int nfscl_mtofh(struct nfsrv_descript *, struct nfsfh **, diff --git a/sys/fs/nfsclient/nfs_clcomsubs.c b/sys/fs/nfsclient/nfs_clcomsubs.c index c6556d287b1e..8f593a8d3c92 100644 --- a/sys/fs/nfsclient/nfs_clcomsubs.c +++ b/sys/fs/nfsclient/nfs_clcomsubs.c @@ -49,8 +49,6 @@ extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; NFSCLSTATEMUTEX; -static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; - /* * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 @@ -326,57 +324,6 @@ nfsmout: return (error); } -/* - * This function finds the directory cookie that corresponds to the - * logical byte offset given. - */ -nfsuint64 * -nfscl_getcookie(struct nfsnode *np, off_t off, int add) -{ - struct nfsdmap *dp, *dp2; - int pos; - - pos = off / NFS_DIRBLKSIZ; - if (pos == 0) { - KASSERT(!add, ("nfs getcookie add at 0")); - return (&nfs_nullcookie); - } - pos--; - dp = LIST_FIRST(&np->n_cookies); - if (!dp) { - if (add) { - dp = malloc(sizeof (struct nfsdmap), - M_NFSDIROFF, M_WAITOK); - dp->ndm_eocookie = 0; - LIST_INSERT_HEAD(&np->n_cookies, dp, ndm_list); - } else - return (NULL); - } - while (pos >= NFSNUMCOOKIES) { - pos -= NFSNUMCOOKIES; - if (LIST_NEXT(dp, ndm_list) != NULL) { - if (!add && dp->ndm_eocookie < NFSNUMCOOKIES && - pos >= dp->ndm_eocookie) - return (NULL); - dp = LIST_NEXT(dp, ndm_list); - } else if (add) { - dp2 = malloc(sizeof (struct nfsdmap), - M_NFSDIROFF, M_WAITOK); - dp2->ndm_eocookie = 0; - LIST_INSERT_AFTER(dp, dp2, ndm_list); - dp = dp2; - } else - return (NULL); - } - if (pos >= dp->ndm_eocookie) { - if (add) - dp->ndm_eocookie = pos + 1; - else - return (NULL); - } - return (&dp->ndm_cookies[pos]); -} - /* * Gets a file handle out of an nfs reply sent to the client and returns * the file handle and the file's attributes.