1.\" 2.\" Copyright (c) 2015 The DragonFly Project. All rights reserved. 3.\" 4.\" This code is derived from software contributed to The DragonFly Project 5.\" by Antonio Huete Jimenez <tuxillo@quantumachine.net> 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 11.\" 1. Redistributions of source code must retain the above copyright 12.\" notice, this list of conditions and the following disclaimer. 13.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" notice, this list of conditions and the following disclaimer in 15.\" the documentation and/or other materials provided with the 16.\" distribution. 17.\" 3. Neither the name of The DragonFly Project nor the names of its 18.\" contributors may be used to endorse or promote products derived 19.\" from this software without specific, prior written permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 27.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 29.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 31.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.Dd February 19, 2015 35.Dt LIBHAMMER 3 36.Os 37.Sh NAME 38.Nm hammer 39.Nd HAMMER file system interface 40.Sh LIBRARY 41.Lb libhammer 42.Sh SYNOPSIS 43.In libhammer.h 44.Sh DESCRIPTION 45The 46.Nm 47library provides a set of functions which serve as an interface to applications 48that need to obtain information or perform maintenance operations in 49.Xr HAMMER 5 50file systems. 51.Sh INTRODUCTION 52This library is an attempt to factor out most of the code in the initial 53.Xr hammer 8 54program greatly reducing its complexity and taking advantage of all the 55functionality it contained helping other programs to reuse it. 56.Pp 57There are several parts of the 58.Xr HAMMER 5 59file system for which this library provides an API: 60.Bl -bullet 61.It 62.Em Information facilities: 63The following information is gathered and exposed by this library: 64.Bl -dash -offset indent 65.It 66File system specific information such as size, big block details, version, 67PFSes, snapshots, mount points. 68.It 69Statistical data like number of B-Tree operations, number of device operations, 70number of undo operations. 71.El 72.It 73.Em Pseudo-file systems: 74These are independent sub file systems within a HAMMER file system. 75After 76.Nm 77library initialisation the list of pseudo-file systems will be available in the 78.Vt libhammer_fsinfo 79structure within a 80.Dv TAILQ . 81.Pp 82Creating and deleting pseudo-file systems is not yet supported by this library. 83.It 84.Em Snapshots: 85Per PFS point in time snapshots are kept in the file system meta-data since 86HAMMER version 3. 87A list of snapshots is collected and placed within a 88.Dv TAILQ 89for each PFS. 90.Pp 91Creating and deleting snapshots is not yet supported by this library. 92.El 93.Sh INITIALISATION 94Before any API call the library must be initalised with the 95.Fn libhammer_get_fsinfo 96function. 97This will perform all the operations needed to initialise the data structures in 98which the API function rely for the specified HAMMER file system. 99.Pp 100Once you are done, the special function 101.Fn libhammer_free_fsinfo 102will release all the resources used by the library during its initialisation and 103usage. 104.Sh SEE ALSO 105.Xr HAMMER 5 , 106.Xr hammer 8 , 107.Xr libhammer_fsinfo 3 , 108.Xr libhammer_snapshot 3 , 109.Xr libhammer_stats 3 110.Sh AUTHORS 111This man page was written by 112.An Antonio Huete Jimenez Aq Mt tuxillo@quantumachine.net . 113.Sh BUGS 114Please note that, at the moment of writing this man page, the 115.Nm 116library is incomplete. 117