[BACK]Return to t_snapshot_v2.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tests / fs / ffs

File: [cvs.NetBSD.org] / src / tests / fs / ffs / t_snapshot_v2.c (download)

Revision 1.2, Wed Feb 6 09:05:01 2013 UTC (8 years, 2 months ago) by hannken
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, pgoyette-localcount-base, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, localcount-20160914, agc-symver-base, agc-symver
Branch point for: pgoyette-localcount
Changes since 1.1: +2 -1 lines

Test taking a snapshot from a stressed file system.
Checks snapshot meta data only with fsck.

OK: Antti Kantee <pooka@netbsd.org>

/*	$NetBSD: t_snapshot_v2.c,v 1.2 2013/02/06 09:05:01 hannken Exp $	*/

#include <sys/types.h>
#include <sys/mount.h>

#include <rump/rump.h>
#include <rump/rump_syscalls.h>

#include <ufs/ufs/ufsmount.h>

#include <atf-c.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include "../../h_macros.h"

#define IMGNAME "ffs.img"
#define NEWFS "newfs -F -s 10000 -O 2 " IMGNAME
#define FSCK "fsck_ffs -fn -F"
#define BAKNAME "/mnt/le_snapp"

static void
mount_diskfs(const char *fspec, const char *path)
	struct ufs_args uargs;

	uargs.fspec = __UNCONST(fspec);

	if (rump_sys_mount(MOUNT_FFS, path, 0, &uargs, sizeof(uargs)) == -1)
		atf_tc_fail_errno("mount ffs %s", path);

static void

	/* empty */

#include "../common/snapshot.c"