libafs-prototypes-20081129
[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 RCSID
14     ("$Header$");
15
16 #include "afs/sysincludes.h"    /* Standard vendor system headers */
17 #include "afsincludes.h"        /* Afs-based standard headers */
18 #include "afs/afs_stats.h"      /* statistics */
19     
20 int
21 afs_vrdwr(struct usr_vnode *avc, struct usr_uio *uio, int rw, int io,
22           struct usr_ucred *cred)
23 {
24     int rc;
25
26     if (rw == UIO_WRITE) {
27         rc = afs_write(avc, uio, io, cred, 0);
28     } else {
29         rc = afs_read(avc, uio, cred, 0, 0, 0);
30     }
31
32     return rc;
33 }
34
35 int
36 afs_inactive(struct vcache *avc, struct AFS_UCRED *acred)
37 {
38     struct vnode *vp = AFSTOV(avc);
39     if (afs_shuttingdown)
40         return;
41
42     usr_assert(avc->vrefCount == 0);
43     afs_InactiveVCache(avc, acred);
44 }
45
46 struct usr_vnodeops Afs_vnodeops = {
47     afs_open,
48     afs_close,
49     afs_vrdwr,
50     afs_badop,                  /* ioctl */
51     afs_noop,                   /* select */
52     afs_getattr,
53     afs_setattr,
54     afs_access,
55     afs_lookup,
56     afs_create,
57     afs_remove,
58     afs_link,
59     afs_rename,
60     afs_mkdir,
61     afs_rmdir,
62     afs_readdir,
63     afs_symlink,
64     afs_readlink,
65     afs_fsync,
66     afs_inactive,
67     afs_badop,                  /* bmap */
68     afs_badop,                  /* strategy */
69     afs_badop,                  /* bread */
70     afs_badop,                  /* brelse */
71     afs_lockctl,
72     afs_fid
73 };
74
75 struct usr_vnodeops *afs_ops = &Afs_vnodeops;