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"
16 #include "afs/sysincludes.h" /* Standard vendor system headers */
17 #include "afsincludes.h" /* Afs-based standard headers */
18 #include "afs/afs_stats.h" /* statistics stuff */
27 struct vfsops Afs_vfsops = {
35 struct vfs *afs_globalVFS = 0;
36 struct vcache *afs_globalVp = 0;
37 int afs_rootCellIndex = 0;
39 #if !defined(AFS_USR_AIX_ENV)
40 #include "sys/syscall.h"
43 afs_mount(afsp, path, data)
48 AFS_STATCNT(afs_mount);
51 /* Don't allow remounts since some system (like AIX) don't handle it well */
52 return (setuerror(EBUSY));
55 afsp->vfs_bsize = 8192;
56 afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
57 afsp->vfs_fsid.val[1] = (afs_int32) AFS_VFSFSID;
65 AFS_STATCNT(afs_unmount);
71 afs_root(OSI_VFS_ARG(afsp), avpp)
75 register afs_int32 code = 0;
77 register struct vcache *tvp = 0;
78 OSI_VFS_CONVERT(afsp);
80 AFS_STATCNT(afs_root);
81 if (afs_globalVp && (afs_globalVp->f.states & CStatd)) {
85 afs_PutVCache(afs_globalVp);
89 if (!(code = afs_InitReq(&treq, u.u_cred))
90 && !(code = afs_CheckInit())) {
91 tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
92 /* we really want this to stay around */
100 VN_HOLD(AFSTOV(tvp));
102 AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */
103 afs_globalVFS = afsp;
107 afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, *avpp,
108 ICL_TYPE_INT32, 0, ICL_TYPE_INT32, code);
115 AFS_STATCNT(afs_sync);
119 afs_statfs(afsp, abp)
120 register struct vfs *afsp;
123 AFS_STATCNT(afs_statfs);
125 abp->f_bsize = afsp->vfs_bsize;
126 abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
127 abp->f_fsid.val[1] = (afs_int32) AFS_VFSFSID;
133 AFS_STATCNT(afs_mountroot);
139 AFS_STATCNT(afs_swapvp);