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 <afsconfig.h>
11 #include "../afs/param.h"
15 #include "../afs/sysincludes.h" /* Standard vendor system headers */
16 #include "../afs/afsincludes.h" /* Afs-based standard headers */
17 #include "../afs/afs_stats.h" /* statistics stuff */
26 struct vfsops Afs_vfsops = {
34 struct vfs *afs_globalVFS = 0;
35 struct vcache *afs_globalVp = 0;
36 int afs_rootCellIndex = 0;
38 #if !defined(AFS_USR_AIX_ENV)
39 #include "../sys/syscall.h"
42 afs_mount(afsp, path, data)
47 AFS_STATCNT(afs_mount);
50 /* Don't allow remounts since some system (like AIX) don't handle it well */
51 return (setuerror(EBUSY));
54 afsp->vfs_bsize = 8192;
55 afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
56 afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID;
63 AFS_STATCNT(afs_unmount);
69 afs_root (OSI_VFS_ARG(afsp), avpp)
71 struct vnode **avpp; {
72 register afs_int32 code = 0;
74 register struct vcache *tvp=0;
77 AFS_STATCNT(afs_root);
78 if (afs_globalVp && (afs_globalVp->states & CStatd)) {
82 afs_PutVCache(afs_globalVp);
86 if (!(code = afs_InitReq(&treq, u.u_cred)) &&
87 !(code = afs_CheckInit())) {
88 tvp = afs_GetVCache(&afs_rootFid, &treq, (afs_int32 *)0,
89 (struct vcache*)0, WRITE_LOCK);
90 /* we really want this to stay around */
100 AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */
101 afs_globalVFS = afsp;
105 afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, *avpp,
106 ICL_TYPE_INT32, 0, ICL_TYPE_INT32, code);
113 AFS_STATCNT(afs_sync);
117 afs_statfs(afsp, abp)
118 register struct vfs *afsp;
121 AFS_STATCNT(afs_statfs);
123 abp->f_bsize = afsp->vfs_bsize;
124 abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
125 abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID;
131 AFS_STATCNT(afs_mountroot);
137 AFS_STATCNT(afs_swapvp);