1.\" $NetBSD: fss.4,v 1.15 2011/02/24 09:38:57 hannken Exp $ */ 2.\" 3.\" 4.\" Copyright (c) 2003 The NetBSD Foundation, Inc. 5.\" All rights reserved. 6.\" 7.\" This code is derived from software contributed to The NetBSD Foundation 8.\" by Juergen Hannken-Illjes. 9.\" 10.\" Redistribution and use in source and binary forms, with or without 11.\" modification, are permitted provided that the following conditions 12.\" are met: 13.\" 1. Redistributions of source code must retain the above copyright 14.\" notice, this list of conditions and the following disclaimer. 15.\" 2. Redistributions in binary form must reproduce the above copyright 16.\" notice, this list of conditions and the following disclaimer in the 17.\" documentation and/or other materials provided with the distribution. 18.\" 19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29.\" POSSIBILITY OF SUCH DAMAGE. 30.\" 31.Dd February 24, 2011 32.Dt FSS 4 33.Os 34.Sh NAME 35.Nm fss 36.Nd file system snapshot device 37.Sh SYNOPSIS 38.Cd "pseudo-device fss 4" 39.Sh DESCRIPTION 40The 41.Nm 42driver provides a read-only interface to the snapshot of a currently 43mounted file system. 44Reading from a 45.Nm 46device gives the view of the file system when the snapshot was taken. 47It can be configured via 48.Xr ioctl 2 . 49.Sh IOCTLS 50The 51.Xr ioctl 2 52command codes below are defined in 53.In sys/dev/fssvar.h . 54.Pp 55The (third) argument to 56.Xr ioctl 2 57should be a pointer to the type indicated. 58.Bl -tag -width 8n 59.It Dv FSSIOCSET(struct fss_set) 60Configures a 61.Nm 62device. 63.Bd -literal -offset indent 64struct fss_set { 65 char *fss_mount; 66 char *fss_bstore; 67 blksize_t fss_csize; 68 int fss_flags; 69}; 70.Ed 71.Pp 72The struct element 73.Va fss_mount 74is the mount point of the file system. 75The struct element 76.Va fss_bstore 77is either a regular file or a raw disk device where data overwritten on 78the file system will be saved. 79The struct element 80.Va fss_csize 81is the preferred size of this data. 82The struct element 83.Va fss_flags 84is the initial set of flags. 85.It Dv FSSIOCGET(struct fss_get) 86Gets the status of a 87.Nm 88device. 89.Bd -literal -offset indent 90struct fss_get { 91 char fsg_mount[MNAMELEN]; 92 struct timeval fsg_time; 93 blksize_t fsg_csize; 94 blkcnt_t fsg_mount_size; 95 blkcnt_t fsg_bs_size; 96}; 97.Ed 98The struct element 99.Va fsg_mount 100is the mount point of the file system. 101The struct element 102.Va fsg_time 103is the time this snapshot was taken. 104The struct element 105.Va fsg_csize 106is the current size of data clusters. 107The struct element 108.Va fsg_mount_size 109is the number of clusters of the file system. 110The struct element 111.Va fsg_bs_size 112is the number of clusters written to the backing store. 113.It Dv FSSIOCCLR 114Unconfigures a 115.Nm 116device. 117.It Dv FSSIOFSET(int) 118Sets the flags of a 119.Nm 120device. 121Possible flags are: 122.Bl -tag -width Dv 123.It Dv FSS_UNCONFIG_ON_CLOSE 124Unconfigure the 125.Nm 126device on the last close. 127.It Dv FSS_UNLINK_ON_CREATE 128Unlink the backing file before the 129.Nm 130device is created. 131.El 132.It Dv FSSIOFGET(int) 133Gets the flags of a 134.Nm 135device. 136.El 137.Sh KERNEL THREADS 138For each active snapshot device there is a kernel thread 139that handles the backing store. 140This thread is named 141.Va fssN 142where 143.Va N 144is the device minor number. 145.Sh FILES 146.Bl -tag -width /dev/rfss? -compact 147.It Pa /dev/rfss? 148.It Pa /dev/fss? 149.El 150.Sh SEE ALSO 151.Xr fssconfig 8 , 152.Xr mount 8 , 153.Xr umount 8 154.Sh HISTORY 155The 156.Nm 157device appeared in 158.Nx 2.0 . 159