2 * Copyright 2000, International Business Machines Corporation and others.
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
10 #include "../afs/param.h" /* Should be always first */
11 #include "../afs/sysincludes.h" /* Standard vendor system headers */
12 #include "../afs/afsincludes.h" /* Afs-based standard headers */
13 #include "../afs/afs_stats.h" /* statistics stuff */
22 struct vfsops Afs_vfsops = {
30 struct vfs *afs_globalVFS = 0;
31 struct vcache *afs_globalVp = 0;
32 int afs_rootCellIndex = 0;
34 #if !defined(AFS_USR_AIX_ENV)
35 #include "../sys/syscall.h"
38 afs_mount(afsp, path, data)
43 AFS_STATCNT(afs_mount);
46 /* Don't allow remounts since some system (like AIX) don't handle it well */
47 return (setuerror(EBUSY));
50 afsp->vfs_bsize = 8192;
51 afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
52 afsp->vfs_fsid.val[1] = AFS_VFSFSID;
59 AFS_STATCNT(afs_unmount);
65 afs_root (OSI_VFS_ARG(afsp), avpp)
67 struct vnode **avpp; {
68 register afs_int32 code = 0;
70 register struct vcache *tvp=0;
73 AFS_STATCNT(afs_root);
74 if (afs_globalVp && (afs_globalVp->states & CStatd)) {
77 if (!(code = afs_InitReq(&treq, u.u_cred)) &&
78 !(code = afs_CheckInit())) {
79 tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
80 (struct vcache*)0, WRITE_LOCK);
81 /* we really want this to stay around */
89 VN_HOLD((struct vnode *)tvp);
91 tvp->v.v_flag |= VROOT; /* No-op on Ultrix 2.2 */
93 *avpp = (struct vnode *) tvp;
96 afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, *avpp,
97 ICL_TYPE_INT32, 0, ICL_TYPE_INT32, code);
104 AFS_STATCNT(afs_sync);
108 afs_statfs(afsp, abp)
109 register struct vfs *afsp;
112 AFS_STATCNT(afs_statfs);
114 abp->f_bsize = afsp->vfs_bsize;
115 abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
116 abp->f_fsid.val[1] = AFS_VFSFSID;
122 AFS_STATCNT(afs_mountroot);
128 AFS_STATCNT(afs_swapvp);