| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: p2k.c,v 1.66 2015/04/20 23:03:07 riastradh Exp $ */ | | 1 | /* $NetBSD: p2k.c,v 1.67 2016/01/23 16:39:31 christos Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Development of this software was supported by the | | 6 | * Development of this software was supported by the |
7 | * Finnish Cultural Foundation. | | 7 | * Finnish Cultural Foundation. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -36,42 +36,43 @@ | | | @@ -36,42 +36,43 @@ |
36 | * reference counting. We must maintain a vnode alive and kicking | | 36 | * reference counting. We must maintain a vnode alive and kicking |
37 | * until the kernel tells us to reclaim it. Therefore we make sure | | 37 | * until the kernel tells us to reclaim it. Therefore we make sure |
38 | * we never accidentally lose a vnode. Before calling operations which | | 38 | * we never accidentally lose a vnode. Before calling operations which |
39 | * decrease the refcount we always bump the refcount up to compensate. | | 39 | * decrease the refcount we always bump the refcount up to compensate. |
40 | * Come inactive, if the file system thinks that the vnode should be | | 40 | * Come inactive, if the file system thinks that the vnode should be |
41 | * put out of its misery, it will set the recycle flag. We use this | | 41 | * put out of its misery, it will set the recycle flag. We use this |
42 | * to tell the kernel to reclaim the vnode. Only in reclaim do we | | 42 | * to tell the kernel to reclaim the vnode. Only in reclaim do we |
43 | * really nuke the last reference. | | 43 | * really nuke the last reference. |
44 | */ | | 44 | */ |
45 | | | 45 | |
46 | #include <sys/cdefs.h> | | 46 | #include <sys/cdefs.h> |
47 | #include <sys/mount.h> | | 47 | #include <sys/mount.h> |
48 | #include <sys/param.h> | | 48 | #include <sys/param.h> |
49 | #include <sys/vnode.h> | | | |
50 | #include <sys/lock.h> | | 49 | #include <sys/lock.h> |
51 | #include <sys/namei.h> | | 50 | #include <sys/namei.h> |
52 | #include <sys/dirent.h> | | 51 | #include <sys/dirent.h> |
53 | #include <sys/hash.h> | | 52 | #include <sys/hash.h> |
54 | | | 53 | |
55 | #include <assert.h> | | 54 | #include <assert.h> |
56 | #include <errno.h> | | 55 | #include <errno.h> |
57 | #include <puffs.h> | | 56 | #include <puffs.h> |
58 | #include <stdlib.h> | | 57 | #include <stdlib.h> |
59 | #include <stdio.h> | | 58 | #include <stdio.h> |
60 | | | 59 | |
61 | #include <rump/rump.h> | | 60 | #include <rump/rump.h> |
62 | #include <rump/p2k.h> | | 61 | #include <rump/p2k.h> |
63 | #include <rump/ukfs.h> | | 62 | #include <rump/ukfs.h> |
64 | | | 63 | |
| | | 64 | #include <uvm/uvm_pager.h> |
| | | 65 | |
65 | /* NetBSD-5 compat */ | | 66 | /* NetBSD-5 compat */ |
66 | #ifndef MOUNT_RUMPFS | | 67 | #ifndef MOUNT_RUMPFS |
67 | #define MOUNT_RUMPFS "rumpfs" | | 68 | #define MOUNT_RUMPFS "rumpfs" |
68 | #endif | | 69 | #endif |
69 | | | 70 | |
70 | PUFFSOP_PROTOS(p2k) | | 71 | PUFFSOP_PROTOS(p2k) |
71 | | | 72 | |
72 | LIST_HEAD(p2k_vp_hash, p2k_node); | | 73 | LIST_HEAD(p2k_vp_hash, p2k_node); |
73 | #define NHASHBUCK (1<<16) | | 74 | #define NHASHBUCK (1<<16) |
74 | struct p2k_mount { | | 75 | struct p2k_mount { |
75 | struct vnode *p2m_rvp; | | 76 | struct vnode *p2m_rvp; |
76 | struct puffs_usermount *p2m_pu; | | 77 | struct puffs_usermount *p2m_pu; |
77 | struct ukfs *p2m_ukfs; | | 78 | struct ukfs *p2m_ukfs; |