Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afs / UKERNEL / osi_vnodeops.c
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
4 *
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
9
10 #include <afsconfig.h>
11 #include "afs/param.h"
12
13
14 #include "afs/sysincludes.h" /* Standard vendor system headers */
15 #include "afsincludes.h" /* Afs-based standard headers */
16 #include "afs/afs_stats.h" /* statistics */
17
18 int
19 afs_vrdwr(struct usr_vnode *avc, struct usr_uio *uio, int rw, int io,
20 struct usr_ucred *cred)
21 {
22 int rc;
23
24 if (rw == UIO_WRITE) {
25 rc = afs_write(VTOAFS(avc), uio, io, cred, 0);
26 } else {
27 rc = afs_read(VTOAFS(avc), uio, cred, 0);
28 }
29
30 return rc;
31 }
32
33 int
34 afs_inactive(struct vcache *avc, afs_ucred_t *acred)
35 {
36 if (afs_shuttingdown != AFS_RUNNING)
37 return 0;
38
39 usr_assert(avc->vrefCount == 0);
40 afs_InactiveVCache(avc, acred);
41
42 return 0;
43 }
44
45 struct usr_vnodeops Afs_vnodeops = {
46 afs_open,
47 afs_close,
48 afs_vrdwr,
49 afs_badop, /* ioctl */
50 afs_noop, /* select */
51 afs_getattr,
52 afs_setattr,
53 afs_access,
54 afs_lookup,
55 afs_create,
56 afs_remove,
57 afs_link,
58 afs_rename,
59 afs_mkdir,
60 afs_rmdir,
61 afs_readdir,
62 afs_symlink,
63 afs_readlink,
64 afs_fsync,
65 afs_inactive,
66 afs_badop, /* bmap */
67 afs_badop, /* strategy */
68 afs_badop, /* bread */
69 afs_badop, /* brelse */
70 afs_lockctl,
71 afs_fid
72 };
73
74 struct usr_vnodeops *afs_ops = &Afs_vnodeops;