This source file includes following definitions.
- xfs_make_dead_vnode
- xfs_init
- vfs_register
- vfs_unregister
- xfs_install_filesys
- xfs_uninstall_filesys
- xfs_stat_filesys
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 #include <xfs/xfs_locl.h>
35
36 RCSID("$arla: xfs_vfsops-openbsd.c,v 1.16 2003/06/02 18:26:50 lha Exp $");
37
38 #include <xfs/xfs_common.h>
39 #include <xfs/xfs_message.h>
40 #include <xfs/xfs_fs.h>
41 #include <xfs/xfs_dev.h>
42 #include <xfs/xfs_deb.h>
43 #include <xfs/xfs_vfsops.h>
44 #include <xfs/xfs_vfsops-bsd.h>
45 #include <xfs/xfs_vnodeops.h>
46
47 static vop_t **xfs_dead_vnodeop_p;
48
49 int
50 xfs_make_dead_vnode(struct mount *mp, struct vnode **vpp)
51 {
52 NNPFSDEB(XDEBNODE, ("make_dead_vnode mp = %lx\n",
53 (unsigned long)mp));
54
55 return getnewvnode(VT_NON, mp, xfs_dead_vnodeop_p, vpp);
56 }
57
58 static struct vnodeopv_entry_desc xfs_dead_vnodeop_entries[] = {
59 {&vop_default_desc, (vop_t *) xfs_eopnotsupp},
60 {&vop_lookup_desc, (vop_t *) xfs_dead_lookup},
61 {&vop_reclaim_desc, (vop_t *) xfs_returnzero},
62 {&vop_lock_desc, (vop_t *) vop_generic_lock},
63 {&vop_unlock_desc, (vop_t *) vop_generic_unlock},
64 {&vop_islocked_desc,(vop_t *) vop_generic_islocked},
65 {NULL, NULL}};
66
67 static struct vnodeopv_desc xfs_dead_vnodeop_opv_desc =
68 {&xfs_dead_vnodeop_p, xfs_dead_vnodeop_entries};
69
70 extern struct vnodeopv_desc xfs_vnodeop_opv_desc;
71
72 static int
73 xfs_init(struct vfsconf *vfs)
74 {
75 NNPFSDEB(XDEBVFOPS, ("xfs_init\n"));
76 vfs_opv_init_explicit(&xfs_vnodeop_opv_desc);
77 vfs_opv_init_default(&xfs_vnodeop_opv_desc);
78 vfs_opv_init_explicit(&xfs_dead_vnodeop_opv_desc);
79 vfs_opv_init_default(&xfs_dead_vnodeop_opv_desc);
80 return 0;
81 }
82
83 const struct vfsops xfs_vfsops = {
84 #ifdef HAVE_STRUCT_VFSOPS_VFS_MOUNT
85 xfs_mount_common,
86 #else
87 xfs_mount_caddr,
88 #endif
89 xfs_start,
90 xfs_unmount,
91 xfs_root,
92 xfs_quotactl,
93 xfs_statfs,
94 xfs_sync,
95 xfs_vget,
96 xfs_fhtovp,
97 xfs_vptofh,
98 xfs_init,
99 NULL,
100 #ifdef HAVE_STRUCT_VFSOPS_VFS_CHECKEXP
101 xfs_checkexp,
102 #endif
103 };
104
105 static struct vfsconf xfs_vfc = {
106 &xfs_vfsops,
107 "xfs",
108 0,
109 0,
110 0,
111 NULL,
112 NULL
113 };
114
115 #ifndef HAVE_KERNEL_VFS_REGISTER
116
117 static int
118 vfs_register (struct vfsconf *vfs)
119 {
120 struct vfsconf *vfsp;
121 struct vfsconf **vfspp;
122
123
124 for (vfspp = &vfsconf, vfsp = vfsconf;
125 vfsp;
126 vfspp = &vfsp->vfc_next, vfsp = vfsp->vfc_next)
127 if (strcmp(vfsp->vfc_name, vfs->vfc_name) == 0)
128 return (EEXIST);
129
130 maxvfsconf++;
131
132
133 *vfspp = vfs;
134
135 vfs->vfc_next = NULL;
136
137
138 NNPFSDEB(XDEBVFOPS, ("calling vfs_init\n"));
139 (*(vfs->vfc_vfsops->vfs_init)) (vfs);
140
141
142
143 return 0;
144 }
145
146 static int
147 vfs_unregister (struct vfsconf *vfs)
148 {
149 struct vfsconf *vfsp;
150 struct vfsconf **vfspp;
151
152
153 for (vfspp = &vfsconf, vfsp = vfsconf;
154 vfsp;
155 vfspp = &vfsp->vfc_next, vfsp = vfsp->vfc_next)
156 if (strcmp(vfsp->vfc_name, vfs->vfc_name) == 0)
157 break;
158
159 if (!vfsp)
160 return (ENOENT);
161
162 if (vfsp->vfc_refcount)
163 return (EBUSY);
164
165
166 *vfspp = vfsp->vfc_next;
167
168 maxvfsconf--;
169
170 return 0;
171 }
172
173 #endif
174
175 int
176 xfs_install_filesys(void)
177 {
178 return vfs_register (&xfs_vfc);
179 }
180
181 int
182 xfs_uninstall_filesys(void)
183 {
184 return vfs_unregister (&xfs_vfc);
185 }
186
187 int
188 xfs_stat_filesys (void)
189 {
190 return 0;
191 }