1 | /* $Id: vboxvfs_vnops.c 82968 2020-02-04 10:35:17Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Description.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2008-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #include "vboxvfs.h"
|
---|
19 | #include <sys/param.h>
|
---|
20 | #include <sys/systm.h>
|
---|
21 | #include <sys/namei.h>
|
---|
22 | #include <sys/kernel.h>
|
---|
23 | #include <sys/proc.h>
|
---|
24 | #include <sys/bio.h>
|
---|
25 | #include <sys/buf.h>
|
---|
26 | #include <sys/fcntl.h>
|
---|
27 | #include <sys/mount.h>
|
---|
28 | #include <sys/unistd.h>
|
---|
29 | #include <sys/vnode.h>
|
---|
30 | #include <sys/limits.h>
|
---|
31 | #include <sys/lockf.h>
|
---|
32 | #include <sys/stat.h>
|
---|
33 |
|
---|
34 | #include <vm/vm.h>
|
---|
35 | #include <vm/vm_extern.h>
|
---|
36 |
|
---|
37 | /*
|
---|
38 | * Prototypes for VBOXVFS vnode operations
|
---|
39 | */
|
---|
40 | static vop_create_t vboxvfs_create;
|
---|
41 | static vop_mknod_t vboxvfs_mknod;
|
---|
42 | static vop_open_t vboxvfs_open;
|
---|
43 | static vop_close_t vboxvfs_close;
|
---|
44 | static vop_access_t vboxvfs_access;
|
---|
45 | static vop_getattr_t vboxvfs_getattr;
|
---|
46 | static vop_setattr_t vboxvfs_setattr;
|
---|
47 | static vop_read_t vboxvfs_read;
|
---|
48 | static vop_write_t vboxvfs_write;
|
---|
49 | static vop_fsync_t vboxvfs_fsync;
|
---|
50 | static vop_remove_t vboxvfs_remove;
|
---|
51 | static vop_link_t vboxvfs_link;
|
---|
52 | static vop_lookup_t vboxvfs_lookup;
|
---|
53 | static vop_rename_t vboxvfs_rename;
|
---|
54 | static vop_mkdir_t vboxvfs_mkdir;
|
---|
55 | static vop_rmdir_t vboxvfs_rmdir;
|
---|
56 | static vop_symlink_t vboxvfs_symlink;
|
---|
57 | static vop_readdir_t vboxvfs_readdir;
|
---|
58 | static vop_strategy_t vboxvfs_strategy;
|
---|
59 | static vop_print_t vboxvfs_print;
|
---|
60 | static vop_pathconf_t vboxvfs_pathconf;
|
---|
61 | static vop_advlock_t vboxvfs_advlock;
|
---|
62 | static vop_getextattr_t vboxvfs_getextattr;
|
---|
63 | static vop_ioctl_t vboxvfs_ioctl;
|
---|
64 | static vop_getpages_t vboxvfs_getpages;
|
---|
65 | static vop_inactive_t vboxvfs_inactive;
|
---|
66 | static vop_putpages_t vboxvfs_putpages;
|
---|
67 | static vop_reclaim_t vboxvfs_reclaim;
|
---|
68 |
|
---|
69 | struct vop_vector vboxvfs_vnodeops = {
|
---|
70 | .vop_default = &default_vnodeops,
|
---|
71 |
|
---|
72 | .vop_access = vboxvfs_access,
|
---|
73 | .vop_advlock = vboxvfs_advlock,
|
---|
74 | .vop_close = vboxvfs_close,
|
---|
75 | .vop_create = vboxvfs_create,
|
---|
76 | .vop_fsync = vboxvfs_fsync,
|
---|
77 | .vop_getattr = vboxvfs_getattr,
|
---|
78 | .vop_getextattr = vboxvfs_getextattr,
|
---|
79 | .vop_getpages = vboxvfs_getpages,
|
---|
80 | .vop_inactive = vboxvfs_inactive,
|
---|
81 | .vop_ioctl = vboxvfs_ioctl,
|
---|
82 | .vop_link = vboxvfs_link,
|
---|
83 | .vop_lookup = vboxvfs_lookup,
|
---|
84 | .vop_mkdir = vboxvfs_mkdir,
|
---|
85 | .vop_mknod = vboxvfs_mknod,
|
---|
86 | .vop_open = vboxvfs_open,
|
---|
87 | .vop_pathconf = vboxvfs_pathconf,
|
---|
88 | .vop_print = vboxvfs_print,
|
---|
89 | .vop_putpages = vboxvfs_putpages,
|
---|
90 | .vop_read = vboxvfs_read,
|
---|
91 | .vop_readdir = vboxvfs_readdir,
|
---|
92 | .vop_reclaim = vboxvfs_reclaim,
|
---|
93 | .vop_remove = vboxvfs_remove,
|
---|
94 | .vop_rename = vboxvfs_rename,
|
---|
95 | .vop_rmdir = vboxvfs_rmdir,
|
---|
96 | .vop_setattr = vboxvfs_setattr,
|
---|
97 | .vop_strategy = vboxvfs_strategy,
|
---|
98 | .vop_symlink = vboxvfs_symlink,
|
---|
99 | .vop_write = vboxvfs_write,
|
---|
100 | };
|
---|
101 |
|
---|
102 | static int vboxvfs_access(struct vop_access_args *ap)
|
---|
103 | {
|
---|
104 | return 0;
|
---|
105 | }
|
---|
106 |
|
---|
107 | static int vboxvfs_open(struct vop_open_args *ap)
|
---|
108 | {
|
---|
109 | return 0;
|
---|
110 | }
|
---|
111 |
|
---|
112 | static int vboxvfs_close(struct vop_close_args *ap)
|
---|
113 | {
|
---|
114 | return 0;
|
---|
115 | }
|
---|
116 |
|
---|
117 | static int vboxvfs_getattr(struct vop_getattr_args *ap)
|
---|
118 | {
|
---|
119 | return 0;
|
---|
120 | }
|
---|
121 |
|
---|
122 | static int vboxvfs_setattr(struct vop_setattr_args *ap)
|
---|
123 | {
|
---|
124 | return 0;
|
---|
125 | }
|
---|
126 |
|
---|
127 | static int vboxvfs_read(struct vop_read_args *ap)
|
---|
128 | {
|
---|
129 | return 0;
|
---|
130 | }
|
---|
131 |
|
---|
132 | static int vboxvfs_write(struct vop_write_args *ap)
|
---|
133 | {
|
---|
134 | return 0;
|
---|
135 | }
|
---|
136 |
|
---|
137 | static int vboxvfs_create(struct vop_create_args *ap)
|
---|
138 | {
|
---|
139 | return 0;
|
---|
140 | }
|
---|
141 |
|
---|
142 | static int vboxvfs_remove(struct vop_remove_args *ap)
|
---|
143 | {
|
---|
144 | return 0;
|
---|
145 | }
|
---|
146 |
|
---|
147 | static int vboxvfs_rename(struct vop_rename_args *ap)
|
---|
148 | {
|
---|
149 | return 0;
|
---|
150 | }
|
---|
151 |
|
---|
152 | static int vboxvfs_link(struct vop_link_args *ap)
|
---|
153 | {
|
---|
154 | return EOPNOTSUPP;
|
---|
155 | }
|
---|
156 |
|
---|
157 | static int vboxvfs_symlink(struct vop_symlink_args *ap)
|
---|
158 | {
|
---|
159 | return EOPNOTSUPP;
|
---|
160 | }
|
---|
161 |
|
---|
162 | static int vboxvfs_mknod(struct vop_mknod_args *ap)
|
---|
163 | {
|
---|
164 | return EOPNOTSUPP;
|
---|
165 | }
|
---|
166 |
|
---|
167 | static int vboxvfs_mkdir(struct vop_mkdir_args *ap)
|
---|
168 | {
|
---|
169 | return 0;
|
---|
170 | }
|
---|
171 |
|
---|
172 | static int vboxvfs_rmdir(struct vop_rmdir_args *ap)
|
---|
173 | {
|
---|
174 | return 0;
|
---|
175 | }
|
---|
176 |
|
---|
177 | static int vboxvfs_readdir(struct vop_readdir_args *ap)
|
---|
178 | {
|
---|
179 | return 0;
|
---|
180 | }
|
---|
181 |
|
---|
182 | static int vboxvfs_fsync(struct vop_fsync_args *ap)
|
---|
183 | {
|
---|
184 | return 0;
|
---|
185 | }
|
---|
186 |
|
---|
187 | static int vboxvfs_print (struct vop_print_args *ap)
|
---|
188 | {
|
---|
189 | return 0;
|
---|
190 | }
|
---|
191 |
|
---|
192 | static int vboxvfs_pathconf (struct vop_pathconf_args *ap)
|
---|
193 | {
|
---|
194 | return 0;
|
---|
195 | }
|
---|
196 |
|
---|
197 | static int vboxvfs_strategy (struct vop_strategy_args *ap)
|
---|
198 | {
|
---|
199 | return 0;
|
---|
200 | }
|
---|
201 |
|
---|
202 | static int vboxvfs_ioctl(struct vop_ioctl_args *ap)
|
---|
203 | {
|
---|
204 | return ENOTTY;
|
---|
205 | }
|
---|
206 |
|
---|
207 | static int vboxvfs_getextattr(struct vop_getextattr_args *ap)
|
---|
208 | {
|
---|
209 | return 0;
|
---|
210 | }
|
---|
211 |
|
---|
212 | static int vboxvfs_advlock(struct vop_advlock_args *ap)
|
---|
213 | {
|
---|
214 | return 0;
|
---|
215 | }
|
---|
216 |
|
---|
217 | static int vboxvfs_lookup(struct vop_lookup_args *ap)
|
---|
218 | {
|
---|
219 | return 0;
|
---|
220 | }
|
---|
221 |
|
---|
222 | static int vboxvfs_inactive(struct vop_inactive_args *ap)
|
---|
223 | {
|
---|
224 | return 0;
|
---|
225 | }
|
---|
226 |
|
---|
227 | static int vboxvfs_reclaim(struct vop_reclaim_args *ap)
|
---|
228 | {
|
---|
229 | return 0;
|
---|
230 | }
|
---|
231 |
|
---|
232 | static int vboxvfs_getpages(struct vop_getpages_args *ap)
|
---|
233 | {
|
---|
234 | return 0;
|
---|
235 | }
|
---|
236 |
|
---|
237 | static int vboxvfs_putpages(struct vop_putpages_args *ap)
|
---|
238 | {
|
---|
239 | return 0;
|
---|
240 | }
|
---|
241 |
|
---|