aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/makefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/makefs/makefs.h')
-rw-r--r--usr.sbin/makefs/makefs.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/usr.sbin/makefs/makefs.h b/usr.sbin/makefs/makefs.h
index 68dc0362dd21..3cd56a036670 100644
--- a/usr.sbin/makefs/makefs.h
+++ b/usr.sbin/makefs/makefs.h
@@ -35,13 +35,17 @@
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#ifndef _MAKEFS_H
#define _MAKEFS_H
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#else
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#endif
+
#include <sys/stat.h>
#include <err.h>
@@ -58,7 +62,7 @@
*
* name "." "bin" "netbsd"
* type S_IFDIR S_IFDIR S_IFREG
- * next > > NULL
+ * next > > NULL
* parent NULL NULL NULL
* child NULL v
*
@@ -78,15 +82,26 @@ enum fi_flags {
FI_SIZED = 1<<0, /* inode sized */
FI_ALLOCATED = 1<<1, /* fsinode->ino allocated */
FI_WRITTEN = 1<<2, /* inode written */
+ FI_ROOT = 1<<3, /* root of a ZFS dataset */
};
typedef struct {
uint32_t ino; /* inode number used on target fs */
uint32_t nlink; /* number of links to this entry */
enum fi_flags flags; /* flags used by fs specific code */
+ void *param; /* for use by individual fs impls */
struct stat st; /* stat entry */
+#if !HAVE_STRUCT_STAT_ST_FLAGS
+ uint32_t st_flags; /* stand-in for st.st_flags */
+#endif
} fsinode;
+#if HAVE_STRUCT_STAT_ST_FLAGS
+#define FSINODE_ST_FLAGS(inode) (inode).st.st_flags
+#else
+#define FSINODE_ST_FLAGS(inode) (inode).st_flags
+#endif
+
typedef struct _fsnode {
struct _fsnode *parent; /* parent (NULL if root) */
struct _fsnode *child; /* child (if type == S_IFDIR) */
@@ -173,6 +188,7 @@ fsnode * read_mtree(const char *, fsnode *);
int set_option(const option_t *, const char *, char *, size_t);
int set_option_var(const option_t *, const char *, const char *,
char *, size_t);
+void set_tstamp(fsnode *);
fsnode * walk_dir(const char *, const char *, fsnode *, fsnode *);
void free_fsnodes(fsnode *);
option_t * copy_opts(const option_t *);
@@ -186,6 +202,9 @@ void fs ## _makefs(const char *, const char *, fsnode *, fsinfo_t *)
DECLARE_FUN(cd9660);
DECLARE_FUN(ffs);
DECLARE_FUN(msdos);
+#ifdef HAVE_ZFS
+DECLARE_FUN(zfs);
+#endif
extern u_int debug;
extern int dupsok;