Commit Graph

47 Commits

Author SHA1 Message Date
Kirk McKusick
68d7185b64 The fsdb(8) utility uses the fsck_ffs(8) disk I/O interfaces, so
switch from using libufs's bread() to using fsck_ffs's getdatablk()
when importing tools/diag/prtblnos's prtblknos().

Sponsored by: Netflix
2020-09-19 20:06:12 +00:00
Kirk McKusick
9fc5d538fc In preparation for adding inode check-hashes, clean up and
document the libufs interface for fetching and storing inodes.
The undocumented getino / putino interface has been replaced
with a new getinode / putinode interface.

Convert the utilities that had been using the undocumented
interface to use the new documented interface.

No functional change (as for now the libufs library does not
do inode check-hashes).

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: Netflix
2018-11-13 21:40:56 +00:00
Kirk McKusick
28ac223823 Fix incorrect output when printing block lists for files small enough
to fit in only direct blocks whose size is exactly a multiple of the
filesystem block size.

Reported by:  Peter Holm
Tested by:    Peter Holm
Sponsored by: Netflix
2018-08-20 20:44:11 +00:00
Kirk McKusick
d3009da8ad Fix incorrect output for a file consisting of a single full-size
block followed by a discontiguous fragment.

Add checks for unallocated inodes and inodes with unknown mode
types.

Cleanup variable declarations by changing from type `int' to types
like ufs_lbn_t, ufs2_daddr_t, etc.

Reported by: bde
2018-04-19 22:43:55 +00:00
Kirk McKusick
c343fa81a8 In addition to the existing argument format:
prtblknos filesystem_device inode ...

add an additional argument format:

	prtblknos file

which is more convenient than figuring out the filesystem
and inode number for "file".

When given a list of multiple inodes, rather than exiting
the program on an error with one of them, skip over it and
continue with the next one.

Submitted by: bde
2018-04-18 23:08:10 +00:00
Kirk McKusick
15e4030e9e Check the inode type and only attempt to print block lists for
regular files, directories, and symbolic links that require
external storage.

Correct the handling of files with holes and files that have
one or more large blocks and end with a fragment.

Reported by: bde
2018-04-18 22:24:44 +00:00
Kirk McKusick
f33fbc18f5 Add (intmax_t) type casts to some printf parameters to keep i386 happy. 2018-04-08 07:18:29 +00:00
Kirk McKusick
0e3f58b661 Split tools/diag/prtblknos into two parts:
main.c - opens disk and processes the argument list
		 of inodes to be printed
	prtblknos.c - prints out the list of blocks used by an inode

This change allows the fsdb program to import prtblknos() to use when
printing out the set of blocks used by an inode.

This program was switched to using the libufs library to ease its
integration with fsdb and any other filesystem utility that might
want to use it in the future.
2018-04-08 06:52:58 +00:00
Kirk McKusick
c97f1d3f37 Add an explanation of the block size units output by prtblknos.
Suggested by: Ravi Pokala (rpokala@)
2018-02-09 22:23:10 +00:00
Kirk McKusick
16c0c8eeec This is a little C-program that can be used to print out the list
of blocks used by a requested list of inodes.

For example, to list the blocks referenced by your kernel:

guest_12 % df /
Filesystem      1K-blocks     Used   Avail Capacity  Mounted on
/dev/gpt/rootfs  20307196 10707336 7975288    57%    /

guest_12 % ls -i /boot/kernel/kernel
160603 /boot/kernel/kernel

guest_12 % ./prtblknos /dev/gpt/rootfs 160603
160603:	lbn 0-7 blkno 3217584-3217647
	lbn 8-11 blkno 3217864-3217895 distance 216
First-level indirect, blkno 3217896-3217903 distance 0
	lbn 12-19 blkno 3217904-3217967 distance 8
	lbn 20-75 blkno 3251816-3252263 distance 33848
	lbn 76-83 blkno 3252368-3252431 distance 104
	lbn 84-91 blkno 3252464-3252527 distance 32
	lbn 92-852 blkno 3252896-3258983 distance 368

Each contiguous range of blocks is printed on a line.
The distance metric is the size of the gap from the end of the
previous set of blocks to the beginning of the next set of blocks.
Short distances are desirable.
2018-02-09 19:10:46 +00:00
Eitan Adler
efea29ab90 diag/httpd-error: remove
This is a script for a web server in a specific
configuration. Current web servers don't produce
similar log files and it isn't FreeBSD's
goal to produce a log file analyzer.
2017-12-02 17:10:13 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Eitan Adler
2ab4fdc460 Remove scripts and tools which only functioned when src was using CVS
Approved by:	cperciva
MFC after:	1 week
2012-09-13 17:49:11 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Ruslan Ermilov
a35d88931c For variables that are only checked with defined(), don't provide
any fake value.
2004-10-24 15:33:08 +00:00
Ruslan Ermilov
c97869c8aa Fixed ``make checkdpadd''. Removed redundant dependency. 2004-02-05 21:52:33 +00:00
Alexey Zelkin
ac5e4e9c9e Learn about new world order 2003-11-26 10:43:05 +00:00
Andrey A. Chernov
6fd04a1f52 Make it works with POSIX sort (POS arg)
All old sorts understand -k too.
2002-09-24 20:05:01 +00:00
Dag-Erling Smørgrav
d397408818 Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.
2002-04-22 13:44:47 +00:00
Ruslan Ermilov
6239d3aebd Finish style fixes. 2002-03-26 13:02:15 +00:00
Alexey Zelkin
b5ed0bcd23 Complete '_' hack. 2002-02-07 19:32:40 +00:00
Alexey Zelkin
dca7443ba8 . add a hack dedicated to n_himba (or correctly to say problem with his nick
in docbook environment)
. clarify comments
. mention that this script is dedicated to freefall's environment
. add bsd style copyright
2002-02-07 19:27:29 +00:00
Alexey Zelkin
99349513d0 This script has served its purpose. Now its function is one of subfunctions
of recently added cknames.pl.
2002-02-07 19:13:06 +00:00
Alexey Zelkin
d97a65d2a1 Add script to check integrity between access/authors.ent/passwd@freefall 2002-02-07 19:09:49 +00:00
Alexey Zelkin
7658e887d3 Fix sentence in comment 2002-02-06 18:00:11 +00:00
Alexey Zelkin
e0738f01ca Update description of 'ac' subdirectory 2002-02-06 17:50:05 +00:00
Alexey Zelkin
1afcdc8a91 Add descirptions of scripts in this directory 2002-02-06 17:49:13 +00:00
Alexey Zelkin
f1c3a0188c Add script that checks contents of .ent files (sorting and addresses) 2002-02-06 17:47:18 +00:00
Alexey Zelkin
d6d290cbca List of committers was moved out of handbook. Teach 'ac' about new location.
Also teach it about complex entries in access file (or correctly to say
simplify them)
2002-02-06 17:09:08 +00:00
Alexey Zelkin
364a805b9f * fix some warnings
* set WARNS
* few style/whitespace fixes

Submitted by:	ru
2002-02-04 16:17:19 +00:00
Alexey Zelkin
df3cc3c14d describe localeck
plus some capitalization/whitespace fixes
2002-02-04 14:00:29 +00:00
Alexey Zelkin
ac6e0aed98 Add simple diagnostic utility to checking for invalid/incomplete
locales
2002-02-04 13:59:16 +00:00
Kelly Yancey
f1d24f0dfd Include definition for struct namecache (it isn't exported via any header)
so this builds again. Replace hardcoded name length magic with NAME_MAX.
2002-01-02 06:25:39 +00:00
Andrey A. Chernov
c09ed64a72 ISO_ -> ISO 2001-06-11 01:29:40 +00:00
Jake Burkholder
e39756439c Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by:		msmith and others
2000-05-26 02:09:24 +00:00
Jake Burkholder
740a1973a6 Change the way that the queue(3) structures are declared; don't assume that
the type argument to *_HEAD and *_ENTRY is a struct.

Suggested by:	phk
Reviewed by:	phk
Approved by:	mdodd
2000-05-23 20:41:01 +00:00
Sheldon Hearn
21edc5f5c8 Correct grammar in the synoptic comment.
Submitted by:	ru
2000-03-03 09:25:00 +00:00
Sheldon Hearn
d72d02311f Use double-quotes instead of single-quotes when displaying the usage
so that the shell interpolates $0.

PR:		17121
Submitted by:	Peng HaiJie <phj@cn.FreeBSD.org>
2000-03-02 15:00:53 +00:00
Wolfram Schneider
6c36ecd55c Include BSD-license.
PR:		misc/15262
Submitted by:	 alex@big.endian.de
1999-12-06 22:33:40 +00:00
Alexey Zelkin
3fcae27b92 Bring ``ac'' into reality. This great tools now works correctly (for
current state of the tree)
1999-11-04 08:45:02 +00:00
Alexey Zelkin
d4dee594a4 Add short description of dumpvfscache 1999-11-04 08:42:29 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Wolfram Schneider
40d75fab43 httpd-error is a shell script which print a summary about
Web files which does not exists on your host.

E.g.

	httpd-error -userhits < /var/log/httpd-error.log

print the number of errors by users, sorted by error hits.
1998-02-15 18:54:26 +00:00
Poul-Henning Kamp
c9e186fb37 A little gadget to dump the contents of the vfs name cache. 1997-09-04 08:28:55 +00:00
Wolfram Schneider
caccaa9b2a Add ac which check if the FreeBSD handbook is in sync with the committers list 1997-03-28 14:40:39 +00:00
Poul-Henning Kamp
04022b1194 README reads:
This directory is for diagnostic programs.

A diagnostic program is one that will inform you that something is wrong
somewhere, for instance by traversing a kernel-structure and verifying
the integrity.

Please make a subdir per program, and add a brief description to this file.
1995-10-15 11:27:15 +00:00