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 struct vfsops Afs_vfsops = {
26 struct vfs *afs_globalVFS = 0;
27 struct vcache *afs_globalVp = 0;
28 int afs_rootCellIndex = 0;
30 #if !defined(AFS_USR_AIX_ENV)
31 #include "sys/syscall.h"
35 afs_mount(struct vfs *afsp, char *path, void *data)
37 AFS_STATCNT(afs_mount);
40 /* Don't allow remounts since some system (like AIX) don't handle it well */
41 return (setuerror(EBUSY));
44 afsp->vfs_bsize = 8192;
45 afsp->vfs_fsid.val[0] = AFS_VFSMAGIC; /* magic */
46 afsp->vfs_fsid.val[1] = (intptr_t)AFS_VFSFSID;
52 afs_unmount(struct vfs *afsp)
54 AFS_STATCNT(afs_unmount);
61 afs_root(OSI_VFS_DECL(afsp), struct vnode **avpp)
65 struct vcache *tvp = 0;
66 OSI_VFS_CONVERT(afsp);
68 AFS_STATCNT(afs_root);
69 if (afs_globalVp && (afs_globalVp->f.states & CStatd)) {
73 afs_PutVCache(afs_globalVp);
77 if (!(code = afs_InitReq(&treq, get_user_struct()->u_cred))
78 && !(code = afs_CheckInit())) {
79 tvp = afs_GetVCache(&afs_rootFid, &treq, NULL, NULL);
80 /* we really want this to stay around */
90 AFSTOV(tvp)->v_flag |= VROOT; /* No-op on Ultrix 2.2 */
95 afs_Trace3(afs_iclSetp, CM_TRACE_GOPEN, ICL_TYPE_POINTER, *avpp,
96 ICL_TYPE_INT32, 0, ICL_TYPE_INT32, code);
101 afs_sync(struct vfs *afsp)
103 AFS_STATCNT(afs_sync);
108 afs_statfs(struct vfs *afsp, struct statfs *abp)
110 AFS_STATCNT(afs_statfs);
112 abp->f_bsize = afsp->vfs_bsize;
113 abp->f_fsid.val[0] = AFS_VFSMAGIC; /* magic */
114 abp->f_fsid.val[1] = (intptr_t)AFS_VFSFSID;
119 afs_statvfs(struct vfs *afsp, struct statvfs *abp)
121 AFS_STATCNT(afs_statfs);
123 abp->f_frsize = 1024;
124 abp->f_bsize = afsp->vfs_bsize;
125 abp->f_blocks = abp->f_bfree = abp->f_bavail = abp->f_files =
126 abp->f_favail = abp->f_ffree = AFS_VFS_FAKEFREE;
128 #ifdef AFS_USR_AIX_ENV
129 abp->f_fsid.val[0] = AFS_VFSMAGIC;
130 abp->f_fsid.val[1] = AFS_VFSFSID;
132 abp->f_fsid = (AFS_VFSMAGIC << 16) || AFS_VFSFSID;
141 AFS_STATCNT(afs_mountroot);
148 AFS_STATCNT(afs_swapvp);