HAMMER part 1/many. This is a clear-my-plate commit.
[dragonfly.git] / sys / vfs / hammer / hammer_vnops.c
CommitLineData
427e5fc6
MD
1/*
2 * Copyright (c) 2007 The DragonFly Project. All rights reserved.
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 *
34 * $DragonFly: src/sys/vfs/hammer/hammer_vnops.c,v 1.1 2007/11/01 20:53:05 dillon Exp $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>
40#include <sys/fcntl.h>
41#include <sys/namecache.h>
42#include <sys/vnode.h>
43#include <sys/lockf.h>
44#include <sys/event.h>
45#include <sys/stat.h>
46#include "hammer.h"
47
48/*
49 * USERFS VNOPS
50 */
51/*static int hammer_vop_vnoperate(struct vop_generic_args *);*/
52static int hammer_vop_fsync (struct vop_fsync_args *);
53static int hammer_vop_read (struct vop_read_args *);
54static int hammer_vop_write (struct vop_write_args *);
55static int hammer_vop_access (struct vop_access_args *);
56static int hammer_vop_advlock (struct vop_advlock_args *);
57static int hammer_vop_close (struct vop_close_args *);
58static int hammer_vop_ncreate (struct vop_ncreate_args *);
59static int hammer_vop_getattr (struct vop_getattr_args *);
60static int hammer_vop_nresolve (struct vop_nresolve_args *);
61static int hammer_vop_nlookupdotdot (struct vop_nlookupdotdot_args *);
62static int hammer_vop_nlink (struct vop_nlink_args *);
63static int hammer_vop_nmkdir (struct vop_nmkdir_args *);
64static int hammer_vop_nmknod (struct vop_nmknod_args *);
65static int hammer_vop_open (struct vop_open_args *);
66static int hammer_vop_pathconf (struct vop_pathconf_args *);
67static int hammer_vop_print (struct vop_print_args *);
68static int hammer_vop_readdir (struct vop_readdir_args *);
69static int hammer_vop_readlink (struct vop_readlink_args *);
70static int hammer_vop_nremove (struct vop_nremove_args *);
71static int hammer_vop_nrename (struct vop_nrename_args *);
72static int hammer_vop_nrmdir (struct vop_nrmdir_args *);
73static int hammer_vop_setattr (struct vop_setattr_args *);
74static int hammer_vop_strategy (struct vop_strategy_args *);
75static int hammer_vop_nsymlink (struct vop_nsymlink_args *);
76static int hammer_vop_nwhiteout (struct vop_nwhiteout_args *);
77
78struct vop_ops hammer_vnode_vops = {
79 .vop_default = vop_defaultop,
80 .vop_fsync = hammer_vop_fsync,
81 .vop_read = hammer_vop_read,
82 .vop_write = hammer_vop_write,
83 .vop_access = hammer_vop_access,
84 .vop_advlock = hammer_vop_advlock,
85 .vop_close = hammer_vop_close,
86 .vop_ncreate = hammer_vop_ncreate,
87 .vop_getattr = hammer_vop_getattr,
88 .vop_inactive = hammer_vop_inactive,
89 .vop_reclaim = hammer_vop_reclaim,
90 .vop_nresolve = hammer_vop_nresolve,
91 .vop_nlookupdotdot = hammer_vop_nlookupdotdot,
92 .vop_nlink = hammer_vop_nlink,
93 .vop_nmkdir = hammer_vop_nmkdir,
94 .vop_nmknod = hammer_vop_nmknod,
95 .vop_open = hammer_vop_open,
96 .vop_pathconf = hammer_vop_pathconf,
97 .vop_print = hammer_vop_print,
98 .vop_readdir = hammer_vop_readdir,
99 .vop_readlink = hammer_vop_readlink,
100 .vop_nremove = hammer_vop_nremove,
101 .vop_nrename = hammer_vop_nrename,
102 .vop_nrmdir = hammer_vop_nrmdir,
103 .vop_setattr = hammer_vop_setattr,
104 .vop_strategy = hammer_vop_strategy,
105 .vop_nsymlink = hammer_vop_nsymlink,
106 .vop_nwhiteout = hammer_vop_nwhiteout
107};
108
109#if 0
110static
111int
112hammer_vop_vnoperate(struct vop_generic_args *)
113{
114 return (VOCALL(&hammer_vnode_vops, ap));
115}
116#endif
117
118static
119int
120hammer_vop_fsync (struct vop_fsync_args *ap)
121{
122 return EOPNOTSUPP;
123}
124
125static
126int
127hammer_vop_read (struct vop_read_args *ap)
128{
129 return EOPNOTSUPP;
130}
131
132static
133int
134hammer_vop_write (struct vop_write_args *ap)
135{
136 /* XXX UIO_NOCOPY */
137 return EOPNOTSUPP;
138}
139
140static
141int
142hammer_vop_access (struct vop_access_args *ap)
143{
144 return EOPNOTSUPP;
145}
146
147static
148int
149hammer_vop_advlock (struct vop_advlock_args *ap)
150{
151 return EOPNOTSUPP;
152}
153
154static
155int
156hammer_vop_close (struct vop_close_args *ap)
157{
158 return EOPNOTSUPP;
159}
160
161static
162int
163hammer_vop_ncreate (struct vop_ncreate_args *ap)
164{
165 return EOPNOTSUPP;
166}
167
168static
169int
170hammer_vop_getattr (struct vop_getattr_args *ap)
171{
172 return EOPNOTSUPP;
173}
174
175static
176int
177hammer_vop_nresolve (struct vop_nresolve_args *ap)
178{
179 return EOPNOTSUPP;
180}
181
182static
183int
184hammer_vop_nlookupdotdot (struct vop_nlookupdotdot_args *ap)
185{
186 return EOPNOTSUPP;
187}
188
189static
190int
191hammer_vop_nlink (struct vop_nlink_args *ap)
192{
193 return EOPNOTSUPP;
194}
195
196static
197int
198hammer_vop_nmkdir (struct vop_nmkdir_args *ap)
199{
200 return EOPNOTSUPP;
201}
202
203static
204int
205hammer_vop_nmknod (struct vop_nmknod_args *ap)
206{
207 return EOPNOTSUPP;
208}
209
210static
211int
212hammer_vop_open (struct vop_open_args *ap)
213{
214 return EOPNOTSUPP;
215}
216
217static
218int
219hammer_vop_pathconf (struct vop_pathconf_args *ap)
220{
221 return EOPNOTSUPP;
222}
223
224static
225int
226hammer_vop_print (struct vop_print_args *ap)
227{
228 return EOPNOTSUPP;
229}
230
231static
232int
233hammer_vop_readdir (struct vop_readdir_args *ap)
234{
235 return EOPNOTSUPP;
236}
237
238static
239int
240hammer_vop_readlink (struct vop_readlink_args *ap)
241{
242 return EOPNOTSUPP;
243}
244
245static
246int
247hammer_vop_nremove (struct vop_nremove_args *ap)
248{
249 return EOPNOTSUPP;
250}
251
252static
253int
254hammer_vop_nrename (struct vop_nrename_args *ap)
255{
256 return EOPNOTSUPP;
257}
258
259static
260int
261hammer_vop_nrmdir (struct vop_nrmdir_args *ap)
262{
263 return EOPNOTSUPP;
264}
265
266static
267int
268hammer_vop_setattr (struct vop_setattr_args *ap)
269{
270 return EOPNOTSUPP;
271}
272
273static
274int
275hammer_vop_strategy (struct vop_strategy_args *ap)
276{
277 return EOPNOTSUPP;
278}
279
280static
281int
282hammer_vop_nsymlink (struct vop_nsymlink_args *ap)
283{
284 return EOPNOTSUPP;
285}
286
287static
288int
289hammer_vop_nwhiteout (struct vop_nwhiteout_args *ap)
290{
291 return EOPNOTSUPP;
292}
293