int
afs_quotactl()
{
- return EOPNOTSUPP;
+ return ENOTSUP;
}
int
void *mdata = vfs_fsprivate(mp);
int error;
struct vrequest treq;
- register struct vcache *tvp = 0;
+ struct vcache *tvp = 0;
+ struct vcache *gvp;
+ int needref=0;
#ifdef AFS_DARWIN80_ENV
struct ucred *cr = vfs_context_ucred(ctx);
- int needref=0;
#else
struct proc *p = current_proc();
struct ucred _cr;
#endif
AFS_GLOCK();
AFS_STATCNT(afs_root);
+
+again:
if (mdata == NULL && afs_globalVp
&& (afs_globalVp->f.states & CStatd)) {
tvp = afs_globalVp;
error = 0;
-#ifdef AFS_DARWIN80_ENV
needref=1;
-#endif
} else if (mdata == (qaddr_t) - 1) {
error = ENOENT;
} else {
AFS_GLOCK();
if (error)
tvp = NULL;
- else
+ else
/* re-acquire the usecount that finalizevnode disposed of */
vnode_ref(AFSTOV(tvp));
}
/* we really want this to stay around */
if (tvp) {
if (mdata == NULL) {
- if (afs_globalVp) {
- afs_PutVCache(afs_globalVp);
- afs_globalVp = NULL;
- }
+ gvp = afs_globalVp;
afs_globalVp = tvp;
-#ifdef AFS_DARWIN80_ENV
+ if (gvp) {
+ afs_PutVCache(gvp);
+ if (tvp != afs_globalVp) {
+ /* someone else got there before us! */
+ afs_PutVCache(tvp);
+ tvp = 0;
+ goto again;
+ }
+ }
needref=1;
-#endif
}
} else
error = ENOENT;
}
}
if (tvp) {
-#ifndef AFS_DARWIN80_ENV /* DARWIN80 caller does not need a usecount reference */
+#ifndef AFS_DARWIN80_ENV /* KPI callers don't need a usecount reference */
osi_vnhold(tvp, 0);
AFS_GUNLOCK();
vn_lock(AFSTOV(tvp), LK_EXCLUSIVE | LK_RETRY, p);
AFS_GLOCK();
#endif
+
+ if (needref)
#ifdef AFS_DARWIN80_ENV
- if (needref) /* this iocount is for the caller. the initial iocount
- is for the eventual afs_PutVCache. for mdata != null,
- there will not be a PutVCache, so the caller gets the
- initial (from GetVCache or finalizevnode) iocount*/
- vnode_get(AFSTOV(tvp));
+ /* This iocount is for the caller. the initial iocount
+ * is for the eventual afs_PutVCache. for mdata != null,
+ * there will not be a PutVCache, so the caller gets the
+ * initial (from GetVCache or finalizevnode) iocount
+ */
+ vnode_get(AFSTOV(tvp));
+#else
+ ;
#endif
- if (mdata == NULL) {
+
+ if (mdata == NULL)
afs_globalVFS = mp;
- }
+
*vpp = AFSTOV(tvp);
#ifndef AFS_DARWIN80_ENV
AFSTOV(tvp)->v_flag |= VROOT;
VOL_CAP_FMT_ZERO_RUNS |
VOL_CAP_FMT_CASE_SENSITIVE |
VOL_CAP_FMT_CASE_PRESERVING |
+ VOL_CAP_FMT_PERSISTENTOBJECTIDS |
+ VOL_CAP_FMT_2TB_FILESIZE |
VOL_CAP_FMT_FAST_STATFS;
vcapattrptr->capabilities[VOL_CAPABILITIES_INTERFACES] =
VOL_CAP_INT_ADVLOCK |
VOL_CAP_FMT_ZERO_RUNS |
VOL_CAP_FMT_CASE_SENSITIVE |
VOL_CAP_FMT_CASE_PRESERVING |
+ VOL_CAP_FMT_PERSISTENTOBJECTIDS |
+ VOL_CAP_FMT_2TB_FILESIZE |
VOL_CAP_FMT_FAST_STATFS;
vcapattrptr->valid[VOL_CAPABILITIES_INTERFACES] =
VOL_CAP_INT_SEARCHFS |
u_int32_t afs_darwin_realmodes = 0;
u_int32_t afs_darwin_fsevents = 0;
+extern int AFSDOBULK;
int
afs_sysctl_int(int *name, u_int namelen, user_addr_t oldp, size_t *oldlenp,
case AFS_SC_DARWIN_ALL_FSEVENTS:
return afs_sysctl_int(name, namelen, oldp, oldlenp,
newp, newlen, &afs_darwin_fsevents);
+ case AFS_SC_DARWIN_ALL_BULKSTAT:
+ return afs_sysctl_int(name, namelen, oldp, oldlenp,
+ newp, newlen, &AFSDOBULK);
}
break;
/* darwin version specific sysctl's goes here */
}
break;
}
- return EOPNOTSUPP;
+ return ENOTSUP;
}
typedef (*PFI) ();