case MOD_LOAD:
if (inited) {
printf("afs cannot be MOD_LOAD'd more than once\n");
- error = -1;
+ error = EBUSY;
break;
}
if (sysent[AFS_SYSCALL].sy_call != nosys
&& sysent[AFS_SYSCALL].sy_call != lkmnosys) {
printf("AFS_SYSCALL in use. aborting\n");
- error = -1;
+ error = EBUSY;
break;
}
memset(&afs_vfsconf, 0, sizeof(struct vfsconf));
+#ifdef AFS_FBSD53_ENV
+ afs_vfsconf.vfc_version = VFS_VERSION;
+#endif
strcpy(afs_vfsconf.vfc_name, "AFS");
afs_vfsconf.vfc_vfsops = &afs_vfsops;
afs_vfsconf.vfc_typenum = -1; /* set by vfs_register */
afs_vfsconf.vfc_flags = VFCF_NETWORK;
- vfs_register(&afs_vfsconf); /* doesn't fail */
+ if ((error = vfs_register(&afs_vfsconf)) != 0)
+ break;
vfs_add_vnodeops(&afs_vnodeop_opv_desc);
osi_Init();
#if 0
break;
}
if (afs_globalVFS) {
- error = -1;
+ error = EBUSY;
break;
}
- if (vfs_unregister(&afs_vfsconf)) {
- error = -1;
+ if ((error = vfs_unregister(&afs_vfsconf)) != 0) {
break;
}
vfs_rm_vnodeops(&afs_vnodeop_opv_desc);
#include <sys/conf.h>
#include <sys/syscall.h>
-struct vcache *afs_globalVp = 0;
-struct mount *afs_globalVFS = 0;
+struct vcache *afs_globalVp = NULL;
+struct mount *afs_globalVFS = NULL;
int afs_pbuf_freecnt = -1;
#ifdef AFS_FBSD50_ENV
return (0); /* nothing to do. ? */
}
+#ifdef AFS_FBSD53_ENV
+int
+afs_mount(struct mount *mp, struct thread *td)
+{
+ int afs_omount(struct mount *mp, char *path, caddr_t data, struct thread *p);
+
+ return afs_omount(mp, NULL, NULL, td);
+}
+#endif
+
int
-afs_mount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp,
+#ifdef AFS_FBSD53_ENV
+afs_omount(struct mount *mp, char *path, caddr_t data, struct thread *p)
+#else
+afs_omount(struct mount *mp, char *path, caddr_t data, struct nameidata *ndp,
THREAD_OR_PROC)
+#endif
{
/* ndp contains the mounted-from device. Just ignore it.
* we also don't care about our proc struct. */
if (afs_globalVFS) { /* Don't allow remounts. */
AFS_GUNLOCK();
- return (EBUSY);
+ return EBUSY;
}
afs_globalVFS = mp;
vfs_getnewfsid(mp);
mp->mnt_stat.f_iosize = 8192;
- (void)copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
+ if (path)
+ (void) copyinstr(path, mp->mnt_stat.f_mntonname, MNAMELEN - 1, &size);
memset(mp->mnt_stat.f_mntonname + size, 0, MNAMELEN - size);
memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
strcpy(mp->mnt_stat.f_mntfromname, "AFS");
}
int
+#ifdef AFS_FBSD53_ENV
+afs_root(struct mount *mp, struct vnode **vpp, struct thread *td)
+#else
afs_root(struct mount *mp, struct vnode **vpp)
+#endif
{
int error;
struct vrequest treq;
register struct vcache *tvp = 0;
#ifdef AFS_FBSD50_ENV
+#ifndef AFS_FBSD53_ENV
struct thread *td = curthread;
+#endif
struct ucred *cr = td->td_ucred;
#else
struct proc *p = curproc;
}
struct vfsops afs_vfsops = {
+#ifdef AFS_FBSD53_ENV
afs_mount,
+#endif
+ afs_omount,
afs_start,
afs_unmount,
afs_root,
vfs_stduninit,
vfs_stdextattrctl,
#ifdef AFS_FBSD50_ENV
- NULL,
+ vfs_stdsysctl,
#endif
};