From nobody Thu Jan 27 23:31:38 2022 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 E91531989DAF; Thu, 27 Jan 2022 23:31:38 +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 4JlH0p2hz0z4hKw; Thu, 27 Jan 2022 23:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643326298; 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=tZwDZMSNQmHLQ2kmDyvJI/xyuGYSMfahzLdihgUthX8=; b=S/qsITpnFfPID+LBP5tU0uE0ZlGFdBk7YdMWfeuVo68r7zzjzOt+o3MVwM/6x4fuT7xuiW 6kiDG5CM2M0nY7leGjk7b9nHbwsJr/Lvtmy92JGARa79MmrszLkYvnkDtDTXgJwPBuqwp3 1GhWsdAReSAx3LvWMdFFUpMCS9Q5mojJnfOKrAf+fBjt35NsnRGHfdKYpkGkfuvwHsomCI eq/09kbpyQ/Pafb5ab7prPr1IhjcJ1O/gjB4y6S21JfcU7qoxOSEvGZz4eJu+6s3okoI9n eaMKwYjnQOQqRCdMX4iECKJw34yKu0J6O3pABLa7DNM4gAf/Ipg3vWymTOqQuQ== 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 2D0EF1F966; Thu, 27 Jan 2022 23:31:38 +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 20RNVcsC077266; Thu, 27 Jan 2022 23:31:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20RNVcrg077265; Thu, 27 Jan 2022 23:31:38 GMT (envelope-from git) Date: Thu, 27 Jan 2022 23:31:38 GMT Message-Id: <202201272331.20RNVcrg077265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 98c788737f71 - main - nfsclient: Delete unused function nfscl_getcookie() 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: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98c788737f71be0a54a23456082453ec674987fe Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643326298; 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=tZwDZMSNQmHLQ2kmDyvJI/xyuGYSMfahzLdihgUthX8=; b=TdH1QTEHFwutAPiMBpFYqS+c4xqbW/IFW8JK/LLmd8M3iaZ1fESQiTOBJDeQlH3vFji8Rq EY4twaEiyKeX0vLD1uRrlyGOWy2pc2emhf3co3YLeWEu8fEuF6zq/zEnLddnGBn97BsF4R iaZNp1wvIqpg3wTTsGp34ToMcJNjLUTuq9YDIdk+J10N3lUa5yhGGZn6ICARMpjyHuxCZI yU/Vg/8t5X990vcMgdOvGtxbXaLG5SGPkSR9Ilb/mPfQaGB0hj7lK/cU+eBE2q9SN0+KkE SWrIXi9Emq2o9kPY7D2+3hFY4/Z3vInStpCVXWGPTI5LvNwM2YKpALTRVWf1dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643326298; a=rsa-sha256; cv=none; b=ss3KZWt2+yqpnv1XNc1CgwXlQUBhJJluUiNeYCOjwgM9iwBXy7L/KatkJHWre8gU7+YwP8 U0QlobmAOQhrt0gPO8wNN9VRdDiBgumgux+ID/k09fAyuFf24aW1yTCjUzNz0K+pfyVcih 9EQcSg/U0ke21X/3GncRDaNGNwFz6q5HuLHBaoyfRRwDcs2Keax7SJP+Ck5W+CxpAYaCSD UiAKaHMIuutmlN1snOihqozVCf9DkB9nwrsNU+xJJ7C2dYvQA6afe+ieMlVlAYk0rpSXlu b0KHRhZBMWY3CDhrr5yJw7h7fXQ8edbn/9MR/TzwgvbNDJOqiO3M2D5rrL8eEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=98c788737f71be0a54a23456082453ec674987fe commit 98c788737f71be0a54a23456082453ec674987fe Author: Rick Macklem AuthorDate: 2022-01-27 23:30:26 +0000 Commit: Rick Macklem CommitDate: 2022-01-27 23:30:26 +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. MFC after: 2 weeks --- 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 345851573bd9..c0ddb8441a7c 100644 --- a/sys/fs/nfs/nfs_var.h +++ b/sys/fs/nfs/nfs_var.h @@ -369,7 +369,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.