xref: /netbsd-src/tests/fs/ffs/t_snapshot_log.c (revision c2f76ff004a2cb67efe5b12d97bd3ef7fe89e18d)
1 /*	$NetBSD: t_snapshot_log.c,v 1.1 2010/11/05 11:32:09 pooka Exp $	*/
2 
3 #include <sys/types.h>
4 #include <sys/mount.h>
5 
6 #include <rump/rump.h>
7 #include <rump/rump_syscalls.h>
8 
9 #include <ufs/ufs/ufsmount.h>
10 
11 #include <atf-c.h>
12 #include <fcntl.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <unistd.h>
17 
18 #include "../../h_macros.h"
19 
20 #define IMGNAME "ffs.img"
21 #define NEWFS "newfs -F -s 10000 " IMGNAME
22 #define BAKNAME "/mnt/le_snapp"
23 
24 static void
25 mount_diskfs(const char *fspec, const char *path)
26 {
27 	struct ufs_args uargs;
28 	static int flags = MNT_LOG;
29 
30 	uargs.fspec = __UNCONST(fspec);
31 
32 	if (rump_sys_mount(MOUNT_FFS,
33 	    path, flags, &uargs, sizeof(uargs)) == -1)
34 		atf_tc_fail_errno("mount ffs %s", path);
35 	flags = 0;
36 }
37 
38 static void
39 begin(void)
40 {
41 
42 	/* empty */
43 }
44 
45 #include "../common/snapshot.c"
46