From owner-svn-src-all@freebsd.org Fri Nov 13 16:47:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 145482E75ED; Fri, 13 Nov 2020 16:47:43 +0000 (UTC) (envelope-from markj@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CXksq03xQz4c1X; Fri, 13 Nov 2020 16:47:43 +0000 (UTC) (envelope-from markj@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 E94EB1B258; Fri, 13 Nov 2020 16:47:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0ADGlgSc051703; Fri, 13 Nov 2020 16:47:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0ADGlgg7051701; Fri, 13 Nov 2020 16:47:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202011131647.0ADGlgg7051701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Nov 2020 16:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367642 - head/bin/df X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/bin/df X-SVN-Commit-Revision: 367642 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.34 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: Fri, 13 Nov 2020 16:47:43 -0000 Author: markj Date: Fri Nov 13 16:47:42 2020 New Revision: 367642 URL: https://svnweb.freebsd.org/changeset/base/367642 Log: df: Remove support for mounting devices This was marked deprecated in r329092, over two and a half years ago. This functionality is also buggy per PR 237368. PR: 237368 Reviewed by: brooks, cem, emaste, imp Differential Revision: https://reviews.freebsd.org/D27197 Modified: head/bin/df/Makefile head/bin/df/df.1 head/bin/df/df.c Modified: head/bin/df/Makefile ============================================================================== --- head/bin/df/Makefile Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/Makefile Fri Nov 13 16:47:42 2020 (r367642) @@ -10,9 +10,6 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} -CFLAGS+= -DMOUNT_CHAR_DEVS -SRCS+= getmntopts.c - LIBADD= xo util .include Modified: head/bin/df/df.1 ============================================================================== --- head/bin/df/df.1 Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/df.1 Fri Nov 13 16:47:42 2020 (r367642) @@ -48,6 +48,7 @@ The .Nm utility displays statistics about the amount of free disk space on the specified +mounted .Ar file system or on the file system of which .Ar file Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Nov 13 14:56:34 2020 (r367641) +++ head/bin/df/df.c Fri Nov 13 16:47:42 2020 (r367642) @@ -52,16 +52,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef MOUNT_CHAR_DEVS -#include -#endif #include #include #include #include -#ifdef MOUNT_CHAR_DEVS -#include -#endif #include #include #include @@ -106,9 +100,6 @@ imax(int a, int b) static int aflag = 0, cflag, hflag, iflag, kflag, lflag = 0, nflag, Tflag; static int thousands; -#ifdef MOUNT_CHAR_DEVS -static struct ufs_args mdev; -#endif static const struct option long_options[] = { @@ -123,21 +114,11 @@ main(int argc, char *argv[]) struct statfs statfsbuf, totalbuf; struct maxwidths maxwidths; struct statfs *mntbuf; -#ifdef MOUNT_CHAR_DEVS - struct iovec *iov = NULL; -#endif const char *fstype; -#ifdef MOUNT_CHAR_DEVS - char *mntpath; - char errmsg[255] = {0}; -#endif char *mntpt; const char **vfslist; int i, mntsize; int ch, rv; -#ifdef MOUNT_CHAR_DEVS - int iovlen = 0; -#endif fstype = "ufs"; (void)setlocale(LC_ALL, ""); @@ -255,66 +236,15 @@ main(int argc, char *argv[]) continue; } } else if (S_ISCHR(stbuf.st_mode)) { - if ((mntpt = getmntpt(*argv)) == NULL) { -#ifdef MOUNT_CHAR_DEVS - xo_warnx( - "df on unmounted devices is deprecated"); - mdev.fspec = *argv; - mntpath = strdup("/tmp/df.XXXXXX"); - if (mntpath == NULL) { - xo_warn("strdup failed"); - rv = 1; - continue; - } - mntpt = mkdtemp(mntpath); - if (mntpt == NULL) { - xo_warn("mkdtemp(\"%s\") failed", mntpath); - rv = 1; - free(mntpath); - continue; - } - if (iov != NULL) - free_iovec(&iov, &iovlen); - build_iovec_argf(&iov, &iovlen, "fstype", "%s", - fstype); - build_iovec_argf(&iov, &iovlen, "fspath", "%s", - mntpath); - build_iovec_argf(&iov, &iovlen, "from", "%s", - *argv); - build_iovec(&iov, &iovlen, "errmsg", errmsg, - sizeof(errmsg)); - if (nmount(iov, iovlen, - MNT_RDONLY|MNT_NOEXEC) < 0) { - if (errmsg[0]) - xo_warn("%s: %s", *argv, - errmsg); - else - xo_warn("%s", *argv); - rv = 1; - (void)rmdir(mntpt); - free(mntpath); - continue; - } else if (statfs(mntpt, &statfsbuf) == 0) { - statfsbuf.f_mntonname[0] = '\0'; - prtstat(&statfsbuf, &maxwidths); - if (cflag) - addstat(&totalbuf, &statfsbuf); - } else { - xo_warn("%s", *argv); - rv = 1; - } - (void)unmount(mntpt, 0); - (void)rmdir(mntpt); - free(mntpath); - continue; -#else + mntpt = getmntpt(*argv); + if (mntpt == NULL) { xo_warnx("%s: not mounted", *argv); rv = 1; continue; -#endif } - } else + } else { mntpt = *argv; + } /* * Statfs does not take a `wait' flag, so we cannot