ulfs_snapshot.c revision 1.2.2.2 1 1.2.2.2 tls /* $NetBSD: ulfs_snapshot.c,v 1.2.2.2 2013/06/23 06:18:39 tls Exp $ */
2 1.2.2.2 tls /* from ffs_snapshot.c,v 1.122 2013/05/07 09:40:54 hannken Exp */
3 1.2.2.2 tls
4 1.2.2.2 tls /*
5 1.2.2.2 tls * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved.
6 1.2.2.2 tls *
7 1.2.2.2 tls * Further information about snapshots can be obtained from:
8 1.2.2.2 tls *
9 1.2.2.2 tls * Marshall Kirk McKusick http://www.mckusick.com/softdep/
10 1.2.2.2 tls * 1614 Oxford Street mckusick (at) mckusick.com
11 1.2.2.2 tls * Berkeley, CA 94709-1608 +1-510-843-9542
12 1.2.2.2 tls * USA
13 1.2.2.2 tls *
14 1.2.2.2 tls * Redistribution and use in source and binary forms, with or without
15 1.2.2.2 tls * modification, are permitted provided that the following conditions
16 1.2.2.2 tls * are met:
17 1.2.2.2 tls *
18 1.2.2.2 tls * 1. Redistributions of source code must retain the above copyright
19 1.2.2.2 tls * notice, this list of conditions and the following disclaimer.
20 1.2.2.2 tls * 2. Redistributions in binary form must reproduce the above copyright
21 1.2.2.2 tls * notice, this list of conditions and the following disclaimer in the
22 1.2.2.2 tls * documentation and/or other materials provided with the distribution.
23 1.2.2.2 tls *
24 1.2.2.2 tls * THIS SOFTWARE IS PROVIDED BY MARSHALL KIRK MCKUSICK ``AS IS'' AND ANY
25 1.2.2.2 tls * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 1.2.2.2 tls * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 1.2.2.2 tls * DISCLAIMED. IN NO EVENT SHALL MARSHALL KIRK MCKUSICK BE LIABLE FOR
28 1.2.2.2 tls * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 1.2.2.2 tls * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 1.2.2.2 tls * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 1.2.2.2 tls * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 1.2.2.2 tls * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 1.2.2.2 tls * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 1.2.2.2 tls * SUCH DAMAGE.
35 1.2.2.2 tls *
36 1.2.2.2 tls * @(#)ffs_snapshot.c 8.11 (McKusick) 7/23/00
37 1.2.2.2 tls *
38 1.2.2.2 tls * from FreeBSD: ffs_snapshot.c,v 1.79 2004/02/13 02:02:06 kuriyama Exp
39 1.2.2.2 tls */
40 1.2.2.2 tls
41 1.2.2.2 tls #include <sys/cdefs.h>
42 1.2.2.2 tls __KERNEL_RCSID(0, "$NetBSD: ulfs_snapshot.c,v 1.2.2.2 2013/06/23 06:18:39 tls Exp $");
43 1.2.2.2 tls
44 1.2.2.2 tls #if defined(_KERNEL_OPT)
45 1.2.2.2 tls #include "opt_lfs.h"
46 1.2.2.2 tls #endif
47 1.2.2.2 tls
48 1.2.2.2 tls #include <sys/param.h>
49 1.2.2.2 tls #include <sys/kernel.h>
50 1.2.2.2 tls #include <sys/systm.h>
51 1.2.2.2 tls #include <sys/conf.h>
52 1.2.2.2 tls #include <sys/buf.h>
53 1.2.2.2 tls #include <sys/proc.h>
54 1.2.2.2 tls #include <sys/namei.h>
55 1.2.2.2 tls #include <sys/sched.h>
56 1.2.2.2 tls #include <sys/stat.h>
57 1.2.2.2 tls #include <sys/malloc.h>
58 1.2.2.2 tls #include <sys/mount.h>
59 1.2.2.2 tls #include <sys/resource.h>
60 1.2.2.2 tls #include <sys/resourcevar.h>
61 1.2.2.2 tls #include <sys/vnode.h>
62 1.2.2.2 tls #include <sys/kauth.h>
63 1.2.2.2 tls #include <sys/fstrans.h>
64 1.2.2.2 tls #include <sys/wapbl.h>
65 1.2.2.2 tls
66 1.2.2.2 tls #include <miscfs/specfs/specdev.h>
67 1.2.2.2 tls
68 1.2.2.2 tls #include <ufs/lfs/ulfs_quotacommon.h>
69 1.2.2.2 tls #include <ufs/lfs/ulfsmount.h>
70 1.2.2.2 tls #include <ufs/lfs/ulfs_inode.h>
71 1.2.2.2 tls #include <ufs/lfs/ulfs_extern.h>
72 1.2.2.2 tls #include <ufs/lfs/ulfs_bswap.h>
73 1.2.2.2 tls
74 1.2.2.2 tls #include <ufs/lfs/lfs.h>
75 1.2.2.2 tls #include <ufs/lfs/lfs_extern.h>
76 1.2.2.2 tls
77 1.2.2.2 tls #include <uvm/uvm.h>
78 1.2.2.2 tls
79 1.2.2.2 tls /*
80 1.2.2.2 tls * Decrement extra reference on snapshot when last name is removed.
81 1.2.2.2 tls * It will not be freed until the last open reference goes away.
82 1.2.2.2 tls */
83 1.2.2.2 tls void
84 1.2.2.2 tls ulfs_snapgone(struct inode *ip)
85 1.2.2.2 tls {
86 1.2.2.2 tls (void)ip;
87 1.2.2.2 tls /* just panic */
88 1.2.2.2 tls panic("reached ulfs_snapgone\n");
89 1.2.2.2 tls }
90