1.\"	$OpenBSD: makeinodes.1,v 1.2 2021/07/18 11:25:47 schwarze Exp $
2.\"
3.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 18 2021 $
18.Dt MAKEINODES 1
19.Os
20.Sh NAME
21.Nm makeinodes
22.Nd create files such that inode numbers hash in a defined order
23.Sh SYNOPSIS
24.Nm makeinodes
25.Op Fl r
26.Ar dirname
27.Sh DESCRIPTION
28The
29.Nm
30utility creates a directory
31.Ar dirname
32with a subdirectory
33.Pa man1
34and two empty files
35.Pa man1/one.1
36and
37.Pa man1/two.1
38such that the lowest six bits of the inode number of file
39.Pa one.1
40are smaller than the lowest six bits of the inode number of file
41.Pa two.1 .
42If
43.Fl r
44is specified, the reverse order is produced.
45.Pp
46This is useful to test the behaviour of the
47.Xr makewhatis 8
48program which hashes files with
49.Xr ohash_init 3
50according to their inode numbers, such that fully testing all the
51code paths requires test files hashing in a well-defined order.
52.Pp
53Once the files have been created with
54.Nm ,
55their content can be provided with
56.Xr cat 1 .
57.Sh EXIT STATUS
58.Ex -std
59It may fail when creation of a directory or file,
60lookup of an inode number, or renaming of a file fails.
61.Sh AUTHORS
62.An Ingo Schwarze Aq Mt schwarze@openbsd.org
63