AMD64 - Refactor uio_resid and size_t assumptions.
[dragonfly.git] / sys / vfs / hpfs / hpfs_vnops.c
CommitLineData
984263bc
MD
1/*-
2 * Copyright (c) 1998, 1999 Semen Ustimenko (semenu@FreeBSD.org)
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: src/sys/fs/hpfs/hpfs_vnops.c,v 1.2.2.2 2002/01/15 18:35:09 semenu Exp $
e92ca23a 27 * $DragonFly: src/sys/vfs/hpfs/hpfs_vnops.c,v 1.47 2008/06/19 23:27:39 dillon Exp $
984263bc
MD
28 */
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/proc.h>
895c1f85 34#include <sys/priv.h>
984263bc
MD
35#include <sys/time.h>
36#include <sys/types.h>
37#include <sys/stat.h>
38#include <sys/vnode.h>
39#include <sys/mount.h>
40#include <sys/namei.h>
41#include <sys/malloc.h>
42#include <sys/buf.h>
43#include <sys/dirent.h>
44
0c50e491
JS
45#include <machine/limits.h>
46
984263bc
MD
47#include <vm/vm.h>
48#include <vm/vm_param.h>
08c23b99 49#if !defined(__DragonFly__)
984263bc
MD
50#include <vm/vm_prot.h>
51#endif
52#include <vm/vm_page.h>
53#include <vm/vm_object.h>
54#include <vm/vm_pager.h>
55#include <vm/vm_zone.h>
08c23b99 56#if defined(__DragonFly__)
984263bc
MD
57#include <vm/vnode_pager.h>
58#endif
59#include <vm/vm_extern.h>
7d1b9a3b 60#include <sys/buf2.h>
984263bc 61
08c23b99 62#if !defined(__DragonFly__)
984263bc
MD
63#include <miscfs/specfs/specdev.h>
64#include <miscfs/genfs/genfs.h>
65#endif
66
67#include <sys/unistd.h> /* for pathconf(2) constants */
68
1f2de5d4
MD
69#include "hpfs.h"
70#include "hpfsmount.h"
71#include "hpfs_subr.h"
72#include "hpfs_ioctl.h"
984263bc 73
957d9419
SS
74static int hpfs_de_uiomove (int *, struct hpfsmount *,
75 struct hpfsdirent *, struct uio *);
a6ee311a
RG
76static int hpfs_ioctl (struct vop_ioctl_args *ap);
77static int hpfs_read (struct vop_read_args *);
78static int hpfs_write (struct vop_write_args *ap);
79static int hpfs_getattr (struct vop_getattr_args *ap);
80static int hpfs_setattr (struct vop_setattr_args *ap);
81static int hpfs_inactive (struct vop_inactive_args *ap);
82static int hpfs_print (struct vop_print_args *ap);
83static int hpfs_reclaim (struct vop_reclaim_args *ap);
84static int hpfs_strategy (struct vop_strategy_args *ap);
85static int hpfs_access (struct vop_access_args *ap);
a6ee311a 86static int hpfs_readdir (struct vop_readdir_args *ap);
e62afb5f
MD
87static int hpfs_lookup (struct vop_old_lookup_args *ap);
88static int hpfs_create (struct vop_old_create_args *);
89static int hpfs_remove (struct vop_old_remove_args *);
a6ee311a 90static int hpfs_bmap (struct vop_bmap_args *ap);
08c23b99 91#if defined(__DragonFly__)
a6ee311a 92static int hpfs_fsync (struct vop_fsync_args *ap);
984263bc 93#endif
a6ee311a 94static int hpfs_pathconf (struct vop_pathconf_args *ap);
984263bc 95
08c23b99 96#if defined(__DragonFly__)
984263bc 97
dd3af26c 98/*
b478fdce 99 * hpfs_fsync(struct vnode *a_vp, int a_waitfor)
dd3af26c 100 */
984263bc 101static int
dd3af26c 102hpfs_fsync(struct vop_fsync_args *ap)
984263bc
MD
103{
104 struct vnode *vp = ap->a_vp;
984263bc
MD
105
106 /*
107 * Flush all dirty buffers associated with a vnode.
108 */
6bae6177 109#ifdef DIAGNOSTIC
984263bc 110loop:
6bae6177 111#endif
4e0ecc94 112 vfsync(vp, ap->a_waitfor, 0, NULL, NULL);
984263bc 113#ifdef DIAGNOSTIC
6bae6177 114 if (ap->a_waitfor == MNT_WAIT && !RB_EMPTY(&vp->v_rbdirty_tree)) {
984263bc
MD
115 vprint("hpfs_fsync: dirty", vp);
116 goto loop;
117 }
118#endif
984263bc
MD
119
120 /*
121 * Write out the on-disc version of the vnode.
122 */
123 return hpfs_update(VTOHP(vp));
124}
125
126#endif
127
dd3af26c
CP
128/*
129 * hpfs_ioctl(struct vnode *a_vp, u_long a_command, caddr_t a_data,
b478fdce 130 * int a_fflag, struct ucred *a_cred)
dd3af26c 131 */
984263bc 132static int
dd3af26c 133hpfs_ioctl(struct vop_ioctl_args *ap)
984263bc 134{
f7aae92f
RG
135 struct vnode *vp = ap->a_vp;
136 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
137 int error;
138
086c1d7e 139 kprintf("hpfs_ioctl(0x%x, 0x%lx, 0x%p, 0x%x): ",
984263bc
MD
140 hp->h_no, ap->a_command, ap->a_data, ap->a_fflag);
141
142 switch (ap->a_command) {
143 case HPFSIOCGEANUM: {
144 u_long eanum;
145 u_long passed;
146 struct ea *eap;
147
148 eanum = 0;
149
150 if (hp->h_fn.fn_ealen > 0) {
151 eap = (struct ea *)&(hp->h_fn.fn_int);
152 passed = 0;
153
154 while (passed < hp->h_fn.fn_ealen) {
155
086c1d7e 156 kprintf("EAname: %s\n", EA_NAME(eap));
984263bc
MD
157
158 eanum++;
159 passed += sizeof(struct ea) +
160 eap->ea_namelen + 1 + eap->ea_vallen;
161 eap = (struct ea *)((caddr_t)hp->h_fn.fn_int +
162 passed);
163 }
164 error = 0;
165 } else {
166 error = ENOENT;
167 }
168
086c1d7e 169 kprintf("%lu eas\n", eanum);
984263bc
MD
170
171 *(u_long *)ap->a_data = eanum;
172
173 break;
174 }
175 case HPFSIOCGEASZ: {
176 u_long eanum;
177 u_long passed;
178 struct ea *eap;
179
086c1d7e 180 kprintf("EA%ld\n", *(u_long *)ap->a_data);
984263bc
MD
181
182 eanum = 0;
183 if (hp->h_fn.fn_ealen > 0) {
184 eap = (struct ea *)&(hp->h_fn.fn_int);
185 passed = 0;
186
187 error = ENOENT;
188 while (passed < hp->h_fn.fn_ealen) {
086c1d7e 189 kprintf("EAname: %s\n", EA_NAME(eap));
984263bc
MD
190
191 if (eanum == *(u_long *)ap->a_data) {
192 *(u_long *)ap->a_data =
193 eap->ea_namelen + 1 +
194 eap->ea_vallen;
195
196 error = 0;
197 break;
198 }
199
200 eanum++;
201 passed += sizeof(struct ea) +
202 eap->ea_namelen + 1 + eap->ea_vallen;
203 eap = (struct ea *)((caddr_t)hp->h_fn.fn_int +
204 passed);
205 }
206 } else {
207 error = ENOENT;
208 }
209
210 break;
211 }
212 case HPFSIOCRDEA: {
213 u_long eanum;
214 u_long passed;
215 struct hpfs_rdea *rdeap;
216 struct ea *eap;
217
218 rdeap = (struct hpfs_rdea *)ap->a_data;
086c1d7e 219 kprintf("EA%ld\n", rdeap->ea_no);
984263bc
MD
220
221 eanum = 0;
222 if (hp->h_fn.fn_ealen > 0) {
223 eap = (struct ea *)&(hp->h_fn.fn_int);
224 passed = 0;
225
226 error = ENOENT;
227 while (passed < hp->h_fn.fn_ealen) {
086c1d7e 228 kprintf("EAname: %s\n", EA_NAME(eap));
984263bc
MD
229
230 if (eanum == rdeap->ea_no) {
231 rdeap->ea_sz = eap->ea_namelen + 1 +
232 eap->ea_vallen;
233 copyout(EA_NAME(eap),rdeap->ea_data,
234 rdeap->ea_sz);
235 error = 0;
236 break;
237 }
238
239 eanum++;
240 passed += sizeof(struct ea) +
241 eap->ea_namelen + 1 + eap->ea_vallen;
242 eap = (struct ea *)((caddr_t)hp->h_fn.fn_int +
243 passed);
244 }
245 } else {
246 error = ENOENT;
247 }
248
249 break;
250 }
251 default:
252 error = EOPNOTSUPP;
253 break;
254 }
255 return (error);
256}
257
258/*
259 * Map file offset to disk offset.
dd3af26c 260 *
08daea96 261 * hpfs_bmap(struct vnode *a_vp, off_t a_loffset,
54078292 262 * off_t *a_doffsetp, int *a_runp, int *a_runb)
984263bc
MD
263 */
264int
dd3af26c 265hpfs_bmap(struct vop_bmap_args *ap)
984263bc 266{
f7aae92f 267 struct hpfsnode *hp = VTOHP(ap->a_vp);
984263bc 268 int error;
54078292
MD
269 daddr_t lbn;
270 daddr_t dbn;
984263bc 271
984263bc
MD
272 if (ap->a_runb != NULL)
273 *ap->a_runb = 0;
54078292 274 if (ap->a_doffsetp == NULL)
984263bc
MD
275 return (0);
276
277 dprintf(("hpfs_bmap(0x%x, 0x%x): ",hp->h_no, ap->a_bn));
278
54078292
MD
279 lbn = ap->a_loffset >> DEV_BSHIFT;
280 KKASSERT(((int)ap->a_loffset & DEV_BMASK) == 0);
984263bc 281
54078292
MD
282 error = hpfs_hpbmap (hp, lbn, &dbn, ap->a_runp);
283 if (error || dbn == (daddr_t)-1) {
284 *ap->a_doffsetp = NOOFFSET;
285 } else {
286 *ap->a_doffsetp = (off_t)dbn << DEV_BSHIFT;
287 }
984263bc
MD
288 return (error);
289}
290
dd3af26c
CP
291/*
292 * hpfs_read(struct vnode *a_vp, struct uio *a_uio, int a_ioflag,
293 * struct ucred *a_cred)
294 */
984263bc 295static int
dd3af26c 296hpfs_read(struct vop_read_args *ap)
984263bc 297{
f7aae92f
RG
298 struct vnode *vp = ap->a_vp;
299 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
300 struct uio *uio = ap->a_uio;
301 struct buf *bp;
302 u_int xfersz, toread;
303 u_int off;
304 daddr_t lbn, bn;
305 int resid;
306 int runl;
307 int error = 0;
308
e54488bb 309 resid = (int)szmin(uio->uio_resid, hp->h_fn.fn_size - uio->uio_offset);
984263bc 310
e54488bb
MD
311 dprintf(("hpfs_read(0x%x, off: %d resid: %d, segflg: %d): "
312 "[resid: 0x%lx]\n",
313 hp->h_no, (u_int32_t)uio->uio_offset,
314 uio->uio_resid, uio->uio_segflg, resid));
984263bc
MD
315
316 while (resid) {
317 lbn = uio->uio_offset >> DEV_BSHIFT;
318 off = uio->uio_offset & (DEV_BSIZE - 1);
e54488bb 319 dprintf(("hpfs_read: resid: 0x%lx lbn: 0x%x off: 0x%x\n",
984263bc
MD
320 uio->uio_resid, lbn, off));
321 error = hpfs_hpbmap(hp, lbn, &bn, &runl);
322 if (error)
323 return (error);
324
325 toread = min(off + resid, min(DFLTPHYS, (runl+1)*DEV_BSIZE));
326 xfersz = (toread + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
327 dprintf(("hpfs_read: bn: 0x%x (0x%x) toread: 0x%x (0x%x)\n",
328 bn, runl, toread, xfersz));
329
330 if (toread == 0)
331 break;
332
54078292 333 error = bread(hp->h_devvp, dbtodoff(bn), xfersz, &bp);
984263bc
MD
334 if (error) {
335 brelse(bp);
336 break;
337 }
338
e54488bb 339 error = uiomove(bp->b_data + off, (size_t)(toread - off), uio);
984263bc
MD
340 if(error) {
341 brelse(bp);
342 break;
343 }
344 brelse(bp);
345 resid -= toread;
346 }
347 dprintf(("hpfs_read: successful\n"));
348 return (error);
349}
350
dd3af26c
CP
351/*
352 * hpfs_write(struct vnode *a_vp, struct uio *a_uio, int a_ioflag,
353 * struct ucred *a_cred)
354 */
984263bc 355static int
dd3af26c 356hpfs_write(struct vop_write_args *ap)
984263bc 357{
f7aae92f
RG
358 struct vnode *vp = ap->a_vp;
359 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
360 struct uio *uio = ap->a_uio;
361 struct buf *bp;
362 u_int xfersz, towrite;
363 u_int off;
364 daddr_t lbn, bn;
365 int runl;
366 int error = 0;
367
e54488bb
MD
368 dprintf(("hpfs_write(0x%x, off: %d resid: %ld, segflg: %d):\n",
369 hp->h_no, (u_int32_t)uio->uio_offset,
370 uio->uio_resid, uio->uio_segflg));
984263bc
MD
371
372 if (ap->a_ioflag & IO_APPEND) {
373 dprintf(("hpfs_write: APPEND mode\n"));
374 uio->uio_offset = hp->h_fn.fn_size;
375 }
376 if (uio->uio_offset + uio->uio_resid > hp->h_fn.fn_size) {
377 error = hpfs_extend (hp, uio->uio_offset + uio->uio_resid);
378 if (error) {
086c1d7e 379 kprintf("hpfs_write: hpfs_extend FAILED %d\n", error);
984263bc
MD
380 return (error);
381 }
382 }
383
384 while (uio->uio_resid) {
385 lbn = uio->uio_offset >> DEV_BSHIFT;
386 off = uio->uio_offset & (DEV_BSIZE - 1);
e54488bb 387 dprintf(("hpfs_write: resid: 0x%lx lbn: 0x%x off: 0x%x\n",
984263bc
MD
388 uio->uio_resid, lbn, off));
389 error = hpfs_hpbmap(hp, lbn, &bn, &runl);
390 if (error)
391 return (error);
392
e54488bb
MD
393 towrite = szmin(off + uio->uio_resid,
394 min(DFLTPHYS, (runl+1)*DEV_BSIZE));
984263bc
MD
395 xfersz = (towrite + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);
396 dprintf(("hpfs_write: bn: 0x%x (0x%x) towrite: 0x%x (0x%x)\n",
397 bn, runl, towrite, xfersz));
398
8aa7625b
MD
399 /*
400 * We do not have to issue a read-before-write if the xfer
401 * size does not cover the whole block.
402 *
403 * In the UIO_NOCOPY case, however, we are not overwriting
404 * anything and must do a read-before-write to fill in
405 * any missing pieces.
406 */
407 if (off == 0 && towrite == xfersz &&
408 uio->uio_segflg != UIO_NOCOPY) {
54078292 409 bp = getblk(hp->h_devvp, dbtodoff(bn), xfersz, 0, 0);
984263bc
MD
410 clrbuf(bp);
411 } else {
54078292 412 error = bread(hp->h_devvp, dbtodoff(bn), xfersz, &bp);
984263bc
MD
413 if (error) {
414 brelse(bp);
415 return (error);
416 }
417 }
418
e54488bb 419 error = uiomove(bp->b_data + off, (size_t)(towrite - off), uio);
984263bc
MD
420 if(error) {
421 brelse(bp);
422 return (error);
423 }
424
425 if (ap->a_ioflag & IO_SYNC)
426 bwrite(bp);
427 else
428 bawrite(bp);
429 }
430
431 dprintf(("hpfs_write: successful\n"));
432 return (0);
433}
434
435/*
436 * XXXXX do we need hpfsnode locking inside?
dd3af26c 437 *
b478fdce 438 * hpfs_getattr(struct vnode *a_vp, struct vattr *a_vap)
984263bc
MD
439 */
440static int
dd3af26c 441hpfs_getattr(struct vop_getattr_args *ap)
984263bc 442{
f7aae92f
RG
443 struct vnode *vp = ap->a_vp;
444 struct hpfsnode *hp = VTOHP(vp);
445 struct vattr *vap = ap->a_vap;
984263bc
MD
446 int error;
447
448 dprintf(("hpfs_getattr(0x%x):\n", hp->h_no));
449
08c23b99 450#if defined(__DragonFly__)
984263bc
MD
451 vap->va_fsid = dev2udev(hp->h_dev);
452#else /* defined(__NetBSD__) */
453 vap->va_fsid = ip->i_dev;
454#endif
455 vap->va_fileid = hp->h_no;
456 vap->va_mode = hp->h_mode;
457 vap->va_nlink = 1;
458 vap->va_uid = hp->h_uid;
459 vap->va_gid = hp->h_gid;
0e9b9130
MD
460 vap->va_rmajor = VNOVAL;
461 vap->va_rminor = VNOVAL;
984263bc
MD
462 vap->va_size = hp->h_fn.fn_size;
463 vap->va_bytes = ((hp->h_fn.fn_size + DEV_BSIZE-1) & ~(DEV_BSIZE-1)) +
464 DEV_BSIZE;
465
466 if (!(hp->h_flag & H_PARVALID)) {
467 error = hpfs_validateparent(hp);
468 if (error)
469 return (error);
470 }
471 vap->va_atime = hpfstimetounix(hp->h_atime);
472 vap->va_mtime = hpfstimetounix(hp->h_mtime);
473 vap->va_ctime = hpfstimetounix(hp->h_ctime);
474
475 vap->va_flags = 0;
476 vap->va_gen = 0;
477 vap->va_blocksize = DEV_BSIZE;
478 vap->va_type = vp->v_type;
479 vap->va_filerev = 0;
480
481 return (0);
482}
483
484/*
485 * XXXXX do we need hpfsnode locking inside?
dd3af26c 486 *
b478fdce 487 * hpfs_setattr(struct vnode *a_vp, struct vattr *a_vap, struct ucred *a_cred)
984263bc
MD
488 */
489static int
dd3af26c 490hpfs_setattr(struct vop_setattr_args *ap)
984263bc
MD
491{
492 struct vnode *vp = ap->a_vp;
493 struct hpfsnode *hp = VTOHP(vp);
494 struct vattr *vap = ap->a_vap;
495 struct ucred *cred = ap->a_cred;
984263bc
MD
496 int error;
497
498 dprintf(("hpfs_setattr(0x%x):\n", hp->h_no));
499
500 /*
501 * Check for unsettable attributes.
502 */
503 if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) ||
504 (vap->va_fsid != VNOVAL) || (vap->va_fileid != VNOVAL) ||
0e9b9130 505 (vap->va_blocksize != VNOVAL) || (vap->va_rmajor != VNOVAL) ||
984263bc
MD
506 (vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL)) {
507 dprintf(("hpfs_setattr: changing nonsettable attr\n"));
508 return (EINVAL);
509 }
510
511 /* Can't change flags XXX Could be implemented */
512 if (vap->va_flags != VNOVAL) {
086c1d7e 513 kprintf("hpfs_setattr: FLAGS CANNOT BE SET\n");
984263bc
MD
514 return (EINVAL);
515 }
516
517 /* Can't change uid/gid XXX Could be implemented */
518 if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL) {
086c1d7e 519 kprintf("hpfs_setattr: UID/GID CANNOT BE SET\n");
984263bc
MD
520 return (EINVAL);
521 }
522
523 /* Can't change mode XXX Could be implemented */
524 if (vap->va_mode != (mode_t)VNOVAL) {
086c1d7e 525 kprintf("hpfs_setattr: MODE CANNOT BE SET\n");
984263bc
MD
526 return (EINVAL);
527 }
528
529 /* Update times */
530 if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
531 if (vp->v_mount->mnt_flag & MNT_RDONLY)
532 return (EROFS);
533 if (cred->cr_uid != hp->h_uid &&
db813a0c 534 (error = priv_check_cred(cred, PRIV_VFS_SETATTR, 0)) &&
984263bc 535 ((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
87de5057 536 (error = VOP_ACCESS(vp, VWRITE, cred))))
984263bc
MD
537 return (error);
538 if (vap->va_atime.tv_sec != VNOVAL)
539 hp->h_atime = vap->va_atime.tv_sec;
540 if (vap->va_mtime.tv_sec != VNOVAL)
541 hp->h_mtime = vap->va_mtime.tv_sec;
542
543 hp->h_flag |= H_PARCHANGE;
544 }
545
546 if (vap->va_size != VNOVAL) {
547 switch (vp->v_type) {
548 case VDIR:
549 return (EISDIR);
550 case VREG:
551 if (vp->v_mount->mnt_flag & MNT_RDONLY)
552 return (EROFS);
553 break;
554 default:
086c1d7e 555 kprintf("hpfs_setattr: WRONG v_type\n");
984263bc
MD
556 return (EINVAL);
557 }
558
559 if (vap->va_size < hp->h_fn.fn_size) {
08c23b99 560#if defined(__DragonFly__)
87de5057 561 error = vtruncbuf(vp, vap->va_size, DEV_BSIZE);
984263bc
MD
562 if (error)
563 return (error);
564#else /* defined(__NetBSD__) */
565#error Need alternation for vtruncbuf()
566#endif
567 error = hpfs_truncate(hp, vap->va_size);
568 if (error)
569 return (error);
570
571 } else if (vap->va_size > hp->h_fn.fn_size) {
08c23b99 572#if defined(__DragonFly__)
984263bc
MD
573 vnode_pager_setsize(vp, vap->va_size);
574#endif
575 error = hpfs_extend(hp, vap->va_size);
576 if (error)
577 return (error);
578 }
579 }
580
581 return (0);
582}
583
584/*
585 * Last reference to an node. If necessary, write or delete it.
dd3af26c
CP
586 *
587 * hpfs_inactive(struct vnode *a_vp)
984263bc
MD
588 */
589int
dd3af26c 590hpfs_inactive(struct vop_inactive_args *ap)
984263bc 591{
f7aae92f
RG
592 struct vnode *vp = ap->a_vp;
593 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
594 int error;
595
596 dprintf(("hpfs_inactive(0x%x): \n", hp->h_no));
597
598 if (hp->h_flag & H_CHANGE) {
599 dprintf(("hpfs_inactive: node changed, update\n"));
600 error = hpfs_update (hp);
601 if (error)
602 return (error);
603 }
604
605 if (hp->h_flag & H_PARCHANGE) {
606 dprintf(("hpfs_inactive: parent node changed, update\n"));
607 error = hpfs_updateparent (hp);
608 if (error)
609 return (error);
610 }
611
3c37c940 612 if (prtactive && vp->v_sysref.refcnt > 1)
984263bc
MD
613 vprint("hpfs_inactive: pushing active", vp);
614
615 if (hp->h_flag & H_INVAL) {
08c23b99 616#if defined(__DragonFly__)
87de5057 617 vrecycle(vp);
984263bc
MD
618#else /* defined(__NetBSD__) */
619 vgone(vp);
620#endif
621 return (0);
622 }
984263bc
MD
623 return (0);
624}
625
626/*
627 * Reclaim an inode so that it can be used for other purposes.
dd3af26c
CP
628 *
629 * hpfs_reclaim(struct vnode *a_vp)
984263bc
MD
630 */
631int
dd3af26c 632hpfs_reclaim(struct vop_reclaim_args *ap)
984263bc 633{
f7aae92f
RG
634 struct vnode *vp = ap->a_vp;
635 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
636
637 dprintf(("hpfs_reclaim(0x%x0): \n", hp->h_no));
638
639 hpfs_hphashrem(hp);
640
641 /* Purge old data structures associated with the inode. */
984263bc
MD
642 if (hp->h_devvp) {
643 vrele(hp->h_devvp);
644 hp->h_devvp = NULL;
645 }
646
647 vp->v_data = NULL;
648
649 FREE(hp, M_HPFSNO);
650
651 return (0);
652}
653
dd3af26c
CP
654/*
655 * hpfs_print(struct vnode *a_vp)
656 */
984263bc 657static int
dd3af26c 658hpfs_print(struct vop_print_args *ap)
984263bc 659{
f7aae92f
RG
660 struct vnode *vp = ap->a_vp;
661 struct hpfsnode *hp = VTOHP(vp);
984263bc 662
086c1d7e 663 kprintf("tag VT_HPFS, ino 0x%x",hp->h_no);
3446c007 664 lockmgr_printinfo(&vp->v_lock);
086c1d7e 665 kprintf("\n");
984263bc
MD
666 return (0);
667}
668
669/*
670 * Calculate the logical to physical mapping if not done already,
671 * then call the device strategy routine.
672 *
673 * In order to be able to swap to a file, the VOP_BMAP operation may not
674 * deadlock on memory. See hpfs_bmap() for details. XXXXXXX (not impl)
dd3af26c 675 *
81b5c339 676 * hpfs_strategy(struct vnode *a_vp, struct bio *a_bio)
984263bc
MD
677 */
678int
dd3af26c 679hpfs_strategy(struct vop_strategy_args *ap)
984263bc 680{
81b5c339
MD
681 struct bio *bio = ap->a_bio;
682 struct bio *nbio;
683 struct buf *bp = bio->bio_buf;
f7aae92f 684 struct vnode *vp = ap->a_vp;
81b5c339 685 struct hpfsnode *hp;
984263bc
MD
686 int error;
687
688 dprintf(("hpfs_strategy(): \n"));
689
690 if (vp->v_type == VBLK || vp->v_type == VCHR)
691 panic("hpfs_strategy: spec");
81b5c339
MD
692
693 nbio = push_bio(bio);
54078292 694 if (nbio->bio_offset == NOOFFSET) {
08daea96 695 error = VOP_BMAP(vp, bio->bio_offset, &nbio->bio_offset,
e92ca23a 696 NULL, NULL, bp->b_cmd);
984263bc 697 if (error) {
086c1d7e 698 kprintf("hpfs_strategy: VOP_BMAP FAILED %d\n", error);
984263bc
MD
699 bp->b_error = error;
700 bp->b_flags |= B_ERROR;
81b5c339
MD
701 /* I/O was never started on nbio, must biodone(bio) */
702 biodone(bio);
984263bc
MD
703 return (error);
704 }
54078292 705 if (nbio->bio_offset == NOOFFSET)
984263bc
MD
706 vfs_bio_clrbuf(bp);
707 }
54078292 708 if (nbio->bio_offset == NOOFFSET) {
81b5c339
MD
709 /* I/O was never started on nbio, must biodone(bio) */
710 biodone(bio);
984263bc
MD
711 return (0);
712 }
81b5c339
MD
713 hp = VTOHP(ap->a_vp);
714 vn_strategy(hp->h_devvp, nbio);
984263bc
MD
715 return (0);
716}
717
718/*
719 * XXXXX do we need hpfsnode locking inside?
dd3af26c 720 *
b478fdce 721 * hpfs_access(struct vnode *a_vp, int a_mode, struct ucred *a_cred)
984263bc
MD
722 */
723int
dd3af26c 724hpfs_access(struct vop_access_args *ap)
984263bc
MD
725{
726 struct vnode *vp = ap->a_vp;
727 struct hpfsnode *hp = VTOHP(vp);
728 struct ucred *cred = ap->a_cred;
729 mode_t mask, mode = ap->a_mode;
f7aae92f 730 gid_t *gp;
984263bc
MD
731 int i;
732
733 dprintf(("hpfs_access(0x%x):\n", hp->h_no));
734
735 /*
736 * Disallow write attempts on read-only file systems;
737 * unless the file is a socket, fifo, or a block or
738 * character device resident on the file system.
739 */
740 if (mode & VWRITE) {
741 switch ((int)vp->v_type) {
742 case VDIR:
743 case VLNK:
744 case VREG:
745 if (vp->v_mount->mnt_flag & MNT_RDONLY)
746 return (EROFS);
747 break;
748 }
749 }
750
751 /* Otherwise, user id 0 always gets access. */
752 if (cred->cr_uid == 0)
753 return (0);
754
755 mask = 0;
756
757 /* Otherwise, check the owner. */
758 if (cred->cr_uid == hp->h_uid) {
759 if (mode & VEXEC)
760 mask |= S_IXUSR;
761 if (mode & VREAD)
762 mask |= S_IRUSR;
763 if (mode & VWRITE)
764 mask |= S_IWUSR;
765 return ((hp->h_mode & mask) == mask ? 0 : EACCES);
766 }
767
768 /* Otherwise, check the groups. */
769 for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++)
770 if (hp->h_gid == *gp) {
771 if (mode & VEXEC)
772 mask |= S_IXGRP;
773 if (mode & VREAD)
774 mask |= S_IRGRP;
775 if (mode & VWRITE)
776 mask |= S_IWGRP;
777 return ((hp->h_mode & mask) == mask ? 0 : EACCES);
778 }
779
780 /* Otherwise, check everyone else. */
781 if (mode & VEXEC)
782 mask |= S_IXOTH;
783 if (mode & VREAD)
784 mask |= S_IROTH;
785 if (mode & VWRITE)
786 mask |= S_IWOTH;
787 return ((hp->h_mode & mask) == mask ? 0 : EACCES);
788}
789
984263bc 790static int
957d9419 791hpfs_de_uiomove(int *error, struct hpfsmount *hpmp, struct hpfsdirent *dep,
dd3af26c 792 struct uio *uio)
984263bc 793{
0c50e491 794 char convname[HPFS_MAXFILENAME + 1];
957d9419 795 int i, success;
984263bc
MD
796
797 dprintf(("[no: 0x%x, size: %d, name: %2d:%.*s, flag: 0x%x] ",
798 dep->de_fnode, dep->de_size, dep->de_namelen,
799 dep->de_namelen, dep->de_name, dep->de_flag));
800
801 /*strncpy(cde.d_name, dep->de_name, dep->de_namelen);*/
802 for (i=0; i<dep->de_namelen; i++)
957d9419
SS
803 convname[i] = hpfs_d2u(hpmp, dep->de_name[i]);
804 convname[dep->de_namelen] = '\0';
984263bc 805
957d9419
SS
806 success = vop_write_dirent(error, uio, dep->de_fnode,
807 (dep->de_flag & DE_DIR) ? DT_DIR : DT_REG,
808 dep->de_namelen, convname);
984263bc 809
e54488bb 810 dprintf(("[0x%lx] ", uio->uio_resid));
957d9419 811 return (success);
984263bc
MD
812}
813
814
dd3af26c
CP
815/*
816 * hpfs_readdir(struct vnode *a_vp, struct uio *a_uio, struct ucred *a_cred,
84009d92 817 * int *a_ncookies, off_t **cookies)
dd3af26c 818 */
984263bc 819int
dd3af26c 820hpfs_readdir(struct vop_readdir_args *ap)
984263bc 821{
f7aae92f
RG
822 struct vnode *vp = ap->a_vp;
823 struct hpfsnode *hp = VTOHP(vp);
984263bc
MD
824 struct hpfsmount *hpmp = hp->h_hpmp;
825 struct uio *uio = ap->a_uio;
826 int ncookies = 0, i, num, cnum;
827 int error = 0;
984263bc
MD
828 struct buf *bp;
829 struct dirblk *dp;
830 struct hpfsdirent *dep;
831 lsn_t olsn;
832 lsn_t lsn;
833 int level;
834
e54488bb
MD
835 dprintf(("hpfs_readdir(0x%x, 0x%x, 0x%lx): ",
836 hp->h_no, (u_int32_t)uio->uio_offset, uio->uio_resid));
984263bc 837
957d9419 838 /*
ad079f69
SS
839 * As we need to fake up . and .., and the remaining directory structure
840 * can't be expressed in one off_t as well, we just increment uio_offset
841 * by 1 for each entry.
842 *
957d9419
SS
843 * num is the entry we need to start reporting
844 * cnum is the current entry
845 */
0c50e491
JS
846 if (uio->uio_offset < 0 || uio->uio_offset > INT_MAX)
847 return(EINVAL);
885ecb13
MD
848 if ((error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY)) != 0)
849 return (error);
850
957d9419
SS
851 num = uio->uio_offset;
852 cnum = 0;
853
957d9419 854 if( num <= cnum ) {
984263bc 855 dprintf((". faked, "));
957d9419 856 if (vop_write_dirent(&error, uio, hp->h_no, DT_DIR, 1, "."))
885ecb13
MD
857 goto done;
858 if (error)
859 goto done;
984263bc
MD
860 ncookies ++;
861 }
957d9419 862 cnum++;
984263bc 863
957d9419 864 if( num <= cnum ) {
984263bc 865 dprintf((".. faked, "));
957d9419
SS
866 if (vop_write_dirent(&error, uio, hp->h_fn.fn_parent, DT_DIR, 2, ".."))
867 goto readdone;
885ecb13
MD
868 if (error)
869 goto done;
984263bc
MD
870 ncookies ++;
871 }
957d9419 872 cnum++;
984263bc
MD
873
874 lsn = ((alleaf_t *)hp->h_fn.fn_abd)->al_lsn;
875
876 olsn = 0;
877 level = 1;
878
879dive:
880 dprintf(("[dive 0x%x] ", lsn));
54078292 881 error = bread(hp->h_devvp, dbtodoff(lsn), D_BSIZE, &bp);
984263bc
MD
882 if (error) {
883 brelse(bp);
885ecb13 884 goto done;
984263bc
MD
885 }
886
887 dp = (struct dirblk *) bp->b_data;
888 if (dp->d_magic != D_MAGIC) {
086c1d7e 889 kprintf("hpfs_readdir: MAGIC DOESN'T MATCH\n");
984263bc 890 brelse(bp);
885ecb13
MD
891 error = EINVAL;
892 goto done;
984263bc
MD
893 }
894
895 dep = D_DIRENT(dp);
896
897 if (olsn) {
898 dprintf(("[restore 0x%x] ", olsn));
899
900 while(!(dep->de_flag & DE_END) ) {
901 if((dep->de_flag & DE_DOWN) &&
902 (olsn == DE_DOWNLSN(dep)))
903 break;
904 dep = (hpfsdirent_t *)((caddr_t)dep + dep->de_reclen);
905 }
906
907 if((dep->de_flag & DE_DOWN) && (olsn == DE_DOWNLSN(dep))) {
908 if (dep->de_flag & DE_END)
909 goto blockdone;
910
911 if (!(dep->de_flag & DE_SPECIAL)) {
912 if (num <= cnum) {
957d9419 913 if (hpfs_de_uiomove(&error, hpmp, dep, uio)) {
984263bc
MD
914 brelse(bp);
915 dprintf(("[resid] "));
916 goto readdone;
917 }
984263bc
MD
918 if (error) {
919 brelse (bp);
885ecb13 920 goto done;
984263bc
MD
921 }
922 ncookies++;
984263bc
MD
923 }
924 cnum++;
925 }
926
927 dep = (hpfsdirent_t *)((caddr_t)dep + dep->de_reclen);
928 } else {
086c1d7e 929 kprintf("hpfs_readdir: ERROR! oLSN not found\n");
984263bc 930 brelse(bp);
885ecb13
MD
931 error = EINVAL;
932 goto done;
984263bc
MD
933 }
934 }
935
936 olsn = 0;
937
938 while(!(dep->de_flag & DE_END)) {
939 if(dep->de_flag & DE_DOWN) {
940 lsn = DE_DOWNLSN(dep);
941 brelse(bp);
942 level++;
943 goto dive;
944 }
945
946 if (!(dep->de_flag & DE_SPECIAL)) {
947 if (num <= cnum) {
957d9419 948 if (hpfs_de_uiomove(&error, hpmp, dep, uio)) {
984263bc
MD
949 brelse(bp);
950 dprintf(("[resid] "));
951 goto readdone;
952 }
984263bc
MD
953 if (error) {
954 brelse (bp);
885ecb13 955 goto done;
984263bc
MD
956 }
957 ncookies++;
984263bc
MD
958 }
959 cnum++;
960 }
961
962 dep = (hpfsdirent_t *)((caddr_t)dep + dep->de_reclen);
963 }
964
965 if(dep->de_flag & DE_DOWN) {
966 dprintf(("[enddive] "));
967 lsn = DE_DOWNLSN(dep);
968 brelse(bp);
969 level++;
970 goto dive;
971 }
972
973blockdone:
974 dprintf(("[EOB] "));
975 olsn = lsn;
976 lsn = dp->d_parent;
977 brelse(bp);
978 level--;
979
980 dprintf(("[level %d] ", level));
981
982 if (level > 0)
983 goto dive; /* undive really */
984
985 if (ap->a_eofflag) {
986 dprintf(("[EOF] "));
987 *ap->a_eofflag = 1;
988 }
989
990readdone:
957d9419 991 uio->uio_offset = cnum;
984263bc
MD
992 dprintf(("[readdone]\n"));
993 if (!error && ap->a_ncookies != NULL) {
984263bc
MD
994 off_t *cookies;
995 off_t *cookiep;
984263bc
MD
996
997 dprintf(("%d cookies, ",ncookies));
998 if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
999 panic("hpfs_readdir: unexpected uio from NFS server");
984263bc
MD
1000 MALLOC(cookies, off_t *, ncookies * sizeof(off_t),
1001 M_TEMP, M_WAITOK);
957d9419 1002 for (cookiep = cookies, i=0; i < ncookies; i++)
84009d92 1003 *cookiep++ = ++num;
957d9419 1004
984263bc
MD
1005 *ap->a_ncookies = ncookies;
1006 *ap->a_cookies = cookies;
1007 }
1008
885ecb13
MD
1009done:
1010 vn_unlock(ap->a_vp);
1011 return (error);
984263bc
MD
1012}
1013
dd3af26c
CP
1014/*
1015 * hpfs_lookup(struct vnode *a_dvp, struct vnode **a_vpp,
1016 * struct componentname *a_cnp)
1017 */
984263bc 1018int
e62afb5f 1019hpfs_lookup(struct vop_old_lookup_args *ap)
984263bc 1020{
f7aae92f
RG
1021 struct vnode *dvp = ap->a_dvp;
1022 struct hpfsnode *dhp = VTOHP(dvp);
984263bc
MD
1023 struct hpfsmount *hpmp = dhp->h_hpmp;
1024 struct componentname *cnp = ap->a_cnp;
1025 struct ucred *cred = cnp->cn_cred;
1026 int error;
1027 int nameiop = cnp->cn_nameiop;
1028 int flags = cnp->cn_flags;
2b69e610 1029 int lockparent = flags & CNP_LOCKPARENT;
984263bc 1030#if HPFS_DEBUG
2b69e610 1031 int wantparent = flags & (CNP_LOCKPARENT | CNP_WANTPARENT);
984263bc
MD
1032#endif
1033 dprintf(("hpfs_lookup(0x%x, %s, %ld, %d, %d): \n",
1034 dhp->h_no, cnp->cn_nameptr, cnp->cn_namelen,
1035 lockparent, wantparent));
1036
2b69e610 1037 if (nameiop != NAMEI_CREATE && nameiop != NAMEI_DELETE && nameiop != NAMEI_LOOKUP) {
086c1d7e 1038 kprintf("hpfs_lookup: LOOKUP, DELETE and CREATE are only supported\n");
984263bc
MD
1039 return (EOPNOTSUPP);
1040 }
1041
87de5057 1042 error = VOP_ACCESS(dvp, VEXEC, cred);
984263bc
MD
1043 if(error)
1044 return (error);
1045
1046 if( (cnp->cn_namelen == 1) &&
1047 !strncmp(cnp->cn_nameptr,".",1) ) {
1048 dprintf(("hpfs_lookup(0x%x,...): . faked\n",dhp->h_no));
1049
597aea93 1050 vref(dvp);
984263bc
MD
1051 *ap->a_vpp = dvp;
1052
1053 return (0);
1054 } else if( (cnp->cn_namelen == 2) &&
2b69e610 1055 !strncmp(cnp->cn_nameptr,"..",2) && (flags & CNP_ISDOTDOT) ) {
984263bc
MD
1056 dprintf(("hpfs_lookup(0x%x,...): .. faked (0x%x)\n",
1057 dhp->h_no, dhp->h_fn.fn_parent));
1058
acde96db 1059 VOP__UNLOCK(dvp, 0);
984263bc 1060
b9b0a6d0 1061 error = VFS_VGET(hpmp->hpm_mp, NULL,
984263bc 1062 dhp->h_fn.fn_parent, ap->a_vpp);
fad57d0e 1063 if (error) {
acde96db 1064 VOP__LOCK(dvp, 0);
984263bc
MD
1065 return(error);
1066 }
1067
acde96db 1068 if (lockparent && (error = VOP__LOCK(dvp, 0))) {
984263bc
MD
1069 vput( *(ap->a_vpp) );
1070 return (error);
1071 }
1072 return (error);
1073 } else {
1074 struct buf *bp;
1075 struct hpfsdirent *dep;
1076 struct hpfsnode *hp;
1077
1078 error = hpfs_genlookupbyname(dhp,
1079 cnp->cn_nameptr, cnp->cn_namelen, &bp, &dep);
1080 if (error) {
fad57d0e 1081 if (error == ENOENT &&
2b69e610 1082 (nameiop == NAMEI_CREATE || nameiop == NAMEI_RENAME)) {
984263bc 1083 if(!lockparent)
acde96db 1084 VOP__UNLOCK(dvp, 0);
984263bc
MD
1085 return (EJUSTRETURN);
1086 }
1087
1088 return (error);
1089 }
1090
1091 dprintf(("hpfs_lookup: fnode: 0x%x, CPID: 0x%x\n",
1092 dep->de_fnode, dep->de_cpid));
1093
fad57d0e 1094 if (nameiop == NAMEI_DELETE) {
87de5057 1095 error = VOP_ACCESS(dvp, VWRITE, cred);
984263bc
MD
1096 if (error) {
1097 brelse(bp);
1098 return (error);
1099 }
1100 }
1101
1102 if (dhp->h_no == dep->de_fnode) {
1103 brelse(bp);
597aea93 1104 vref(dvp);
984263bc
MD
1105 *ap->a_vpp = dvp;
1106 return (0);
1107 }
1108
b9b0a6d0 1109 error = VFS_VGET(hpmp->hpm_mp, NULL, dep->de_fnode, ap->a_vpp);
984263bc 1110 if (error) {
086c1d7e 1111 kprintf("hpfs_lookup: VFS_VGET FAILED %d\n", error);
984263bc
MD
1112 brelse(bp);
1113 return(error);
1114 }
1115
1116 hp = VTOHP(*ap->a_vpp);
1117
1118 hp->h_mtime = dep->de_mtime;
1119 hp->h_ctime = dep->de_ctime;
1120 hp->h_atime = dep->de_atime;
1121 bcopy(dep->de_name, hp->h_name, dep->de_namelen);
1122 hp->h_name[dep->de_namelen] = '\0';
1123 hp->h_namelen = dep->de_namelen;
1124 hp->h_flag |= H_PARVALID;
1125
1126 brelse(bp);
1127
fad57d0e 1128 if(!lockparent)
acde96db 1129 VOP__UNLOCK(dvp, 0);
984263bc
MD
1130 }
1131 return (error);
1132}
1133
dd3af26c
CP
1134/*
1135 * hpfs_remove(struct vnode *a_dvp, struct vnode *a_vp,
1136 * struct componentname *a_cnp)
1137 */
984263bc 1138int
e62afb5f 1139hpfs_remove(struct vop_old_remove_args *ap)
984263bc
MD
1140{
1141 int error;
1142
1143 dprintf(("hpfs_remove(0x%x, %s, %ld): \n", VTOHP(ap->a_vp)->h_no,
1144 ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen));
1145
1146 if (ap->a_vp->v_type == VDIR)
1147 return (EPERM);
1148
1149 error = hpfs_removefnode (ap->a_dvp, ap->a_vp, ap->a_cnp);
1150 return (error);
1151}
1152
dd3af26c
CP
1153/*
1154 * hpfs_create(struct vnode *a_dvp, struct vnode **a_vpp,
1155 * struct componentname *a_cnp, struct vattr *a_vap)
1156 */
984263bc 1157int
e62afb5f 1158hpfs_create(struct vop_old_create_args *ap)
984263bc
MD
1159{
1160 int error;
1161
1162 dprintf(("hpfs_create(0x%x, %s, %ld): \n", VTOHP(ap->a_dvp)->h_no,
1163 ap->a_cnp->cn_nameptr, ap->a_cnp->cn_namelen));
1164
984263bc
MD
1165 error = hpfs_makefnode (ap->a_dvp, ap->a_vpp, ap->a_cnp, ap->a_vap);
1166
1167 return (error);
1168}
1169
1170/*
1171 * Return POSIX pathconf information applicable to NTFS filesystem
dd3af26c
CP
1172 *
1173 * hpfs_pathconf(struct vnode *a_vp, int a_name, t *a_retval)
984263bc
MD
1174 */
1175int
dd3af26c 1176hpfs_pathconf(struct vop_pathconf_args *ap)
984263bc
MD
1177{
1178 switch (ap->a_name) {
1179 case _PC_LINK_MAX:
1180 *ap->a_retval = 1;
1181 return (0);
1182 case _PC_NAME_MAX:
1183 *ap->a_retval = HPFS_MAXFILENAME;
1184 return (0);
1185 case _PC_PATH_MAX:
1186 *ap->a_retval = PATH_MAX;
1187 return (0);
1188 case _PC_CHOWN_RESTRICTED:
1189 *ap->a_retval = 1;
1190 return (0);
1191 case _PC_NO_TRUNC:
1192 *ap->a_retval = 0;
1193 return (0);
1194#if defined(__NetBSD__)
1195 case _PC_SYNC_IO:
1196 *ap->a_retval = 1;
1197 return (0);
1198 case _PC_FILESIZEBITS:
1199 *ap->a_retval = 32;
1200 return (0);
1201#endif
1202 default:
1203 return (EINVAL);
1204 }
1205 /* NOTREACHED */
1206}
1207
1208
1209/*
1210 * Global vfs data structures
1211 */
a11aaa81 1212
66a1ddf5
MD
1213struct vop_ops hpfs_vnode_vops = {
1214 .vop_default = vop_defaultop,
1215 .vop_getattr = hpfs_getattr,
1216 .vop_setattr = hpfs_setattr,
1217 .vop_inactive = hpfs_inactive,
1218 .vop_reclaim = hpfs_reclaim,
1219 .vop_print = hpfs_print,
1220 .vop_old_create = hpfs_create,
1221 .vop_old_remove = hpfs_remove,
66a1ddf5
MD
1222 .vop_old_lookup = hpfs_lookup,
1223 .vop_access = hpfs_access,
1224 .vop_readdir = hpfs_readdir,
1225 .vop_fsync = hpfs_fsync,
1226 .vop_bmap = hpfs_bmap,
1787385d
MD
1227 .vop_getpages = vop_stdgetpages,
1228 .vop_putpages = vop_stdputpages,
66a1ddf5
MD
1229 .vop_strategy = hpfs_strategy,
1230 .vop_read = hpfs_read,
1231 .vop_write = hpfs_write,
1232 .vop_ioctl = hpfs_ioctl,
1233 .vop_pathconf = hpfs_pathconf
984263bc
MD
1234};
1235