#endif
#if !defined(AFS_SGI_ENV)
-#ifdef AFS_OSF_ENV
-#include <sys/mount.h>
-#include <ufs/fs.h>
-#else /* AFS_OSF_ENV */
#ifdef AFS_VFSINCL_ENV
#define VFS
#ifdef AFS_SUN5_ENV
#include <sys/fs.h>
#endif
#endif /* AFS_VFSINCL_ENV */
-#endif /* AFS_OSF_ENV */
#include <sys/file.h>
#ifdef AFS_AIX_ENV
#include <sys/vfs.h>
#include <mntent.h>
#endif
-#include <rx/xdr.h>
+#include <afs/opr.h>
+#ifdef AFS_PTHREAD_ENV
+# include <opr/lock.h>
+#endif
#include <afs/afsint.h>
+#include <rx/rx_queue.h>
#include "nfs.h"
#include <afs/errors.h>
#include "lock.h"
if (strncmp(part, VICE_PARTITION_PREFIX, VICE_PREFIX_SIZE)) {
return 0;
}
+ if (volutil_GetPartitionID(part) == -1) {
+ Log("Warning: %s is a bad partition name; ignored.\n", part);
+ return 0;
+ }
if (afs_stat(part, &status) < 0) {
Log("VInitVnodes: Couldn't find file system %s; ignored\n", part);
return 0;
struct dirent *dp;
dirp = opendir(part);
- osi_Assert(dirp);
+ opr_Assert(dirp);
while ((dp = readdir(dirp))) {
if (dp->d_name[0] == 'V') {
Log("This program is compiled with AFS_NAMEI_ENV, but partition %s seems to contain volumes which don't use the namei-interface; aborting\n", part);
#endif /* AFS_NAMEI_ENV */
#endif /* !AFS_LINUX20_ENV && !AFS_NT40_ENV */
-#if defined(AFS_DUX40_ENV) && !defined(AFS_NAMEI_ENV)
- if (status.st_ino != ROOTINO) {
- Log("%s is not a mounted file system; ignored.\n", part);
- return 0;
- }
-#endif
-
VInitPartition(part, devname, status.st_dev);
return 0;
return errors;
}
#endif
-#if defined(AFS_DUX40_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int
VAttachPartitions(void)
{
}
#endif /* AFS_DEMAND_ATTACH_FS */
if (abortp)
- osi_Assert(dp != NULL);
+ opr_Assert(dp != NULL);
return dp;
}
(FD_t)CreateFile(path, GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
- osi_Assert(dp->lock_fd != INVALID_FD);
+ opr_Assert(dp->lock_fd != INVALID_FD);
memset(&lap, 0, sizeof(lap));
rc = LockFileEx((HANDLE) dp->lock_fd, LOCKFILE_EXCLUSIVE_LOCK, 0, 1,
0, &lap);
- osi_Assert(rc);
+ opr_Assert(rc);
}
}
pausing.tv_usec = 500000;
select(0, NULL, NULL, NULL, &pausing);
}
- osi_Assert(retries != 0);
+ opr_Assert(retries != 0);
#if defined (AFS_HPUX_ENV)
- osi_Assert(getprivgrp(privGrpList) == 0);
+ opr_Verify(getprivgrp(privGrpList) == 0);
/*
* In general, it will difficult and time-consuming ,if not impossible,
if (((*globalMask) & privmask(PRIV_LOCKRDONLY)) == 0) {
/* allow everybody to set a lock on a read-only file descriptor */
(*globalMask) |= privmask(PRIV_LOCKRDONLY);
- osi_Assert(setprivgrp(PRIV_GLOBAL, privGrpList[globalMaskIndex].priv_mask)
- == 0);
+ opr_Verify(setprivgrp(PRIV_GLOBAL,
+ privGrpList[globalMaskIndex].priv_mask) == 0);
lockfRtn = lockf(dp->lock_fd, F_LOCK, 0);
/* remove the privilege granted to everybody to lock a read-only fd */
(*globalMask) &= ~(privmask(PRIV_LOCKRDONLY));
- osi_Assert(setprivgrp(PRIV_GLOBAL, privGrpList[globalMaskIndex].priv_mask)
- == 0);
+ opr_Verify(setprivgrp(PRIV_GLOBAL,
+ privGrpList[globalMaskIndex].priv_mask) == 0);
} else {
/* in this case, we should be able to do this with impunity, anyway */
lockfRtn = lockf(dp->lock_fd, F_LOCK, 0);
}
- osi_Assert(lockfRtn != -1);
+ opr_Assert(lockfRtn != -1);
#else
#if defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV)
- osi_Assert(lockf(dp->lock_fd, F_LOCK, 0) != -1);
+ opr_Verify(lockf(dp->lock_fd, F_LOCK, 0) != -1);
#else
- osi_Assert(flock(dp->lock_fd, LOCK_EX) == 0);
+ opr_Verify(flock(dp->lock_fd, LOCK_EX) == 0);
#endif /* defined(AFS_AIX_ENV) || defined(AFS_SUN5_ENV) */
#endif
}
}
if (abortp) {
- osi_Assert(dp != NULL);
+ opr_Assert(dp != NULL);
}
return dp;
}
static void
AddPartitionToTable_r(struct DiskPartition64 *dp)
{
- osi_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS);
+ opr_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS);
DiskPartitionTable[dp->index] = dp;
}
static void
DeletePartitionFromTable_r(struct DiskPartition64 *dp)
{
- osi_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS);
+ opr_Assert(dp->index >= 0 && dp->index <= VOLMAXPARTS);
DiskPartitionTable[dp->index] = NULL;
}
#endif