| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ffs_snapshot.c,v 1.82.4.3 2010/03/28 17:28:33 snj Exp $ */ | | 1 | /* $NetBSD: ffs_snapshot.c,v 1.82.4.3.4.1 2011/01/07 03:14:46 matt Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved. | | 4 | * Copyright 2000 Marshall Kirk McKusick. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Further information about snapshots can be obtained from: | | 6 | * Further information about snapshots can be obtained from: |
7 | * | | 7 | * |
8 | * Marshall Kirk McKusick http://www.mckusick.com/softdep/ | | 8 | * Marshall Kirk McKusick http://www.mckusick.com/softdep/ |
9 | * 1614 Oxford Street mckusick@mckusick.com | | 9 | * 1614 Oxford Street mckusick@mckusick.com |
10 | * Berkeley, CA 94709-1608 +1-510-843-9542 | | 10 | * Berkeley, CA 94709-1608 +1-510-843-9542 |
11 | * USA | | 11 | * USA |
12 | * | | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | | 13 | * Redistribution and use in source and binary forms, with or without |
14 | * modification, are permitted provided that the following conditions | | 14 | * modification, are permitted provided that the following conditions |
| @@ -28,27 +28,27 @@ | | | @@ -28,27 +28,27 @@ |
28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 29 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 30 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 31 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 32 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
33 | * SUCH DAMAGE. | | 33 | * SUCH DAMAGE. |
34 | * | | 34 | * |
35 | * @(#)ffs_snapshot.c 8.11 (McKusick) 7/23/00 | | 35 | * @(#)ffs_snapshot.c 8.11 (McKusick) 7/23/00 |
36 | * | | 36 | * |
37 | * from FreeBSD: ffs_snapshot.c,v 1.79 2004/02/13 02:02:06 kuriyama Exp | | 37 | * from FreeBSD: ffs_snapshot.c,v 1.79 2004/02/13 02:02:06 kuriyama Exp |
38 | */ | | 38 | */ |
39 | | | 39 | |
40 | #include <sys/cdefs.h> | | 40 | #include <sys/cdefs.h> |
41 | __KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.82.4.3 2010/03/28 17:28:33 snj Exp $"); | | 41 | __KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.82.4.3.4.1 2011/01/07 03:14:46 matt Exp $"); |
42 | | | 42 | |
43 | #if defined(_KERNEL_OPT) | | 43 | #if defined(_KERNEL_OPT) |
44 | #include "opt_ffs.h" | | 44 | #include "opt_ffs.h" |
45 | #endif | | 45 | #endif |
46 | | | 46 | |
47 | #include <sys/param.h> | | 47 | #include <sys/param.h> |
48 | #include <sys/kernel.h> | | 48 | #include <sys/kernel.h> |
49 | #include <sys/systm.h> | | 49 | #include <sys/systm.h> |
50 | #include <sys/conf.h> | | 50 | #include <sys/conf.h> |
51 | #include <sys/buf.h> | | 51 | #include <sys/buf.h> |
52 | #include <sys/proc.h> | | 52 | #include <sys/proc.h> |
53 | #include <sys/namei.h> | | 53 | #include <sys/namei.h> |
54 | #include <sys/sched.h> | | 54 | #include <sys/sched.h> |
| @@ -167,27 +167,27 @@ ffs_snapshot_fini(struct ufsmount *ump) | | | @@ -167,27 +167,27 @@ ffs_snapshot_fini(struct ufsmount *ump) |
167 | int | | 167 | int |
168 | ffs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime) | | 168 | ffs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime) |
169 | { | | 169 | { |
170 | #if defined(FFS_NO_SNAPSHOT) | | 170 | #if defined(FFS_NO_SNAPSHOT) |
171 | return EOPNOTSUPP; | | 171 | return EOPNOTSUPP; |
172 | } | | 172 | } |
173 | #else /* defined(FFS_NO_SNAPSHOT) */ | | 173 | #else /* defined(FFS_NO_SNAPSHOT) */ |
174 | bool suspended = false; | | 174 | bool suspended = false; |
175 | bool snapshot_locked = false; | | 175 | bool snapshot_locked = false; |
176 | int error, redo = 0, snaploc; | | 176 | int error, redo = 0, snaploc; |
177 | void *sbbuf = NULL; | | 177 | void *sbbuf = NULL; |
178 | daddr_t *snaplist = NULL, snaplistsize = 0; | | 178 | daddr_t *snaplist = NULL, snaplistsize = 0; |
179 | struct buf *bp, *nbp; | | 179 | struct buf *bp, *nbp; |
180 | struct fs *copy_fs, *fs = VFSTOUFS(mp)->um_fs; | | 180 | struct fs *copy_fs = NULL, *fs = VFSTOUFS(mp)->um_fs; |
181 | struct inode *ip = VTOI(vp); | | 181 | struct inode *ip = VTOI(vp); |
182 | struct lwp *l = curlwp; | | 182 | struct lwp *l = curlwp; |
183 | struct snap_info *si = VFSTOUFS(mp)->um_snapinfo; | | 183 | struct snap_info *si = VFSTOUFS(mp)->um_snapinfo; |
184 | struct timespec ts; | | 184 | struct timespec ts; |
185 | struct timeval starttime; | | 185 | struct timeval starttime; |
186 | #ifdef DEBUG | | 186 | #ifdef DEBUG |
187 | struct timeval endtime; | | 187 | struct timeval endtime; |
188 | #endif | | 188 | #endif |
189 | struct vnode *devvp = ip->i_devvp; | | 189 | struct vnode *devvp = ip->i_devvp; |
190 | | | 190 | |
191 | /* | | 191 | /* |
192 | * If the vnode already is a snapshot, return. | | 192 | * If the vnode already is a snapshot, return. |
193 | */ | | 193 | */ |