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"
14 #include "afs/sysincludes.h" /* Standard vendor system headers */
15 #include "afsincludes.h" /* Afs-based standard headers */
16 #include "afs/afs_stats.h" /* statistics stuff */
18 int afs_statfs(register struct vfs *afsp, struct statfs *abp);
19 int afs_sync(struct vfs *afsp);
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"
39 afs_mount(struct vfs *afsp, char *path, void *data)
41 AFS_STATCNT(afs_mount);
44 /* Don't allow remounts since some system (like AIX) don't handle it well */
45 return (setuerror(EBUSY));
48 afsp->vfs_bsize = 8192;
49 afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
50 afsp->vfs_fsid.val[1] = (intptr_t)AFS_VFSFSID;
56 afs_unmount(struct vfs *afsp)
58 AFS_STATCNT(afs_unmount);
65 afs_root(OSI_VFS_DECL(afsp), struct vnode **avpp)
67 register afs_int32 code = 0;
69 register struct vcache *tvp = 0;
70 OSI_VFS_CONVERT(afsp);
72 AFS_STATCNT(afs_root);
73 if (afs_globalVp && (afs_globalVp->f.states & CStatd)) {
77 afs_PutVCache(afs_globalVp);
81 if (!(code = afs_InitReq(&treq, get_user_struct()->u_cred))
82 && !(code = afs_CheckInit())) {
83 tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
84 /* we really want this to stay around */
94 AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */
99 afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, *avpp,
100 ICL_TYPE_INT32, 0, ICL_TYPE_INT32, code);
105 afs_sync(struct vfs *afsp)
107 AFS_STATCNT(afs_sync);
112 afs_statfs(register struct vfs *afsp, struct statfs *abp)
114 AFS_STATCNT(afs_statfs);
116 abp->f_bsize = afsp->vfs_bsize;
117 abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
118 abp->f_fsid.val[1] = (intptr_t)AFS_VFSFSID;
123 afs_statvfs(struct vfs *afsp, struct statvfs *abp)
125 AFS_STATCNT(afs_statfs);
127 abp->f_frsize = 1024;
128 abp->f_favail = 9000000;
129 abp->f_bsize = afsp->vfs_bsize;
130 abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
131 abp->f_ffree = 9000000;
132 abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
140 AFS_STATCNT(afs_mountroot);
147 AFS_STATCNT(afs_swapvp);