1.\" $NetBSD: fss.4,v 1.14 2010/11/05 10:02:53 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 November 5, 2010 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}; 69.Ed 70.Pp 71The struct element 72.Va fss_mount 73is the mount point of the file system. 74The struct element 75.Va fss_bstore 76is either a regular file or a raw disk device where data overwritten on 77the file system will be saved. 78The struct element 79.Va fss_csize 80is the preferred size of this data. 81.It Dv FSSIOCGET(struct fss_get) 82Gets the status of a 83.Nm 84device. 85.Bd -literal -offset indent 86struct fss_get { 87 char fsg_mount[MNAMELEN]; 88 struct timeval fsg_time; 89 blksize_t fsg_csize; 90 blkcnt_t fsg_mount_size; 91 blkcnt_t fsg_bs_size; 92}; 93.Ed 94The struct element 95.Va fsg_mount 96is the mount point of the file system. 97The struct element 98.Va fsg_time 99is the time this snapshot was taken. 100The struct element 101.Va fsg_csize 102is the current size of data clusters. 103The struct element 104.Va fsg_mount_size 105is the number of clusters of the file system. 106The struct element 107.Va fsg_bs_size 108is the number of clusters written to the backing store. 109.It Dv FSSIOCCLR 110Unconfigures a 111.Nm 112device. 113.It Dv FSSIOFSET(int) 114Sets the flags of a 115.Nm 116device. 117Possible flags are: 118.Bl -tag -width Dv 119.It Dv FSS_UNCONFIG_ON_CLOSE 120Unconfigure the 121.Nm 122device on the last close. 123.El 124.It Dv FSSIOFGET(int) 125Gets the flags of a 126.Nm 127device. 128.El 129.Sh KERNEL THREADS 130For each active snapshot device there is a kernel thread 131that handles the backing store. 132This thread is named 133.Va fssN 134where 135.Va N 136is the device minor number. 137.Sh FILES 138.Bl -tag -width /dev/rfss? -compact 139.It Pa /dev/rfss? 140.It Pa /dev/fss? 141.El 142.Sh SEE ALSO 143.Xr fssconfig 8 , 144.Xr mount 8 , 145.Xr umount 8 146.Sh HISTORY 147The 148.Nm 149device appeared in 150.Nx 2.0 . 151