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